i.mx6ULL Demo Image in USB host mode

Hi,
we have a custom carrier board with a colibri vf50 where a USB card reader is connected to USB2. This works perfectly, we can use the card reader as a mass storage device.
Now, we plan to change the vf50 by an i.mx6ULL and I am currently trying to use the card reader using an image which I flash using Toradex easy installer. Howerver, all demo images available seem to work in gadget mode, which does not allow me to see the card reader.
Is there a way to boot one of the demo images in USB host mode? The card reader connects to the second USB port.

Thanks
Bernd

Hello @bernd_mohr ,

Which image and iMX6ULL version are you using?

I have made a quick test with TorizonCore Upstream with PREEMPT_RT 5.7.0+build.17 running on an iMX6ULL 1GB IT V1.1A , and an Aster carrier board. The USB card reader is detected when connected to any of the 2 USB ports of the carrier board and the microSD card is mounted correctly.

My dmesg output:

[ 2212.647713] usb 1-1: new high-speed USB device number 6 using ci_hdrc
[ 2212.853316] usb-storage 1-1:1.0: USB Mass Storage device detected
[ 2212.862966] scsi host0: usb-storage 1-1:1.0
[ 2213.909126] scsi 0:0:0:0: Direct-Access     Mass     Storage Device        PQ: 0 ANSI: 0 CCS
[ 2213.914710] sd 0:0:0:0: [sda] 31116288 512-byte logical blocks: (15.9 GB/14.8 GiB)
[ 2213.915186] sd 0:0:0:0: [sda] Write Protect is off
[ 2213.915204] sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
[ 2213.915684] sd 0:0:0:0: [sda] No Caching mode page found
[ 2213.915700] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 2213.955688]  sda: sda1
[ 2213.959579] sd 0:0:0:0: [sda] Attached SCSI removable disk

Best regards,
Josep

Hi Josep,
we have an i.MX6ULL 256MB. The image you mention is seen by the Easy Installer, and marked as locally available on the SD card, but greyed out with a tooltip saying that it is not compatible with my HW. Looks like it fits only for the 1GB version, as the download page already says.
I will try to find another image on the download page which fits my module.

Thanks
Bernd

Hello @bernd_mohr ,

The Torizon images are only supported by the 1GB version of the iMX6ULL. The versions with less RAM only support BSP images.

Were you able to succeed with the minimal or the multimedia reference image?

Best regards,
Josep

Hello Josep,

I have tried
https://artifacts.toradex.com:443/artifactory/tdxref-oe-prerelease-frankfurt/LinuxImage4.0/monthly/2/colibri-imx6ull/tdx-x11-upstream/console-tdx-image/images/Colibri-iMX6ULL_Console-Image-upstream-Tezi_4.0.0-devel-202004%2Bbuild.2.tar
which seems to be the image you mentioned.
It looks like USB is in host mode, but only USB1 is active, our card reader connects to USB2, and since I have a custom carrier board I cannot check with USB1.

regards

Bernd

Hi @bernd_mohr,

I don’t understand something. You tell you are replacing on your custom board VF50 with iMX6ULL. But these both have same default demo image configuration for USB ports. No change there. Do you mean you changed it on VF50 expect Toradex to change the same for you on iMX6ULL?

Colibri VF50 pin - compatible function - VFXX pin:

139 USB Host DP USB1_DP
141 USB Host DM USB1_DM
143 USB Client DP USB0_DP
145 USB Client DM USB0_DM

Colibri iMX6ULL pin - compatible function - iMX6ULL ball:

139	USB Host DP	USB_OTG2_DP
141	USB Host DM	USB_OTG2_DN
143	USB Client DP	USB_OTG1_DP
145	USB Client DM	USB_OTG1_DN

As you see both host and client on the same pins. If you need to swap them, then you need to modify kernel device tree.

And regarding card reader, perhaps it is just not enabled in kernel config for iMX6ULL. Does any FAT32 formatted USB drive mounts when you plug it to host port? If not, then perhaps USB traces on your custom board are marginal, which is enough for VF to operate and iMX6ULL not?

Edward

Hi Edward,
We did some changes on the Device tree of the console Image (it was OE 2.5, IIRC), at least we had to add our company logo for boot splash, enabled a 4th UART and did some change in the timing of the screen. I do not remember if we changed the setting for USB.
I hoped to find a demo image to quickly check if USB is still working by simply replacing the SOM and installing an appropriate demo image. I did this test for GPIO, backlight, MMC, SPI etc without any problem, so I think testing USB will also not raise any issue, its just in case.
Unfortunately, I cannot connect a different USB device since we have a custom USB connector.
I checked with the carrier board schematics, USB connects to X139 and X141.

regards

Bernd.

