I am using "evkbimxrt1050" for testing the USB host SDK example "usb_host_msd_fatfs".
But the example not works. Log info shows "host init done", after that now log. Also the Breakpoints are not hitting after USB insert.
Can anyone help on this.
I have tried to use the example you are referring to replicate this issue on my side. However, device was detected correctly when the USB was attached. Please check my test below.
I used usb_host_msd_fatfs_bm example from SDK 2.7.0 and MCUXpresso IDE v11.1.1. I ran the example on my MIMXRT1050-EVKB.
Are you connecting the memory stick to the correct USB connector? The one furthest away from the Ethernet jack is used for host mode.
To test the HW load the attached binary file which gives USB-CDC device on the first USB device interface and USB-MSD host on the second. This is a standard uTasker configuration, fully encrypted with serial and OTA uploading support built in (see https://www.utasker.com/docs/iMX/uTaskerLoader_TestDrive.pdf for loading and other details) which will allows you to verify that the USB host issue it is not a local board problem.
Command line interface of the debugger's VCOM at 115kBaud or on the USB-CDC device connection:
Hello, world... MIMXRT1050 [Power-on] Static memory = 0x00001d4c OS Heap use = 0x37e4 from 0xc000 Initial stack margin 0x00051ee0 FlexRAM: 4 Code banks [0x00000000..0x0001ffff] 12 Data banks [0x20000000..0x2005ffff] SPI Flash: Cypress 64MByte S26KL512 uFileSystem integrity Start: 0x60100000 Granularity: 0x00040000 End: 0x6127ffff OK USB (1) device detected USB HS device detected USB device information ready: USB2.0 device with 64 byte pipe Vendor/Product = 0x1a19/0x1628 Manufacturer = "Generic" Product = "Flash Disk" Serial Number = "090627173229>42" Bus-powered device (max. 100mA) with 1 interface(s) Mass Storage Class : Sub-class = 0x06 interface protocol = 0x50 Endpoints: 1 = BULK IN with size 512 2 = BULK OUT with size 512 Enumerated 1 (1) LUN = 1 UFI INQUIRY -> Status transport - Passed UFI REQUEST SENSE -> Status transport - Passed UFI FORMAT CAP. -> S:0x02008140 HS USB error - 1 Stall on EP-1 IN EP-1 cleared Status transport - UFI FORMAT CAP. -> (2:512:495616) Status transport - Passed UFI READ CAP. -> (512:495615) Status transport - Passed Mem-Stick mounting... Disk E mounted Serial number: 4294967295-65535 Software version V1.4.012 Device identification: uTasker Number 1 Main menu =================== 1 Configure LAN interface 2 Configure serial interface 3 Go to I/O menu 4 Go to administration menu 5 Go to overview/statistics menu 6 Go to USB menu 7 Go to I2C menu 8 Go to utFAT disk interface 9 FTP/TELNET commands a CAN commands help Display menu specific help quit Leave command mode 8 Disk interface =================== up go to main menu info utFAT/card info dir [path] show directory content dird [path] show deleted directory content dirh [path] show hidden content infof [path] show file info infod [path] show deleted info cd [path] change dir. (.. for up) comp compare [file1] with [file2] file [path] new empty file write [path] test write to file mkdir new empty dir rename [from] [to] rename trunc truncate to [length] [path] copy [file1] to [file2] hide [path] file/dir to hide unhide [path] file/dir to un-hide prot [path] file/dir to write-protect unprot [path] file/dir to un-protect print [path] print file content del [path] delete file or dir. format [-16/12] [label] format (unformatted) disk fformat [-16/12] [label] full format (unformatted) disk re-format [-16/12] [label] reformat disk!!!!! re-fformat [-16/12] [label] full reformat disk!!!!! sect [hex no.] display sector sectw [hex no.] [offset] [val] [cnt] help Display menu specific help quit Leave command mode >dir Directory E:\ ---A 07.02.2012 02:17 9683567 LanModem_7-2-2012.zip ---A 06.08.2017 19:54 9852838 LAN_MODEM_V2.0.2_9-2-2012.zip ---- 26.02.2012 00:56 <DIR> 2011 ---A 03.03.2012 23:58 12459259 STM32_3-3-2012.zip ---A 03.03.2012 23:58 24276760 Kinetis_3-3-2012.zip ---A 04.03.2012 00:00 52577632 Documents_3-3-2012.zip ---- 30.11.2012 03:48 <DIR> BASIC_V2 ---- 01.12.2012 04:03 <DIR> BASIC_1-12-2012 ---- 09.03.2020 12:00 <DIR> TestDIR ---- 01.12.2012 04:05 <DIR> AVR32_xplanation ---A 26.10.2015 12:00 2135 opt.txt ---- 02.12.2012 12:44 <DIR> BASIC_02-12-2012 ---A 26.10.2015 12:00 65516 test2.txt ---- 02.12.2012 17:45 <DIR> BASIC_02-12-2012_2 ---A 26.10.2015 12:00 69148 stick.c ---- 09.12.2012 07:42 <DIR> Basic_9-12-2012 ---A 28.05.2020 20:12 9165247 relais_10-4-2013.zip ---- 26.10.2015 12:00 <DIR> test ---- 21.04.2013 01:24 <DIR> Docs-April_2013 ---- 13.05.2017 06:28 <DIR> DSP ---- 21.04.2017 01:24 <DIR> farlight_Net512 ---A 11.06.2017 15:05 65516 application.c ---A 11.06.2017 15:48 69148 uFile.c ---A 17.06.2017 01:49 2135 Optionen_d.txt ---A 07.06.2020 16:51 38928 software.bin 13 files with 118327829 bytes 12 directories, 52256768 bytes free E:\>USB device removed Mem-Stick unmounted
[uTasker project developer for Kinetis and i.MX RT]
Thank you for your help, I was actualy trying on J10 connector. I changed the code to work for J10. Now it works fine.
In my cutom board we are using OTG2 (which is same as J10 in EVKB). The same code not working in my custom board. The only harware difference is, we are not using micro USB connector (the regular 4pin USB connector is used).
When I connect USB to board, I was getting "enumeration failed" error on the debug console.
Can you please help me.
I highly recommend you to check our i.MX RT Hardware Development Guide for the MIMXRT1050/MIMXRT1060 Processor. In this document you will find a chapter dedicated to USB that gives you guidelines that you may find useful and that you should check that you are following in your design. In addition, you can consult IMXRT1050 EVKB schematics for reference.