Bootloader and main application similar to IAP not working
Hi,
I have my own bootloader application similar to the IAP example provided by ST that runs and determines which of 2 main applications to run then launches the application. The bootloader is working fine and the main application is working fine but when I combine them the main application always ends up hard faulting. If I launch the main application from STM32CubeMX IDE it starts fine but then if I restart the whole processor, the bootloader runs then launches the main application but it always hard faults at the same point. If I have the main application running from the beginning of flash it works fine and no hard faults.
I've tried de-initing all peripherals that are used in the bootloader, that doesn't seem to make a difference. The only thing that is still running is the SysTick timer.
Are there any registers that would allude to why the hard fault has occurred?
How can I ensure that everything is at a nice clean state when the main application runs?
I should mention that the main application is a FreeRTOS project and the hard fault occurs when initializing the default task.
Thanks,
Doug Burrell