Hello Folks,
Our engineering group is using embOS for their application code.
I am trying to re-use a lot of that code for a bootloader for our project. This means that I have to use embOS in the bootloader.
The processor is a ST32F103VG (Cortex M3) running at 24 MHz. Compiler tools is IAR ver 6.6
The problem I have is when I try to jump to the application at the completion of the boot load I get a hard fault.
I have checked that the App binary is good. If I load the app and then jump to it with a non-OS version of the bootloader, everything works.
I do the jump to the Application inside a task with:
NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0xF800);
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_0);
uint32_t* address = (uint32_t *)(0x0800F804);
__set_MSP(*(__IO uint32_t*)0x0800F800); //set the stack pointer to that of the application
((void (*)())(*address))(); // pointer recast as function pointer and the dereferenced/called
I think part of the problem is that the bootloader calls OS_InitHw() and OS_Start(), but then when the Application starts it calls those routines again.
Is there a way to stop or completely unload the changes the embOS has made once it starts so that a second invocation of the OS would work like a
fresh start of the OS?
Thank you in advance,
Dave
Are there any other issues that could cause my problem like using the wrong stack, or interrupts still firing from OS when change the int vector table?
Our engineering group is using embOS for their application code.
I am trying to re-use a lot of that code for a bootloader for our project. This means that I have to use embOS in the bootloader.
The processor is a ST32F103VG (Cortex M3) running at 24 MHz. Compiler tools is IAR ver 6.6
The problem I have is when I try to jump to the application at the completion of the boot load I get a hard fault.
I have checked that the App binary is good. If I load the app and then jump to it with a non-OS version of the bootloader, everything works.
I do the jump to the Application inside a task with:
NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0xF800);
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_0);
uint32_t* address = (uint32_t *)(0x0800F804);
__set_MSP(*(__IO uint32_t*)0x0800F800); //set the stack pointer to that of the application
((void (*)())(*address))(); // pointer recast as function pointer and the dereferenced/called
I think part of the problem is that the bootloader calls OS_InitHw() and OS_Start(), but then when the Application starts it calls those routines again.
Is there a way to stop or completely unload the changes the embOS has made once it starts so that a second invocation of the OS would work like a
fresh start of the OS?
Thank you in advance,
Dave
Are there any other issues that could cause my problem like using the wrong stack, or interrupts still firing from OS when change the int vector table?