This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Bootloader not working with RTX kernel

Hi,

i solved my previous problem in starting the main app from my own bootloader but now the same problems has returned if the application is coded with RTX kernel.

Summary

I'm using CortexM3 (STM32F103VB) with Keil uVision3 v.3.85 (DEMO).
I've developed my own bootloader allocated between 0x08000000 and 0x08001FFF.
1 page (0x400) from 0x08002000 to 0x080023FF is used to store checksums and other stuff,
1 page from 0x08002400 to 0x080027FF is for application config. data
Bytes from 0x080002800 on are used for main application.
The bootloader terminates with the usual (from application notes) sequence:

JumpAddress = *(__IO uint32_t*) (0x08002800 + 4);
Jump_To_Application = (pFunction) JumpAddress;
__set_MSP(*(__IO uint32_t*) (0x08002800));
Jump_To_Application();

while the main app starts with the usual sequence:

SystemInit();
NVIC_SetVectorTable(NVIC_VectTab_FLASH,0x2800);


In the main app project target properties, the default memory area starts from 0x08002800 and is 0x1D800 bytes long, while in the linker tab the "Use Memory Layout from Target dialog" is checked.

The main app project decalres the checksum/data area as

const CHECKSUMS_ST C_Checksums __attribute__((at(0x08002000)));
const CONFIGURTION_DATA_ST C_Config  __attribute__((at(0x08002400)))

(both CHECKSUMS_ST and CONFIGURTION_DATA_ST are structures defined with filling fields in order to be exactly 0x400 bytes long).

I examined the result hex files and all seems correct, data and checksum are at correct addresses, the stack pointer stored at 8002800 point somewhere in RAM at 0x2000C60 and the reset address stored at 8002804 points to somewhere in flash at 0x80036C5 (they are stored in little endian, right?)

If the application is simply coded using just CMSIS and STD library (from ST), without RTX, all is fine.

PROBLEM
If the application is coded with RL-RTX kernel support
it goes in to hardfault handler after it sarts, somewhere between the NVIC_SetVectorTable call and os_sys_init call.

Off course I tested the sample app coded with RL-RTX at 0x08000000 WITHOUT the bootloader, and it works correctly.

Is there any issue about the RTX kernelthat I'm not considering ?

Thanks