winbond SPIFlash.h define for delayMicroseconds(us)

unuldinei
Mon Feb 06, 2017 9:41 am
Hello,
I try to compile SPIFlash library for STM32F103C for read and wite an eeprom win25q64 (8MByte BIOS ) but i get thiss

fatal error: util/delay.h: No such file or directory

#include <util/delay.h>

I discover in SPIFlash.h the line where is defined for esp but not for STM32F103C

#if defined (ARDUINO_ARCH_SAM) || defined (ARDUINO_ARCH_SAMD) || defined (ARDUINO_ARCH_ESP8266) || defined (STM ????? )
#define _delay_us(us) delayMicroseconds(us)
#else
#include <util/delay.h>
#endif

So what is the correct defined for STM32F103C because i try many variants?… Thanks for your monumental work , the STM is moore accesible for the entire world!


BennehBoy
Mon Feb 06, 2017 10:01 am
I thought that it was this:

#if defined(_VARIANT_ARDUINO_STM32_)


Manny
Mon Feb 06, 2017 11:15 am
On my phone answer here viewtopic.php?f=3&t=1187&p=21296&hilit=spiflash#p21276

unuldinei
Mon Feb 06, 2017 1:37 pm
Yes, it work! with the upper topic
Thanks again

#if defined (ARDUINO_ARCH_SAM) || defined (ARDUINO_ARCH_SAMD) || defined (ARDUINO_ARCH_ESP8266) || defined(__STM32F1__)

Now see if my project with load binary from sdcard to winbond BIOS work .On arduino pro mini time to loading was 45minutes…:)


victor_pv
Thu Mar 16, 2017 7:16 pm
unuldinei wrote:Yes, it work! with the upper topic
Thanks again

#if defined (ARDUINO_ARCH_SAM) || defined (ARDUINO_ARCH_SAMD) || defined (ARDUINO_ARCH_ESP8266) || defined(__STM32F1__)

Now see if my project with load binary from sdcard to winbond BIOS work .On arduino pro mini time to loading was 45minutes…:)


RogerClark
Thu Mar 16, 2017 9:12 pm
Looks like the Arduino and ESP8266 teams have changed the define they use.

The reason we use __STM32F1__ is because its auto-generated by the Arduino IDE, because of the core is in a folder called STM32F1.

i could add ARDUINO_ARCH_STM32F1 as well I suppose, if this is the new standardised way of defining the architecture name, but I am not sure how that would effect the libraries.
( I think __STM32F1__ will still be defined by the IDE unless they changed something in the IDE recently)


zmemw16
Thu Mar 16, 2017 10:18 pm
i thought __arm__ works as well
istr seeing it in teensy ports i think
srp

RogerClark
Fri Mar 17, 2017 2:31 am
zmemw16 wrote:i thought __arm__ works as well
istr seeing it in teensy ports i think
srp

zmemw16
Fri Mar 17, 2017 2:43 am
it may well be extended with m0/m3 ? just a guess that they might as istr m0/3/4/7 in the flags?????
srp

danieleff
Fri Mar 17, 2017 6:05 am
RogerClark wrote:Looks like the Arduino and ESP8266 teams have changed the define they use.

The reason we use __STM32F1__ is because its auto-generated by the Arduino IDE, because of the core is in a folder called STM32F1.

i could add ARDUINO_ARCH_STM32F1 as well I suppose, if this is the new standardised way of defining the architecture name, but I am not sure how that would effect the libraries.
( I think __STM32F1__ will still be defined by the IDE unless they changed something in the IDE recently)


RogerClark
Fri Mar 17, 2017 6:28 am
Thanks Daniel

Looks like the ARDUINO_ARCH stuff was there from the start (well, ages ago)

So long ago I don’t remember.

I’d need to double check if __STM32F1__ was originally auto generated, I thought was, but I could be wrong ;-)


Naguissa
Fri Mar 17, 2017 7:18 am
I was digging about Arduino IDE arches an now I’ve got:

ARDUINO_ARCH_AVR – Arduino AVR (Uno, nano, etc). ATMega based
ARDUINO_ARCH_SAM – Arduino SAM32 (Due)
ARDUINO_ARCH_SAMD – No idea, picked from previous post.
ARDUINO_ARCH_STM32F1 – STM32 F1 variant (Maple mini, etc)
ARDUINO_ARCH_STM32F3 – STM32 F2 variant (F3Discovery, etc)
ARDUINO_ARCH_STM32F4 – STM32 F4 variant (Netduino2, etc)
ARDUINO_ARCH_ARM – ARM boards
ARDUINO_ARCH_ESP8266 – ESP8266 boards (ESP01, NodeMCU, etc)

Open list in spanish: https://www.foroelectro.net/electronica … -t144.html


RogerClark
Fri Mar 17, 2017 9:07 am
Thanks

I think SAMD is the Arduino Zero


Naguissa
Mon Mar 19, 2018 2:29 pm
[Naguissa – Fri Mar 17, 2017 7:18 am] –
I was digging about Arduino IDE arches an now I’ve got:

ARDUINO_ARCH_AVR – Arduino AVR (Uno, nano, etc). ATMega based
ARDUINO_ARCH_SAM – Arduino SAM32 (Due)
ARDUINO_ARCH_SAMD – No idea, picked from previous post.
ARDUINO_ARCH_STM32F1 – STM32 F1 variant (Maple mini, etc)
ARDUINO_ARCH_STM32F3 – STM32 F2 variant (F3Discovery, etc)
ARDUINO_ARCH_STM32F4 – STM32 F4 variant (Netduino2, etc)
ARDUINO_ARCH_ARM – ARM boards
ARDUINO_ARCH_ESP8266 – ESP8266 boards (ESP01, NodeMCU, etc)

Open list in spanish: https://www.foroelectro.net/electronica … -t144.html

I want to resurrect this topic to add one extra useful define:

_VARIANT_ARDUINO_STM32_ – STM32 boards, all variants

Also update from Roger:

ARDUINO_ARCH_SAMD – SAMD boards (Arduino Zero and MKR1000)


Leave a Reply

Your email address will not be published. Required fields are marked *