Hi!
I have successfully implemented the USB_stick_update on an EK-TM4C123GXL. I have done some modification to update the soft on the µC at every reset if an USB stick with a "firmware.bin" is plugged in. It will wait until I unplug the USB device then will reboot and launch the new software.
However, I would like now be able to turn on the µC (with already a software in flash) with usb stick plugged at startup. The USB stick is empty. I have set a timeout which allows me to continue the bootloader even if there is no firmware on the USB stick. But when "CallApplication()" is used, the program in the flash does not work.
I suppose the problem is created when I check what is on the USB stick. Probably an interrupt. I have tried to disable all interrupts with ROM_IntMasterDisable() but it has no effect. I have read on lot of posts that all interrupts must be disabled in the bootloader before jump to the software in flash. Because the soft will set its own interrupts.
In fact, I would like to know how I can jump properly in a flash application without resetting the microcontroler.
Thanks for your help!
For memory:
void CallApplication(uint_fast32_t ui32StartAddr) { // // Set the vector table to the beginning of the app in flash. // HWREG(NVIC_VTABLE) = ui32StartAddr; // // Load the stack pointer from the application's vector table. // __asm(" ldr r1, [r0]\n" " mov sp, r1\n"); // // Load the initial PC from the application's vector table and branch to // the application's entry point. // __asm(" ldr r0, [r0, #4]\n" " bx r0\n"); }