Hello again,
I´d like to port some code which uses prcocessor specific defines like this ones:
__AVR_ATmega328P__ > AVR Mega 328
ESP8266 > ESP8266
__IMXRT1062__, ARDUINO_TEENSY41 > some Teensy boards
Which defines can I use when working with the STM32?
And can anyone tell me where I can find those defines? So I could search by myself.
For Arduino as an example I can find them in the gcc / Device-Specs Folder.
Dominik
Controller specific defines for STM
Re: Controller specific defines for STM
For the core:
For STM32 series:
where YY is the family, example for L4:
For specific product line:
You can find all product line in this file: https://github.com/stm32duino/Arduino_C ... ef_build.h
Finally you can also use specific cortex definition like it is done here: https://github.com/stm32duino/STM32Free ... ortmacro.h
Code: Select all
ARDUINO_ARCH_STM32
Code: Select all
STM32YYxx
Code: Select all
STM32L4xx
Code: Select all
STM32L452xx
Finally you can also use specific cortex definition like it is done here: https://github.com/stm32duino/STM32Free ... ortmacro.h
Code: Select all
#ifndef __CORTEX_M
#pragma GCC error "no \"__CORTEX_M\" definition"
#endif
#if (__CORTEX_M == 0x00U)
#include "../portable/GCC/ARM_CM0/portmacro.h"
#endif
Re: Controller specific defines for STM
Again. Many thx for your help.
This helps alot.
Dominik
This helps alot.
Dominik
Re: Controller specific defines for STM
One additional question ...
Is it possible to have that in some print statement?
Something like
Is it possible to have that in some print statement?
Something like
Code: Select all
Serial.Print("arch : "); Serial.Println(??ARCH??)