Hello,
I have to store ~ 40kB const data (some fonts...). The XDATA_ROM_C (0x8000 - 0xffff) is to small to store all the data so I try to put the data into the code area (using code banks).
#pragma constseg = __xdata_rom BANKED_CODE const GuiConst_INT8U Ch000015[16] = { 2,2,2,2,2, 6,6,6,6,6, 2,5, 11,2, 0x1F, 0x03 };
I see the correct result in the memorymap (Ch000015 is linked to banked code instead of xdata_rom_c), to address 0x31c9f.
<BANKED_CODE> 6 (was BANKED_CODE)
Relative segment, address: CODE 00031C9F - 00031CAE (0x10 bytes), align: 0
Segment part 21. Intra module refs: GuiFont_ChPtrList
ENTRY ADDRESS REF BY
===== ======= ======
Ch000015 00031C9F
But when debugging and catching the pointer (void*) of Ch000015, the read out address is not 0x31C9F but 0x9C9F.
I also tried to read the address by using a generic pointer (void __generic *).
How to read out the constants from different code banks correctly?
//* EDIT: Oh, does this known issue concern me? Using IAR EW 8051 IDE 8.20.2
http://supp.iar.com/FilesPublic/UPDINFO/005161/ew/doc/infocenter/icc8051.htm
EW21366
In case the banked code model and the option --place_constants=code is used constants must be placed in the root bank and NOT in a code bank. This is unfortunately still true regardless of whether the device you are working with supports the command line option --has_cobank or not.
greetings,
Elias
