AnsweredAssumed Answered

MPC5744P Jump problem

Question asked by xiaobo zheng on Oct 25, 2016
Latest reply on Oct 26, 2016 by Lukas Zadrapa

       our project has two independent programs (bootloader  and application program),   our bootloader will loading application program form mmc card and programming it to the chip  rom memory. and then jump to it start addresss.

        but we found if our bootloader  init the chip registers  and then jump to application program start addresss,  an error will happen when application program running. 

        our application program still need init the chip same registers again with different values (for example : clock, interrupt , peripheral..)

int main()

{   /*this is our bootloader main function, when bootloader finished and jump to application program , the application program will create an error and it can not work*/

       Sys_Mode_Drun();

   ShutDownSelfTest(); 

       Hardware_Init();

       C55_Flash_Init();

       C55_Eeprom_Init();  

       _bootloader(NULL);

             C55_Flash_SetLock();

       /*jump address :0x01000020*/

       __asm("e_lis r3, 0x0100");

       __asm("e_or2i r3, 0x0020");

       __asm("se_mtctr r3");

       __asm("se_bctr");     

   while(1);     

}

According to our test , if our bootloader do not init the chip registers, for example: in our main function we do nothing just only jump to application program start address and running, there is no error, application program can working normaly.

  

int main()

{/* this is our bootloader main function ,we do nothing ,just jump to application program , the appl can working normoaly* /

       /*jump address :0x01000020*/

       __asm("e_lis r3, 0x0100");

       __asm("e_or2i r3, 0x0020");

       __asm("se_mtctr r3");

       __asm("se_bctr");     

   while(1);     

}

 

Why this is happen? And how can we fix it ? thanks !

   Is there any points we need to know when one program jump to another program on the same chip ?

Outcomes