svchamlian svchamlian

_S_romp structure created by automatic project creation

Discussion created by svchamlian svchamlian on Jun 20, 2008
Latest reply on Jun 23, 2008 by Arev

When a project is created in CW (version 7), the IDE generates automatically a structure RomInfo (__S_romp in linker file) and during startup (startcf.c), the structure is used to copy a block from rom to ram.

 

Can anyone explain what this piece of code does?

 

I am checking the addresses (destination, source) of the block being copied and have no idea what is the purpose of the code? Needless to say, when I delete it, nothing works…

 

Code:
static void __copy_rom_sections_to_ram(void)============================================        Value    Location      data_end            0x2000A52C         0x2000C4FC      data_ram            0x2000A500         0x2000C510      data_rom            0x200030DC         0x2000C514      heap_end            0x2000B52C         0x2000C4F4      heap_start          0x2000A52C         0x2000C4F8      info                0x200030F0         0x2000C518          Source          0x200030DC         0x200030F0          Target          0x2000A500         0x200030F4          Size            20                 0x200030F8      sbs_end             0x00000000         0x2000C500      sbs_start           0x00000000         0x2000C504      sbss_end            0x00000000         0x2000C508      sbss_start          0x00000000         0x2000C50C      sp_end              0x2000B52C         0x2000C4F0      sp_init             0x2000C52C         0x2000C51Cstatic void __copy_rom_section(char* dst, const char* src, unsigned long size)=============================================================================          Value       Location      dst                 ""                 0x2000C4D0          *dst            '\x00'             0x2000A500      size                20                 0x2000C4D8      src                 ""                 0x2000C4D4          *src            '\x00'             0x200030DC

 

So it is copies the content of address (0x2000_C4D4 to 0x2000_C4D0). The code is in SRAM (5282)?

Simon


 

Outcomes