cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f4+RTX(RTOS) jump to app from user bootloader

hongri83
Associate
Posted on March 07, 2013 at 09:47

chip: sm32f407

IDE: keil MDK

I have user bootloader at 0x08000000, and app code  at 0x08020000.

Duo to project requirement, I need to run RTX in my bootloader , and can jump to app from bootloader.

Problem is when without enabling RTOS it�s working fine,but once enable the RTOS then the App will not run.

I tried to disable SystemTick Timer so as to stop OS and it was useless .

I disabled all interrupts using __set_FAULTMASK, but it was useless too.

my jump code like bellowings;

 if (((*(__IO uint32_t*)APPLICATION_ADDRESS) & 0x2FFE0000 ) == 0x20000000)

 {

  //__set_FAULTMASK(0x01);

  JumpAddress = *(__IO uint32_t*) (APPLICATION_ADDRESS+4);

  /* Jump to user application */

  Jump_To_Application = (pFunction) JumpAddress;

  /* Initialize user application's Stack Pointer */

  

  __set_MSP(*(__IO uint32_t*) APPLICATION_ADDRESS);

  printf(''application start...''''\r\n'');

  Jump_To_Application();

 }

Are there any suggestions?

Thanks!

#stm32-bootloader-rtos
2 REPLIES 2
M0NKA
Senior
Posted on March 07, 2013 at 10:50

The SET_MSP macro does, really set stack pointer ? To flash ? The first instruction of your application is with offset 4 ? In ARM mode, not Thumb ?

Posted on March 07, 2013 at 16:12

No it doesn't set the stack pointer to flash, but a process might fault if it tries to set the main stack pointer.

Any chance you actually debug the code, and see what it's doing?

Someone else had a similar problem wrt RTOS and Boot Loader, you might want to dig through the forum.

You either have to get the processor back to reset state before jumping to the application, or make the application tolerant of the situation you stick it with. I might opt to reset the chip and have the boot loader fast path into the application.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..