iMX DFU USB crashes application (FreeRTOS)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMX DFU USB crashes application (FreeRTOS)

Jump to solution
743 Views
Michi_O
Contributor II

Hello,

I'm trying to get USB DFU (app-idle) running on an MIMXRT1052DVL6B with FreeRTOS. I gathered all resources using the MCUXpresso Config Tool and an example for the RT1064 Evaluation Kit (for the FreeRTOS integration).
The startup is running until the application crashes inside of USB1_init(). The last point I can reach with the debugger is a function call to USB_DeviceClassGetDeviceHandle() when a OSA_ENTER_CRITICAL() section is entered. All parameters and also the disassembly seem valid. However, it should be mentioned that the application also crashes when I set a breakpoint somewhen before the described point and continue running from there.
Checking the nested interrupts handling (since the issue seems to be caused by OSA_ENTER_CRITICAL) didn't give me a real hint on what is actually happening. I cross-checked the implementation with another working bare-metal example where the main difference is the interrupt disable / enable routines (the BM example doesn't use a nested interrupt protection).
I tried now to place the initializations before all RTOS code. Before that I had the initializations in an "init task" which destroys itself after the first execution. However, this didn't solve the problem. That's why I don't expect the FreeRTOS to be the direct issue.
Furthermore I could track down the instruction that is obviously causing the problem: in function USB_DeviceEhciSetDefaultState() [usb_device_ehci.c] the DEVICEADDR is reset in the USB core memory. Commenting this assignment keeps the app from crashing. However, this instruction shouldn't have any effect, since the DEVICEADDR register is set to zero after a reset anyway. At this point I would expect some memory alignment issue.

Maybe someone can give some hint on which direction to go from here

Thanks for your help!

Labels (1)
0 Kudos
Reply
1 Solution
729 Views
Michi_O
Contributor II

It turned out that the SDK's XIP component was missing in the project. Now everything is working as expected.

View solution in original post

0 Kudos
Reply
1 Reply
730 Views
Michi_O
Contributor II

It turned out that the SDK's XIP component was missing in the project. Now everything is working as expected.

0 Kudos
Reply