This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Detect selected device in uvision

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