AnsweredAssumed Answered

STM32F429 custom boot loader (run RTX OS) can not jump to application program

Question asked by Jimmy on Aug 20, 2015
Latest reply on Aug 21, 2015 by Jimmy

Ihave a same problem , I have read many post about this problem (most of them is Clive's post, thank Clive so much),  but I still canfix this bug, it can not jump to application program ( or applicationprogram can not run). Someone please give me some advices so solvedthis bug.

Mydevice: STM32F429 DISCOVERY Board

Myquestion: write a custom boot loader to upgrade application program.Run RTX OS to use USB connection (as a device).

MyIDE: Keil ARM v5

Ihave done:     get image of application program (.bin) and write toflash.

Isplit Flash to 3 part:

-0x08000000 – 0x08040000 : contain boot loader ( 256KB, used 80KB)

-0x08040000 – 0x081C0000 : contain application program( used 11KBfor blink led application)

-0x081C0000 – 0x081E0000 : contain configuration and data sharebetween boot loader and application program.

Inboot loader:

-Start at :  0x08000000 – size 0x40000

-#define VECT_TAB_OFFSET  0x00

;*************************************************************

;*** Scatter-Loading Description File generated by uVision ***

;*************************************************************

LR_IROM10x08000000 0x00040000  {    ; load region size_region

ER_IROM1 0x080000000x00040000  {  ; load address = execution address

*.o (RESET, +First)

*(InRoot$$Sections)

.ANY (+RO)

}

RW_IRAM1 0x200000000x00030000  {  ; RW data

.ANY (+RW +ZI)

}

}

Inapplication program

-Start at :  0x08040000 – size 0x1C0000

-#define VECT_TAB_OFFSET  0x40000

;*************************************************************

;*** Scatter-Loading Description File generated by uVision ***

;*************************************************************

LR_IROM10x08040000 0x001C0000  {    ; load region size_region

ER_IROM1 0x080400000x001C0000  {  ; load address = execution address

*.o (RESET, +First)

*(InRoot$$Sections)

.ANY (+RO)

}

RW_IRAM1 0x200000000x00030000  {  ; RW data

.ANY (+RW +ZI)

}

}

Myjump code: in the first of main boot loader, it check a value storein  0x081E0000 of flash, if value = 0 will jump to application elsecontinue to run boot loader program (Init System and ...).

      

           

if( boot_select == 0x00)     // check boot flag

{   //APPLICATION_ADDRESS =  0x08040000LED_Initialize();

LED_On(0);          

if((((*(__IO uint32_t*)APPLICATION_ADDRESS) & 0xFF000000 ) ==0x20000000) || \

(((*(__IOuint32_t*)APPLICATION_ADDRESS) & 0xFF000000 ) == 0x10000000))

{     

JumpAddress = *(__IOuint32_t*) (APPLICATION_ADDRESS + 4 );

Jump_To_Application =(pFunction) JumpAddress;         

__set_MSP(*(__IO uint32_t*)APPLICATION_ADDRESS);

Jump_To_Application();

}                                   

     }

Ihave test this jump command, if I replace APPLICATION_ADDRESS =0x08000000     ( boot loader address) it can jump(as reset) but if APPLICATION_ADDRESS =  0x08040000, nothing happen .I have run debug in Keil, I saw it gotHard Fault.

Thanksso much for your help!

Outcomes