Hi.
I'm implementing some libraries for different STM32F4xx devices, and I want to know exactly, which device is currently used, so I can do different preprocessor stuff.
Exactly, I'm working leds and button library for STM32F4xx Discovery boards and want to know which board is used, when you select device in new project in Keil.
STM32F429ZI: (for STM32F429 Discovery board) STM32F407VG: (for STM32F4 Discovery board) STM32F401RE: (for Nucleo F401-RE board) STM32F401VC: (for STM32F401 Discovery board)
Is there a way, to get these MCU values in preprocessor?
Something like #if DEVICE == STM32F429ZI //DO stuff #elif DEVICE == STM32F407VG // #endif
ST uses define's in their builds for chips and boards
STM32F2XX, USE_STDPERIPH_DRIVER, HSE_VALUE=16000000 STM32F10X_MD_VL, USE_STDPERIPH_DRIVER USE_STDPERIPH_DRIVER,STM32F429_439xx,USE_STM324x9I_EVAL,
Then uses #ifdef's
Yeah, I know that, but you still have to set defines in project.
I don't want to do that, that's why I'm asking here.
People have for a huge number of years wanted that Kail should provide a number of #define based on different project settings. But even if they did, those settings would still relate to the processor and not to the board the processor is soldered to.
I know that. That's why I only want to know which PROCESSOR is used in project.
I just want to detect used device, not which board is used. Only processor selected.
I think this has been one of the most wanted request from Keil for the last 5+ years.
Indeed!
But, in this case, how about the $D Key Sequence: http://www.keil.com/support/man/docs/uv4/uv4_ut_keysequence.htm