Is there any way to place a const variable to an odd address of the flash, so that the value is in the HEX file?
It needs to be at a specific flash address, i can not use the SAF Block because its to small also the eeprom is fully occupied. Therefor a specific flash area will be allocated for storing values that are not changing so often.
in PIC16F devices this works flawless with:
const uint8_t dummydata[] __attribute__((address(0x2003))) = {0xAA};
PIC18F16Q41 to be exact, tells me that this is not on 2 Byte Boundary.
I've tried to create my own section but this gives me the same error.
i created my own section with the folling additional linker option:
-Wl,-PdummyData=2003h
in code i used the section as follows:
const uint8_t dummyData __section("dummyData") = {0xAA};
If i use an even address everything works and the value appears in the HEX file.
But because of the system design it needs to be at an odd address. (And in the HEX file of course)
Enviroment used:
- MPLAX v6.20
- XC8 v2.50 PRO
- Device: PIC18F16Q41
- Linker ROM Ranges: default,-2000-2400 (tried it also without this, still the same error)