The DSC is 56f84763.
It has a secondary data flash from X:0x8000 to X:0xBFFF and my segment starts at 0xA000.
I'm using small data model.
I place my const.data in that segment and linker complains that the 16 bit SIGNED displacement in small data model cannot reach my memory.
Ok, I discover that the compiler can generate the correct "far" addressing even in SDM.
Very well, but when I put the flag in compiler command tool the disassembled object file shows a 16 bit relocation record.
The linker still complains, nothing changed.
What should I do ?
Thanks.
PS: no problems in putting code there.
Half solved.
The folks at Freescale put "-largeAddrInSdm" in the documentation, but "-largeaddrinsdm" in the compiler code.
So the latter works and the former doesn't.
(Seems like an UpperCase call is missing in the compiler..)
Anyway, now since I have a bunch of strings in the secondary flash, I declare them as unsigned chars of 1 byte.
The 56F8000Ex core doubles the byte addresses (like in move.bp) and this means that all word-addresses beyond 0x8000
become byte-addresses beyond 0x10000 (4 zeros).
This is over the 16 bit maximum displacement of the Small Data Model and the Linker complains that it is too far.
">is too far away for a R_56800E_BYTE16 relocation, which has a range from 0 to
>65535 bytes"
So there is this limitation in using the Secondary Flash for data: you cannot use Byte addressing for objects there.
That is pretty bad, because to put arrays of constant chars in ram is a big waste, and to put them in Program Memory you must name them with an identifier, because the compiler cannot generate program memory addressable string constants (no way I'm aware of...)
Hope this helps whoever wants to wrestle with these things.
Hi, Roberto,
yes, the DSP56800EX generally uses word address(16 bits data), but supports byte address, in the case, the word address will shift one bit from word address and becommes byte address..
BR
Xiangjun Rong