Hi Angelo,
Unfortunately, I never use GCC toolchain yet for S12(X/Z).
The banked system split memory into pages ( space is not linear) and we should define every page separately. For example:
MEMORY
{
rom_E0 (rx) : ORIGIN = 0xE08000, LENGTH = 16K
rom_E1 (rx) : ORIGIN = 0xE18000, LENGTH = 16K
rom_E2 (rx) : ORIGIN = 0xE28000, LENGTH = 16K
rom_E3 (rx) : ORIGIN = 0xE38000, LENGTH = 16K
rom_FC (rx) : ORIGIN = 0xFC8000, LENGTH = 16K
rom_FD (rx) : ORIGIN = 0x4000, LENGTH = 16K
rom_FE (rx) : ORIGIN = 0xFE8000, LENGTH = 16K
rom_FF (rx) : ORIGIN = 0xC000, LENGTH = 16128
m_cfmprotrom (rx) : ORIGIN = 0xFF00, LENGTH = 16
m_interrupts (rx) : ORIGIN = 0xFF10, LENGTH = 240
…
ram (rwx) : ORIGIN = 0x2000, LENGHT = 0x2000
paged_ram (rwx) : ORIGIN = 0xFD1000, LENGTH = 0x1000
}
In SECTION area, you may define placement different objects into these memory segments.
Unfortunately, I didn’t found any GCC guide how to concatenate these chunks into one region and use it in SECTION area – keep allocation on linker across all pages.
We could simply assign several segments into one user segment in CodeWarrior linker. Or we could use global addresses for define linear address space like 0x780000’G..0x78FFFF’G. Unfortunately, I don’t know how to implemented such things on GNU toolchain.
The most useful links about GNU linker where I searched:
http://www.eecs.umich.edu/courses/eecs373/readings/Linker.pdf
http://www.scoberlin.de/content/media/http/informatik/gcc_docs/ld_3.html
http://richardgoyette.com/Research/Papers/FreeRTOSPaperAnnA.pdf
http://www.msextra.com/tools/
The S12XE memory map is attached.
I hope it helps you.
Have a great day,
Radek
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------