Tool/software: Code Composer Studio
Hello,
I need to manually clear the bss and the far section of my target (I can't use the cinit automatic zero init feature)
I wrote this code inside the main function
int main(void)
{
U16 Ind;
U16 Size;
U8* Adr;
//Zero init of BSS RAM section
//Size = (U16)_symval(&BSS_SIZE); //Doesn't run
Size = ((U32)_symval(&BSS_END)) - ((U32)_symval(&BSS_START));
for (Ind=0;Ind<Size;Ind++)
*((U8*)_symval(&BSS_START) + Ind) = 0;
//Zero init of FAR RAM section
Size = ((U32)&FAR_END) - ((U32)&FAR_START);
Adr = (U8*)_symval(&FAR_START);
for (Ind=0;Ind<Size;Ind++)
*Adr++=0;
In the cmd file I added following declarations
.far > SHRAM
RUN_START(FAR_START)
RUN_END(FAR_END)
RUN_SIZE(FAR_SIZE)
and
.bss > CORE0_L2_SRAM_OTHER
RUN_START(BSS_START)
RUN_END(BSS_END)
RUN_SIZE(BSS_SIZE)
In the map file, the symbols are created with the right values
The code is located into CORE0_L2_SRAM (main adress is 0x1083b580).
The code compile and runs for bss section, but not for far section : I get this error message : "#17003-D : relocation from function "main" to symbol "FAR_END" overflowed; the 28-bit relocated address 0xb7947e6 is too large to encode in the 15-bit unsigned field (type = 'R_C6000_SBR_U15_B' (11), file = "./main.obj", offset = 0x00000064, section = ".text") main.c /bmw_foe_dp_dsp_cpu01 line 125 C/C++ Problem"
Could you please help me?