I have asked a question - https://community.nxp.com/thread/499913
But have a follow up question that I thought fitted in this community more.
I use simulink to generate code (in the form of .c and .h files). Then I use Linker files to divide the data segment (SRAM) into, let's say, 4 segments to prevent/protect against overwriting of specific data.
Now the question is - How do I instruct the linker to link specific data files to specific memory segments? I know it's possible to have compiler instructions to indicate specific variables to be mapped to specific mem segment (like __attribute__((section .... bla bla)). But I don't know how to map specific file scope data to memory segments. Any light upon this?? I ask this because the code is generated from Simulink and there are few tweaks possible in Simulink but not to the extent that I can indicate unsupported microcontrollers' memory segments. Atleast I am not aware of such possibilities.
Btw I use WindRiver Diab compiler but tips for even the Code warrior GCC is fine.
For ARM based processors, I could create my mem section (example .myMemSection) and map object files (.o files) to this mem segment. But I don't know how this would work for PowerPC based compilers for MPC5745R.
.myMemSection 0x<some number>:
} > m_data
Also I have already read https://community.nxp.com/thread/389100