MPC5744P Jump problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MPC5744P Jump problem

985 Views
xiaobozheng
Contributor III

       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 ?

Labels (1)
Tags (1)
1 Reply

554 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

I wrote something similar here:

https://community.nxp.com/message/605376?commentID=605376#comment-605376 

"In this case, it is necessary to disabled all interrupts and put all the modules to default reset state. Or the user application must be aware that it is possible that modules are not necessarily in reset state."

I guess that this is the source of troubles...

Regards,

Lukas