arm - IAP Bootloader could not load RTX application image -


i have splitted software 2 parts: bootloader(without rtx), application image rtx. bootloader not load application image rtx. flash settings are:

 --------------------------------------------------------------------         start address       size irom 1: 0x08000000          0x2800   - bootloader (without rtx) irom 2: 0x08002800          0xd000   - application image (with rtx) 

i have test 3 ways: (1) use app without rtx. bootloader load app successfully.

(2) change application rtx project irom setting. change application project irom start address 0x08002800 0x08000000. , download application image flash address 0x08000000. ihe image run 0x08000000 successfully.

(3) application image irom start address setting 0x08002800. after downloading bootloader , app image flash, debug app project in keil step step. found there "ostimerthread stack overflow" error. main thread stack overflowed. have tried increase stack size, doesn't work. found app starks in rtx kernel switching. threads in waiting state, , not running.

ps, when debugging in keil,test item(2) have stack overflow errors during kernel initialization. item(2) works fine till now. put information needed here.

this debugging picture item (3). enter image description here

are changing linker script link starting @ 0x08002800 when using bootloader or loading application (linked @ 0x08000000) @ offset of 0x2800? double check (look in map file) linked output ensure symbols not linked in 0x08000000 - 0x08002800 range.

additionally, make sure using correct entry point , stack pointer. application's stack pointer should @ 0x08002800, , reset vector @ 0x08002804. bootloader need setup msp register correct stack pointer before jumping application. here example code st's usb dfu bootloader:

typedef  void (*pfunction)(void); pfunction jumptoapplication; uint32_t jumpaddress;  /* jump user application */ jumpaddress = *(__io uint32_t*) (usbd_dfu_app_default_add + 4); jumptoapplication = (pfunction) jumpaddress;  /* initialize user application's stack pointer */ __set_msp(*(__io uint32_t*) usbd_dfu_app_default_add); jumptoapplication(); 

additionally, depending on how bootloader configures before jumping application, may need 'deconfigure' peripherals. example, if setup clocks in bootloader before deciding jump application, may run problems in application if assumes clocks in default configuration already. similar things can happen nvic , systick if bootloader using these before jumping application.

lastly, along same lines previous section, application may making assumptions state of peripherals being default, may making assumptions peripheral defaults correct. example: scb->vtor has default value (i believe 0x00000000), , points vector table. bootloader linked have vector table @ location. you'll need make sure when application starting up, updates vtor register point actual location of vector table.

hopefully 1 of these sections helps identify problem.


Comments