So it isn’t anything custom regarding USB. Could you please try with FAT32 formatted USB drive? With Linux demo image it should mount to /media/sda1. If it fails to mount you should see some messages regarding it in dmesg.
Check as well lsusb command output, it should differ with your card reader plugged and unplugged. If no reaction, then I guess there’s something wrong with your custom layout.

Didn’t you limit USB speed on your old design? Not sure, if it will work with your old kernel, but something like this should confirm USB speed

cat `find /sys -name maximum_speed`

Edward

Hi Edward,

I checked what you suggested on the new and old SOMs:

Before plugging a card to the reader

root@colibri-imx6ull:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@colibri-imx6ull:~# dmesg | grep usb
[ 0.147202] regulator-usbh-vbus GPIO handle specifies active low - ignored
[ 0.151338] usbcore: registered new interface driver usbfs
[ 0.151482] usbcore: registered new interface driver hub
[ 0.151617] usbcore: registered new device driver usb
[ 2.665245] usbcore: registered new interface driver usb-storage
[ 2.677344] usbcore: registered new interface driver usbserial_generic
[ 2.689638] usbserial: USB Serial support registered for generic
[ 2.704450] imx_usb 2184000.usb: No over current polarity defined
[ 2.716289] imx_usb 2184000.usb: 2184000.usb supply vbus not found, using dummy regulator
[ 2.741794] imx_usb 2184200.usb: No over current polarity defined
[ 3.025145] usbcore: registered new interface driver usbhid
[ 3.037678] usbhid: USB HID core driver
[ 3.052392] usbcore: registered new interface driver snd-usb-audio
root@colibri-imx6ull:~#

root@colibri-imx6ull:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@colibri-imx6ull:~# dmesg | grep usb
[ 0.147202] regulator-usbh-vbus GPIO handle specifies active low - ignored
[ 0.151338] usbcore: registered new interface driver usbfs
[ 0.151482] usbcore: registered new interface driver hub
[ 0.151617] usbcore: registered new device driver usb
[ 2.665245] usbcore: registered new interface driver usb-storage
[ 2.677344] usbcore: registered new interface driver usbserial_generic
[ 2.689638] usbserial: USB Serial support registered for generic
[ 2.704450] imx_usb 2184000.usb: No over current polarity defined
[ 2.716289] imx_usb 2184000.usb: 2184000.usb supply vbus not found, using dummy regulator
[ 2.741794] imx_usb 2184200.usb: No over current polarity defined
[ 3.025145] usbcore: registered new interface driver usbhid
[ 3.037678] usbhid: USB HID core driver
[ 3.052392] usbcore: registered new interface driver snd-usb-audio
root@colibri-imx6ull:~#

root@colibri-imx6ull:~# cat $(find /sys -name maximum_speed)
high-speed

Now, I mounted the carrier board (same version) with the old SOM:

On the old colibri, we have also Bus 0002, where the card reader is found. Besides,
a red LED inside the card reader is on. It looks like the card reader does not even get powered. I will have out HW guys check that.

root@colibri-vf:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 22c4:1000
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

root@colibri-vf:~# dmesg | grep usb
[ 0.189922] usbcore: registered new interface driver usbfs
[ 0.190162] usbcore: registered new interface driver hub
[ 0.190577] usbcore: registered new device driver usb
[ 1.059758] usbcore: registered new interface driver usb-storage
[ 1.066469] usbcore: registered new interface driver usbserial
[ 1.072607] usbcore: registered new interface driver usbserial_generic
[ 1.079412] usbserial: USB Serial support registered for generic
[ 1.085642] usbcore: registered new interface driver ftdi_sio
[ 1.091701] usbserial: USB Serial support registered for FTDI USB Serial Device
[ 1.099343] usbcore: registered new interface driver pl2303
[ 1.105091] usbserial: USB Serial support registered for pl2303
[ 1.256283] usbcore: registered new interface driver usbhid
[ 1.261986] usbhid: USB HID core driver
[ 1.380229] 40034000.usb supply vbus not found, using dummy regulator
[ 1.437661] usbh_vbus: supplied by 5v0
[ 2.089243] usb 2-1: new full-speed USB device number 2 using ci_hdrc
[ 2.292862] usb-storage 2-1:1.0: USB Mass Storage device detected
[ 2.302371] scsi host0: usb-storage 2-1:1.0
[ 19.284742] usb0: HOST MAC 00:14:2d:ff:ff:fe
[ 19.291820] usb0: MAC 00:14:2d:ff:ff:ff
[ 21.842697] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready

root@colibri-vf:~# cat $(find /sys -name maximum_speed)
high-speed

regards

Bernd

Demo image 5.7.x should lsusb two root hubs, no matter is something connected to USB or not, is one of them in host mode or in device mode.

Could you please check iMX6ULL device marking? There are 6ull variants with single USB controller. 6Y0 in device marking should be a sign of such device. All other 6Y1/6Y2 variants should have two USB’s. And Toradex SOM datasheet says all used 6ull variants, even smallest one, are 6Y2. Though it would be better to read part id registers to make sure. Hope it is not a counterfeiting or wrong parts shipped case.

