Hello,
I'd like to have a variable located in onboard flash
#include <cr_section_macros.h>
__RODATA(BoardFlash) const volatile uint64_t BoardFlashMarker = 0x0123456789abcdef;
But a warning is produced:
Warning: setting incorrect section attributes for .rodata.$BoardFlash
This is the compiler generated code:
.global BoardFlashMarker
.section .rodata.$BoardFlash,"aw"
Are there any obvious mistakes in my approach?
It seems for some reason the compiler applies the "aw" attribute, even though the variable is declared const.
I tried to work around this by setting the attributes "manually" and hacking the correct(?) attribute:
__attribute__ ((section(".rodata.$BoardFlash,\"a\"@"))) const volatile uint64_t BoardFlashMarker = 0x0123456789abcdef;
which produces the following code:
.global BoardFlashMarker
.section .rodata.$BoardFlash,"a"@,"aw"
the @ serves as comment, thus the "aw" is ineffective and the warning is gone.
I'd rather not use such hacks, but also I don't like the warnings.
Did anybody have experienced this behavior?
I use MCUXpresso IDE v11.1.0 [Build 3209].