2019-04-04 10:38 PM
I am using #[STM32 MCUs] #Cortex-m0 . In linker file we have symbol: __ICFEDIT_region_ROM_start__
How we can use this symbol in application ?
I have assigned &__ICFEDIT_region_ROM_start__ to Pointer.
i.e int *p = &__ICFEDIT_region_ROM_start__
now using p we can fetch the data define by symbol __ICFEDIT_region_ROM_start__.
I want that data to be in macro definition. How i can use?
#define ROM_address __ICFEDIT_region_ROM_start__ ( ROM_address holds wrong data )
Solved! Go to Solution.
2019-04-05 12:48 AM
Try this way:
extern uint32_t __ICFEDIT_region_ROM_start__;
#define ROM_address ((void *)(&__ICFEDIT_region_ROM_start__))
Or change (void *) to whatever pointer type you require. And turn off compiler's strict aliasing rules to be safe (-fno-strict-aliasing option in GCC)
2019-04-05 12:48 AM
Try this way:
extern uint32_t __ICFEDIT_region_ROM_start__;
#define ROM_address ((void *)(&__ICFEDIT_region_ROM_start__))
Or change (void *) to whatever pointer type you require. And turn off compiler's strict aliasing rules to be safe (-fno-strict-aliasing option in GCC)
2019-04-05 02:22 AM
Thanks for the response.
It's perfectly working as expected.