2013-03-07 12:47 AM
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-rtos2013-03-07 01:50 AM
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 ?
2013-03-07 07:12 AM
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.