Hi, I like to place a constant table into flash at a specific adress. I found some hints around the __at directive but I did not find out how to handle this directive in case of constants.
I tried a couple of variations like the following one but none of them had been successfully
const char TestTableInFlash[] = { 0, 1, 2, 3, 4, 5, 6, 7 } __at 0x8010000;
In uVision's help search for Creating root execution regions There are some examples which should help you, but it's better to read everything there :)
I Locate const like that...
const unsigned long CRP_Key __at (0x1fc) = 0x12345678;
Doron
sorry, doesn't work
system\bm.c(27): error: #65: expected a ";" system\bm.c: const byte TestTableInFlash[] __at (0x8010000) = { 0, 1, 2, 3, 4, 5, 6, 7 }; system\bm.c: ^ system\bm.c: system\bm.c: 0 warnings, 1 error
Try using:
__attribute__ ((at(_addr)))
You may get a linker error that the address you have specified for your table overlaps with already defined load region. Check your scatter file to see your Load regions and Linker Manual for more info