when creating RAM project in CodeWarrior, startup file doesn’t initialize the RAM. The reason is that it would overwrite the code in RAM. In case of RAM projects, it’s responsibility of debugger to initialize the RAM before loading RAM image.
When using this RAM project to develop RAM image to be downloaded by BAM, there are two options:
/* MPC5566 L2SRAM initialization code */
lis r11,L2SRAM_LOCATION@h /* Base address of the L2SRAM, 64-bit word aligned */
li r12,1024 /* Loop counter to get all of L2SRAM; 128k/4 bytes/32 GPRs = 1024 */
stmw r0,0(r11) /* Write all 32 GPRs to L2SRAM */
addi r11,r11,128 /* Inc the ram ptr; 32 GPRs * 4 bytes = 128 */
bdnz init_l2sram_loop /* Loop for all L2SRAM */