Hey there,
I have the MPC5777C project, in which I've modified the linker script of the project.
my sections can be shown above. I have configured linker scripts of the core projects as follows to create a 32KB x 2 shared RAM area and 256 K Calibration Area.
Then I've created a structure which is placed in the s_ram1 section as follows for both projects.
As expected, the structure is in the same place for both projects.
After those operations, I see some garbage value inside of the created structure, in my debugger for both projects.
Probably I am missing something related to the initialization. Is there any other force way to zero init ram variables via GCC or somewhat?
Best Wishes
Ege
解決済! 解決策の投稿を見る。
Hi,
the dafault way how is RAM inicialized is by writting content of registers in a loop:
;# Fill SRAM with writes of 32GPRs
sram_loop:
e_stmw r0,0(r5) # Write all 32 registers to SRAM
e_addi r5,r5,128 # Increment the RAM pointer to next 128bytes
e_bdnz sram_loop # Loop for all of SRAM
and some registers contains different value than 0. You need to perform for example memset(...) on your structure prior to using it. Or you can modify the RAM init.
Update:
After I have removed the NOLOAD option for those sections
result have not been changed too
Best Regards
Ege
Hi,
the dafault way how is RAM inicialized is by writting content of registers in a loop:
;# Fill SRAM with writes of 32GPRs
sram_loop:
e_stmw r0,0(r5) # Write all 32 registers to SRAM
e_addi r5,r5,128 # Increment the RAM pointer to next 128bytes
e_bdnz sram_loop # Loop for all of SRAM
and some registers contains different value than 0. You need to perform for example memset(...) on your structure prior to using it. Or you can modify the RAM init.