I have an MQX 3.8 application that is working fine when loaded alone into my K53. USB works as expected here.
When I load the application using my USB bootloader, the application now resides at flash 0x10000, and everything works fine, except my USB will no longer function. The USB task launches, but does not ever report a successful device insertion.
Something else strange that I've noticed is that my UART debugger seems to repeat some messages 3x when my image runs from the bootloader. Any ideas? I'm really stuck, and need to release this product in a couple of days.
Solved! Go to Solution.
Thanks to the FAEs, here's the fix:
The USB MSD bootloader example does not disable the clock gating to the peripherals that were enabled, and the main MQX app assumes that these registers are in their POR states.
The fix - Disable all of the clock gating before jumping to your app (USB was the important one for me):
if((New_sp != 0xffffffff)&&(New_pc != 0xffffffff)) { SIM_SCGC4 &= ~(0x00040000); //DES disable USBOTG clock/module
Thanks to the FAEs, here's the fix:
The USB MSD bootloader example does not disable the clock gating to the peripherals that were enabled, and the main MQX app assumes that these registers are in their POR states.
The fix - Disable all of the clock gating before jumping to your app (USB was the important one for me):
if((New_sp != 0xffffffff)&&(New_pc != 0xffffffff)) { SIM_SCGC4 &= ~(0x00040000); //DES disable USBOTG clock/module