Hello
Here is what experience teaches me about ROM images.
1- I always set RAM BufferAddress and ROM Image Address to the same value.
As far as I know RAM BufferAddress is there for legacy purpose and was for a kind of botloader
that could be used to reprogram the code into flash. I am not sure this is still supported today.
2- ROM Image Address should be set to the start address of one of the read only memory area defined in the .lcf file.
The linker will place initialization data that needs to be copied from RAM to ROM at the end of this memory area
(i.e. after all sections that are explicitly placed there).
3- All Read Only sections that are placed in another memory area than the one where the ROM image is located
should use the LOAD function to specify their LOAD address.
In your .lcf file you intend to use a dedicated memory area for the initialization data. Is there any reason for that?
Now to fix the problem in your linker file I see 2 solutions
1- Use the application_code memory area to store initialization data
Here define application_code as
application_code: org = 0x00042000, len = 0x0003DFFC
and remove definition of init_data_rom memory area.
Then make sure to specify 0x00042000 as RAM BufferAddress and ROM Image Address.
2- Use the init_data_rom memory area to store initialization data
In that case add the appropriate LOAD command to all sections allocated in application_code area.
Then make sure to specify 0x00042000 as RAM BufferAddress and ROM Image Address.
CrasyCat