Hello,
In our application the USB peripheral of the i.MX8M Nano is Master by grounding the USB1_ID pin(D22) through a 0E resistor.
During mass manufacturing of our product we intend to use the USB Serial Download to program the device, will this functionality work if the i.MX8 is in USB Master mode or should we switch to Slave Mode
Regards Arne Maathuis, Sintecs, NL
First of all, I should correct the wrong concept. In USB spec, there are no master or slave. It is called host and peripheral(device).
host and peripheral(device) have no id pin. Only otg mode has one ID pin.
Let's say usb 2.0. 4 pins for host and peripheral(device). 5 pins for otg.
Reflecting to the Linux dts binding guide, they are dr_mode=host,dr_mode=peripheral and dr_mode=otg
Linux/Documentation/devicetree/bindings/usb/generic.txt
dr_mode: tells Dual-Role USB controllers that we want to work on a
particular mode. Valid arguments are "host",
"peripheral" and "otg". In case this attribute isn't
passed via DT, USB DRD controllers should default to
OTG.
From your description, you plan to use the usb port as host. And your question should be how to deal with the download when normal run usb as host mode.
So, in your case, you should have two dts. one for programming(dr_mode=peripheral) and another for normal run(dr_mode=host).
actually, you don't have to do grounding the usb id pin by hardware. Because as above no id pin defined in host and peripheral(device).
If you add dr_mode=host, Linux will never check the id pin.
if you add dr_mode=peripheral, Linux also will never check the id pin.
The same is the i.MX ROM code download mode is work as peripheral(device). It will never check the id pin, either.
i.MX ROM code engineers and the Linux engineers are using the same concept and follow the same usb spec.
No id pin for host and peripheral(device). and otg has id pin.
Hello and thank you for replying.
If I'm not wrong, the whole flashing procedure looks like this:
1) Start iMX with BOOT PINs 1000 -> serial donwload mode, no dts needed since it's only ROM code that gets executed.
2) In serial download mode, iMX is a peripheral device, I guess. We then use the uuu to download imx-boot from PC to iMX RAM. No OTG pin needed (like USB_ID).
3) u-boot SPL is loaded and loads u-boot with the corresponding dts (imx8mn-ddr4-evk.dts?). Is the device still in peripheral mode? Do we still only need the 4 pins (PWR, DP, DN, GND)?
4) u-boot enters fastboot in order to receive orders from a script that is running on a PC via uuu again. We then can flash the Image to the eMMC memory, right? We also can burn fuses to tell iMX to boot from eMMC next time and to ignore the BOOT MODE pins.
Is that correct? Thank you!
The BSP default dr_mode is otg reflecting the i.MX reference board hardware design.
And you hardware design is 4 pin, either host or peripheral (device). That is why you need two dts. one for download, one for normal run as previous reply.
and next time, if uboot can work you just type fastboot 0(0 is usb controller number) to start the download.
you don't have to switch to download mode. just use uboot fastboot command. on pc side uuu already can talk to board.
Dear NXP Support,
change to what? Where can we find information about the USB_ID functionality? We also would like to flash the iMX8 during production via USB OTG port. But we're also unsure about the USB1_ID pin.
Thanks in advance,
Thomas