AnsweredAssumed Answered

MPC5604P - Codewarrior default initialization

Question asked by Steffen Rose on Jul 9, 2015
Latest reply on Jul 10, 2015 by Steffen Rose

Hello,

do anybody know the sense of this initialization in the default created file MPC5604P_M26V_HWInit.c

 

__asm void INIT_Derivative(void)

{

nofralloc

 

    /* MPC5604P_M26V SRAM initialization code                                 */

    lis r11,L2SRAM_LOCATION@h       /* Base of SRAM, 64-bit word aligned */

    ori r11,r11,L2SRAM_LOCATION@l

 

    li r12,320        /* Loops to cover 40K SRAM; 40k/4 bytes/32 GPRs = 320 */

    mtctr r12

 

    init_l2sram_loop:

        stmw r0,0(r11)        /* Write 32 GPRs to SRAM                     */

        addi r11,r11,128      /* Inc the ram ptr; 32 GPRs * 4 bytes = 128B */

        bdnz init_l2sram_loop /* Loop for 40k of SRAM                      */

 

    blr

}

 

I understand and see, that the registers are not 0. There are different values. Especially r11 is changed in every loop.

Why the init code write the "random" register values to the complete RAM?

 

bye

Steffen

Outcomes