I am trying to port some code provided by ST for their Nemo-M1 eval board. They have build projects for IAR, CooCox, and Keil. Anyways, in the port i’ve found a section that is compiler specific, and wondering what to do here. I looked for the general GCC answer and it’s not working either :/
#if defined (IAR_ARM_CM3)
/**
* @brief Flag stored in Flash at address 0x0807F800 in case of IAR.
*/
const uint16_t nErasedFlag @ (FLASH_PARS_ADDR) =0x0300;
#elif defined (KEIL)
/**
* @brief Flag stored in Flash at address 0x0807F800 in case of Keil.
*/
const uint16_t nErasedFlag __attribute__((at(FLASH_PARS_ADDR))) =0x0300;
#elif defined (CooCox)
/**
* @brief Flag stored in Flash at address 0x0807F800 in case of CooCox.
*/
__attribute__ ((section(".SECTION251"))) uint16_t nErasedFlag = 0x0300;
#elif defined(__GNUC__) /* This is my creation I'm working on*/
#define nErasedFlag (*((volatile uint16_t *)FLASH_PARS_ADDR)))
nErasedFlag = 0x0300;
#endif
Any other gotcha’s? I am starting from the IAR project (since I use that at work) and moving stuff over. Is there a different one of the above projects that will be closer to GCC to start?
-
This topic was modified 9 years, 6 months ago by sd_tom.