winbond SPIFlash.h define for delayMicroseconds(us)

unuldinei
Posts: 11
Joined: Tue Jul 21, 2015 8:32 pm
Location: Bucuresti RO
Contact:

winbond SPIFlash.h define for delayMicroseconds(us)

Post by 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!

User avatar
BennehBoy
Posts: 420
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Re: winbond SPIFlash.h define for delayMicroseconds(us)

Post by BennehBoy » Mon Feb 06, 2017 10:01 am

I thought that it was this:

Code: Select all

#if defined(_VARIANT_ARDUINO_STM32_)
-------------------------------------
https://github.com/BennehBoy

User avatar
Manny
Posts: 41
Joined: Wed Dec 09, 2015 3:15 pm

Re: winbond SPIFlash.h define for delayMicroseconds(us)

Post by Manny » Mon Feb 06, 2017 11:15 am


unuldinei
Posts: 11
Joined: Tue Jul 21, 2015 8:32 pm
Location: Bucuresti RO
Contact:

Re: winbond SPIFlash.h define for delayMicroseconds(us)

Post by 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
Posts: 1681
Joined: Mon Apr 27, 2015 12:12 pm

Re: winbond SPIFlash.h define for delayMicroseconds(us)

Post by 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...:)
How long does it take with the stm? just out of curiosity, since you posted the number for the arduino.

User avatar
RogerClark
Posts: 7156
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: winbond SPIFlash.h define for delayMicroseconds(us)

Post by 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
Posts: 1449
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: winbond SPIFlash.h define for delayMicroseconds(us)

Post by zmemw16 » Thu Mar 16, 2017 10:18 pm

i thought __arm__ works as well
istr seeing it in teensy ports i think
srp

User avatar
RogerClark
Posts: 7156
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: winbond SPIFlash.h define for delayMicroseconds(us)

Post by 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
Yes. I think __arm__ may be put in by gcc (arm)

zmemw16
Posts: 1449
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: winbond SPIFlash.h define for delayMicroseconds(us)

Post by 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
Posts: 336
Joined: Thu Sep 01, 2016 8:52 pm
Location: Hungary
Contact:

Re: winbond SPIFlash.h define for delayMicroseconds(us)

Post by 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)
ARDUINO_ARCH_STM32F1 is already defined in platform.txt, as `-DARDUINO_ARCH_{build.arch}`. It is actually like this every platform.txt I have seen.

Also, __STM32F1__ is not auto-generated, it is explicit in platform.txt as well.

Post Reply