why I can't run the application through the application start application?

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

why I can't run the application through the application start application?

812 Views
1329306846
Contributor III

Hello everyone !

         Rencently I‘m learning Bootloader , when I  run  the bootlaoder  and  have download  the other application,

I want to run the other application ,but I can't  realize it. 

      Bootlaoder Lcf :

pastedImage_1.png

      Application Lcf

pastedImage_2.png

And t I use  "app_entry (); " to change bootlaoder to application :

#define APP_StartAddr (*(uint32_t*)0x00004004)

void app_entry(void)
{
(*(void (*)(void))(APP_StartAddr))();   /*run the function via function pointer convert with a certain address*/

while(1);                                                 /*stop here for anyhow*/
}

  Really hope someone can give me some help !

0 Kudos
3 Replies

556 Views
1329306846
Contributor III

     Thank you for your  answer.  I have  realized run application through  application start  address in MCU " MPC5744P "by

the way as you tell me . But  I  do not realize it in the MCU "MPC5634m" ,when Bootloader run "app_entry()" , the MCU is reset.

Do you know whether mpc56xx  can change  into other application through application  start address  when Bootloader is running ?

0 Kudos

556 Views
tony_huang
Contributor III

Hi,

     Can I make friend with you? I recently  use MPC5744P to develop bootloader. My qq:1931181009.

0 Kudos

556 Views
rachedguerafi
Contributor II

Maybe you should change the address to 0x4000 instead of 0x4004
If that didn't work for you then this should do the job:

First define a typedef for the app_entry function as follows:

typedef void (* TAppEntry)(void);

Then you just have to declare the app_entry of that type and set the address value 
TAppEntry app_entry = (TAppEntry) (*((unsigned int *) 0x00004004));

and then call the function simply
app_entry();

0 Kudos