i’m trying to jump from my FreeRTOS based bootloader to the FreeRTOS based main application.
The jump itself works. I can tell that from single stepping in the disassemlby. If I let the programm run, it soon enters the applications hardfault handler. It seems like the application crashes in early phases like zero init or low level init.
I’m struggling with this strange behvior for a few weeks now and could not get any further.
The only thing i noticed is, that the application executes correctly if i dont create tasks in the booloader.
I have allready tried to delete every task i created before the jump to the application but this does not change anything.
I’m also calling taskENTER_CRITICAL() and vTaskEndScheduler() before jumping to the application.
Calling vTaskEndScheduler() will not do anything on a Cortex.
Are you remapping the vector table from the table used by your bootloader to the one used by your application?
Are you stopping the timer that generates the tick interrupts and clearing any pending interrupts before jumping to your application? Just disabling interrupts is probably not good enough because as soon as interrupts become enabled in your C start up code pending interrupts will execute but no longer have anything to execute because the bootloader is not running any more.
I’ve searched a lot in the forums but could not find anything that brought me further. most people forgot to relovate the vector table. many of the found topics were not solved…
as soon as the scheduler starts to run, the process stack pointer is used.
as you can see, the MAIN stack pointer is loaded before the jump. but since the process stack pointer is used, strange behavior will occur.
now i have to fix this somehow….
but why is the used stackpointer not altered once the endScheduler is called?…. is this possibly a bug?