Edward

Hi Edward,

where can I find this device marking? I have the serial number which comes from the QR code which is

0036110007012321

In contrast to the device photo of the Toradex homepage, 2 circuits are not equipped, namely the one in the upper right corner with the heat spreader and one of the eight-pin devices, namely the one next to the sticker.

This does not need to mean anything since the device photo of the HP shows a 512MB device.

Regards

Bernd

I meant code engraved on CPU. According to iMX6ULL SOM datasheet it should be MCIMX6Y2DVM05AB. And according to iMX6ULL datasheet all CPU variants with 6Y2 should include two USB OTG controllers. 6Y0 comes with one OTG, misses CAN, no security, etc.

I see, it is 6Y2D.

Hi @bernd_mohr,

Then both OTG’s should be present. I’m unable to find in iMX6ULL how to determine software wise what features are enabled in particular SOC instance, and which are disabled. Only fusemap seems talking about different variants, at least speed grade is specified there. But I don’t see which fuse or register should reflect presence of optional OTG.
Anyway, since both OTG’s are enabled in device tree in demo image, I would expect some failure in dmesg when one of OTG’s fails to initialize. Perhaps initialization succeeds, but something else prevents one of OTG’s to appear in lsusb list. I would try debugging why it is so in your case, but I think this Colibri instance should be just RMA’ed.

Regards
Edward

Hello @bernd_mohr ,

Would it be possible for you to share with us the schematics of your board? You can send them to support.eu@toradex.com, mentioning your issue.

Best regards,
Josep

Hi Edward,

I had meanwhile the opportunity to test with another carrier board, with this, I can use the cardreader as expectected. So it looks like the carrierboard which I was using first has an issue. Interestingly, I see this cardreader on the tree of USB1, while USB2 does not even appear using lsusb. So, it definitely makes sense for me to get a different SOM from the lab and check with this.

Regards

Bernd

With one USB set up in DT as role=host, and another USB set up as role=peripheral, you would see one root hub in lsusb output. But demo image comes with one role = host + role = otg. In this case you should see two root hubs in lsusb, no matter which carrier board. Or at least there should be some error in dmesg, which would justify absence of one root hub.

Edward

Hi,

I do know that there is an issue with the first Carrier board I have tried, and with the second it works.

As for the issue that I only see one USB hub, I will check if I find something suspicious in dmesg, and get another SOM from my collegues to check, but I won’t be able to do this before mid of next week.

Regards

Bernd

Hi,

Part of truth in this story evaporates somewhere.
It can’t be that with same SOM, and same BSP+*.dtb on it, on one carrier you see single root hub, on another carrier you see two root hubs. Like I said, with untouched BSP demo, like you claimed you are using, role of one USB is programmed to “host” in *.dtb, and role of another USB is programmed to “otg”. “host” gives one root hub, “otg” gives another root hub, no matter what mode OTG operates in. So two root hubs. Single root hub you should see with one of your USB’s reconfigured to “peripheral”, but you said you are using official demos…

Hi Edward,

I had the chance to make some testing with two i.mx6ULL SOM modules (same modules, but just to exclude HW defects of a module), two of our carrier boards and a Toradex EVA board (the big, so called “Colibri Evaluation Board”). Both SOMs had a prebuild image which reports

TDX X11 Upstream 4.0.0-devel-202004+build.22 (zeus)

In /etc/os-release

Besides the card reader, we also connected an externally powered, so called connectivity board, to the SOM via USB. This connectivity board shall in a future release connect via Ethernet over USB. The connectivity board is a SOM with Linux in Gadget mode.

The outcome of the tests where as follows:

  • Connecting the connectivity board to the SOM when plugged in the Toradex EVA board was possible, the USB0 device appeared on plugging without any further user interaction. After configuration USB0 we could log on the connectivity board without problems
  • On the Toradex EVA board, lsusb showed both internal USB hubs, plus another one which seems to be located on the EVA board.
  • On our carrier board, both SOMs showed only one USB hub. When plugging the connectivity board, there was absolutely nothing seen on the console or using dmesg, although the USB power could be measured on the connectivity board.
  • On our carrier board, an VF50 which we are using currently, detected at least on a low level the connectivity board. Since our custom image there lacks the upper ethernet over USB drivers, ethernet connection was not possible.
  • Although the card reader work basically on the i.mx6ULL on our carrier board, it needs to be connected on startup. Unplugging and replugging did not connect the card reader. Not even the power LED of the reader was on. In turn, using the VF50 instead, re-plugging worked.

It looks like there is an issue with our carrier board which does not show up on the VF50. I am in contact with our HW engineering group to find out more about that.

I also asked Project Management if it is possible to send the schematics to you. Right now it is not possible, we would need to sign an NDA first.

Regards

Bernd