2018-09-28 01:54 AM
I'm trying to write a custom bootloader, so far I've been successful using
Address = *(__IO uint32_t*) (APP_ADDRESS + 4);
jump = (pFunction) Address;
__set_MSP(*(__IO uint32_t*) APP_ADDRESS);
jump();
however this only worked for a a very simple main application (blinking a LED).
My real application uses USB and after the jump the code gets stuck somewhere in the initialisation and the app doesn't run.
I have narrowed it down to here: By removing the line "MX_USB_DEVICE_Init()" from my main app, the bootloader works perfectly. I've tried calling "USBD_DeInit()" before jumping but this didn't fix anything.
Is there anything I should be resetting / disabling in my bootloader before jumping to my main app?
Thanks