Unable to use USB on IMXRT1050

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

Unable to use USB on IMXRT1050

1,635 Views
AdityaS09
Contributor II

Hello,

I am working on a project in which I am using i.mxRT1050 processor with SDK_2_10_0_EVKB-IMXRT1050. I need to get the USB working in host mode. I have the IMXRT1050-EVKB eval board along with our custom boards.

I have a pendrive which I am connecting to the eval board via OTG connector on J10. I have tried the evkbimxrt1050_host_msd_fatfs_bm code on the eval board, the application prints host init done and after that nothing happens. The application is loaded on to the SRAM.

On our custom board, once I connect the pendrive, after a minute I get kStatus_USB_TransferFailed, so little better luck than on eval board. The application tries internally 3 times to get connect with the device finally fails by giving kUSB_HostEventEnumerationFail error in USB_HostEvent. Here also the application is on to the SRAM.

Does anyone know what could be the issue? Any leads would be appreciated.

 

Thanks

Aditya

Labels (1)
0 Kudos
5 Replies

1,599 Views
AdityaS09
Contributor II

...

0 Kudos

1,622 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello

Hope you are well.
I suggest you try plugin the device in the two different ports of the EVK(J9 and J10) to see if this is done correctly.
For this test, I suggest you execute the example from the memory on the board.

It would be helpful if you use different pendrives for the test.
In the EVK test, after "host init done" in what line does the code gets stuck?

I´m looking forward to your reply, if you have more questions do not hesitate to ask me.
Best regards,
Omar

0 Kudos

1,593 Views
AdityaS09
Contributor II

Hello Omar,

Thanks for the response and apologies for my late response.

I was eventually able to get it working somehow but its not in the way that is needed. Since we are loading application directly onto the SRAM, what we observed was that when we are loading the application onto the DTC RAM, usb pendrive is working fine. But for other sections of the RAM its giving the issue faced earlier. Also since we will be using FreeRTOS with our application the USB example code for RTOS doesnt fit into the size of DTC RAM. 

Our final goal is to put the application in EMMC or SD card and load it onto SDRAM as the application needs lot of memory. But when I try to utilize the any other RAM section other than DTC RAM, I am running into the enumeration failure issue. The application detects the USB and tries to initiate the transfer but eventually fails to do so. Even the baremetal usb example code when ran via SDRAM gives the same issue.

I have already tried the solutions given on the following links, they work out for when the requirement is for OCRAM but SDRAM, the application fails to load.

Solved: IMXRT1050 USB DEVICE examples fail to run from OCR... - NXP Community

Using NonCached Memory on i.MXRT - NXP Community

Please suggest some way on how to get the USB working when the application is running via SDRAM.  

 

Regards,

Aditya Saini

 

0 Kudos

1,581 Views
AdityaS09
Contributor II

Ok...so I made some progress....I used host_msd_fatfs_freertos example code as base and after adding the following macros to the preocessor

XIP_BOOT_HEADER_DCD_ENABLE=1

DATA_SECTION_IS_CACHEABLE=1

XIP_BOOT_HEADER_ENABLE=1

SKIP_SYSCLK_INIT

 

and keeping the MCU Settings as follows

AdityaS09_0-1634897801858.png

and Managed Linker Script as below

AdityaS09_1-1634897841642.png

I was finally able to read/write to USB device without issues on IMXRT evk board and our custom hardware as well from SDRAM.

But when I am making the same changes to our base code, I am still getting the enumeration error. The base code was created using crank_storyboard_helloworld example. But it seems that these two application are created in two very different setting of preprocessors.  Both the applications makes use of FreeRTOS but have a quite different setting when it comes to preprocessor.

Can someone please give any inputs on how to make the enable similar changes in a crank application project?

 

Regards

Aditya

0 Kudos

1,518 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

The crank storyboard demos are developed by a partner so I suggest you contact them to check the necessary modifications to preprocessor macros: https://www.nxp.com/webapp/connect/displayPartnerProfile.sp?partnerId=1-BFZK-3
The issue on this might be similar to the posts shared previously but since this example adds more components, might be helpful to check with them.

If you have more questions do not hesitate to ask me.
Best regards,
Omar

0 Kudos