imx7 Kernel 6.12.20 UUU - no udc available!

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

imx7 Kernel 6.12.20 UUU - no udc available!

Jump to solution
294 Views
edwardtyrrell
Senior Contributor I

Hi,

We're in the process of testing an eMMC and we need to build all the objects required for UUU, fsl-image-mfgtool-initramfs-imx7dsabresd.cpio.zst.u-boot etc which we've have done.

We need to do everything for UUU as we must include specific changes to run our new eMMC in flashing the board as well as booting into the new OS. Normally we'd take the pre-built NXP image and just replace what is actually flashed onto the board; in this case we can't do that as the first bootloader half (initramfs) of UUU cannot detect our specific eMMC.  

This issue we're experiencing is after running UUU we're not getting the imx to become a USB storage device as normal; what we get is 'No udc available!' From memory this involves a few tweaks in the device tree around the USB area and the kernel conf. I have tried for quite a while to get the UDC device to appear with no success, does anyone know if the later NXP builds create a UDC device for the purposes of UUU? Build is NXP Yocto 6.12.20

The command we're using for the initial half of UUU is bitbake fsl-image-mfgtool-initramfs in which we use the following files for UUU:

fsl-image-mfgtool-initramfs-imx7dsabresd.cpio.zst.u-boot,  zImage-imx7dsabresd.bin and imx7d-sdb.dtb

Advice please..

 

1) &usbotg1 {

vbus-supply = <&reg_usb_otg1_vbus>;

dr_mode = "peripheral"; <=============== peripheral or host?

status = "okay";

};

2) Does the UDC code expect a fixed mmc? Our eMMC is attached to mmc2

3) Kernel configs? CONFIG_USB_...... anything else?

4) Does the typical NXP Yocto build have all the .bb files to create everything for UUU i.e udc? Or do we need to add one/them?

 

Appreciate your help!

Kind regards,

0 Kudos
Reply
1 Solution
19 Views
edwardtyrrell
Senior Contributor I

Hi @Manuel_Salas 

I think I'll close this ticket as its going off the original topic now. In summary, the operation of UUU and MFGTool in relation to board builds are very different. UUU does everything via u-boot to flash the board where MFGTool uses an initramfs, CTP and USB gadget etc. Educated!    

My main issue now is trying to encourage Kernel 6.12.20 u-boot to show the console - in which I'll start another ticket. Your advice about  #define CONFIG_SYS_DEVICE_NULLDEV 1 worked to a point but the pop-up menuconfig box displayed no config data or something and closed. There's a post a few weeks old complaining of the same issue.

Thanks for your help and persistence, much appreciated!

  

 

View solution in original post

8 Replies
250 Views
edwardtyrrell
Senior Contributor I

Hi Salas,

Thank you for you information. I am now getting somewhere but it is still not being recognised as a USB memory device. Linux lusub states a device has appeared as a Mass storage but it's not usable.

The imx7 debug is:

 [ 2.279064] mmcblk0boot1: mmc0:0001 EH8ED4 4.00 MiB
[ 2.282618] file system registered
[ 2.285874] mmcblk0rpmb: mmc0:0001 EH8ED4 4.00 MiB, chardev (244:0)
run utp at /dev/usb-utp0/ep0
.
uuu fastboot client 1.0.0 [built [ 2.314437] read descriptors
Dec 24 2024 18:26:13]
Start init[ 2.320143] bcdVersion must be 0x0100, stored in Little Endian order. Userspace driver should be fixed, accepting 0x0001 for compatibility.
usb
[ 2.335404] bcdVersion must be 0x0100, stored in Little Endian order. Userspace driver should be fixed, accepting 0x0001 for compatibility.
write string[ 2.348436] read strings

Start handle command
[ 3.315837] UDC core: ci_hdrc.0: couldn't find an available UDC or it's busy
/linuxrc: line 139: echo: write error: Device or resource busy
[ 13.916786] platform 30730000.lcdif: deferred probe pending: platform: supplier regulator-lcd-3v3 not ready

 

As you can see it appears that the internal storage is not connected somehow to the USB storage gadget. The debug is vague that the resource is being used or non existent. According to my research there is no need to enable any file systems such as FunctionFS in the Kernel. What could be missing?   Also I could not find CONFIG_PHY_FSL_IMX7_USB in the 6.12.20 kernel config.

My build is the latest NXP Yocto 6.12.20.

Kind regards,

0 Kudos
Reply
266 Views
Manuel_Salas
NXP TechSupport
NXP TechSupport

Hello @edwardtyrrell 

I hopr you are doing very well.

 

1) dr_mode peripheral or host?
For UUU/mfgtool to work, the i.MX must appear as a USB gadget to the PC, so dr_mode = "peripheral" is required in the initramfs device tree for the active USB OTG port (usually usbotg1). Make sure VBUS supply and the USB PHY are marked status = "okay" and powered on at boot.

 

2) Does the UDC code expect a fixed MMC?
No, the UDC has no dependency on which mmc index your eMMC uses.

 

3) Kernel configs?
Yes:

CONFIG_USB_SUPPORT=y
CONFIG_USB_GADGET=y
CONFIG_USB_CHIPIDEA=y
CONFIG_USB_CHIPIDEA_UDC=y
CONFIG_USB_CHIPIDEA_IMX=y
CONFIG_PHY_FSL_IMX7_USB=y
CONFIG_USB_CONFIGFS=y
CONFIG_USB_CONFIGFS_MASS_STORAGE=y

 

4)

You can take a look to the file called uuu.auto included in the Pre-compiled images of the i.MX7ULP BSP web page.

 

In that file you can change between emmc_dev or sd_dev:

uuu_version 1.2.39

# This command will be run when i.MX6/7 i.MX8MM, i.MX8MQ
SDP: boot -f u-boot-imx7ulpevk_emmc.imx

# This command will be run when ROM support stream mode
# i.MX8QXP, i.MX8QM
SDPS: boot -f u-boot-imx7ulpevk_emmc.imx

# These commands will be run when use SPL and will be skipped if no spl
# SDPU will be deprecated. please use SDPV instead of SDPU
# {
SDPU: delay 1000
SDPU: write -f u-boot-imx7ulpevk_emmc.imx -offset 0x57c00
SDPU: jump
# }

# These commands will be run when use SPL and will be skipped if no spl
# if (SPL support SDPV)
# {
SDPV: delay 1000
SDPV: write -f u-boot-imx7ulpevk_emmc.imx -skipspl
SDPV: jump
# }

FB: ucmd setenv fastboot_buffer ${loadaddr}
FB: download -f imx7ulp_m4_demo.img
FB: ucmd sf probe
FB[-t 40000]: ucmd sf erase 0 100000
FB: ucmd sf write ${fastboot_buffer} 0 ${fastboot_bytes}

FB: ucmd setenv fastboot_dev mmc
FB: ucmd setenv mmcdev ${emmc_dev}
FB: ucmd mmc dev ${emmc_dev}
FB: flash -raw2sparse all imx-image-full-imx7ulpevk.wic
FB: flash bootloader u-boot-imx7ulpevk_emmc.imx
FB: done

 

Best regards,

Salas.

0 Kudos
Reply
232 Views
edwardtyrrell
Senior Contributor I

Hi @Manuel_Salas 

Appreciate your feedback. I've moved forward a bit to the point were the USB side seems like it's working; on running the first half of UUU I get a mass storage device appearing in lsusb (Linux desktop) but no volume appears as 'usable media' like a normal USB memory device does. On the imx7d it appears that no storage device is being created to attach to the utp system. 

With additional debug I feel the g_mass_storage, functionfs devices are not being created at all. I've added a lot of extra commands to linuxrc to dump out driver info, directories etc but nothing 'mass storage' related appears. The USB side and UDC appear to be fine as above, just no storage media to connect to it.

Changing over to 'M' in the kernel config for USB gadgets drivers there are no .ko like g_mass_storage, libcomposite.ko, functionfs etc modules - nothing. I've have played with the kernel config for a number of days now trying to encourage a mass storage device to appear but it never does, there's only a small amount of selectable gadget options as you know..

Is there any guarantee the latest NXP Yocto 6.12.20 actually provides everything required for USB UUU? As I just need a build to flash our board to test all the peripherals can you suggest a guaranteed version of Yocto to build that supports UUU? We cannot use any prebuilt kernels/OS as there are a few modifications we have to do for our specific eMMC.   

Kind regards,

Edward.

0 Kudos
Reply
210 Views
Manuel_Salas
NXP TechSupport
NXP TechSupport

Hello @edwardtyrrell 

 

Have you tried with the UMS command in U-boot?

When you flash the board with UUU you must set the chip in Serial Download mode, that is not a USB mass Storage, it is like a Fast boot.

You can set the command:

U-boot=> ums 0 mmc 0

 

This will set the device in UMS (USB mass storage).

 

Best regards,

Salas.

0 Kudos
Reply
44 Views
edwardtyrrell
Senior Contributor I

Hi @Manuel_Salas 

Thanks for your reply. Your last comment about trying commands in u-boot made me reconsider my thinking about what I was trying to achieve - which I now think is wrong. Examining the commands in the uuu scripts after loading u-boot-imx7dsabresd_sd.imx they are all u-boot commands and even ums is activated via u-boot - there is no need to boot into a MFGTool style initramfs and then enable a UTP device etc. All the UUU FB commands are all U-Boot.. Considering this though I'm still no further ahead, this is where everything stops:

1:3>Start Cmd:SDP: boot -f u-boot-imx7dsabresd_sd.imx
100%1:3>Okay (2.127s)

I get the same output from UUU whether using NXP's precompiled imx7 demo code or my new 6.12.20 build.

 

My debug terminal show nothing coming out of u-boot, clearly its console has been disabled. I've tried adding the commands in to UUU but still no console output:

FB: ucmd set baudrate 115200
FB: ucmd set console ttymxc0
#FB: ucmd set silent 0
FB: ucmd set stderr serial
FB: ucmd set stdin serial
FB: ucmd set stdout serial
FB: ucmd printenv

If I can get u-boot's console going then I can see what the issues are.  I've tried bitbake u-boot-imx -c menuconfig but it fails stating "do_menuconfig is disabled, please check KCONFIG_CONFIG_ENABLE_MENUCONFIG variable"

 

Kind regards.

 

 

 

 

 

   

0 Kudos
Reply
30 Views
Manuel_Salas
NXP TechSupport
NXP TechSupport

Hello.

 

As I understand, you are having two different issues. The first one is maybe the incorrect configuration of UART for console (ttymxc).

The second one is related to your Yocto Project, "unable to run bitbake u-boot-imx -c menuconfig due to a config error".

Tol solve the second one, please try adding the below line to your local.conf:

KCONFIG_CONFIG_ENABLE_MENUCONFIG = "1"

 

Then:

bitbake u-boot-imx -c menuconfig

 

Best regards,

Salas.

0 Kudos
Reply
20 Views
edwardtyrrell
Senior Contributor I

Hi @Manuel_Salas 

I think I'll close this ticket as its going off the original topic now. In summary, the operation of UUU and MFGTool in relation to board builds are very different. UUU does everything via u-boot to flash the board where MFGTool uses an initramfs, CTP and USB gadget etc. Educated!    

My main issue now is trying to encourage Kernel 6.12.20 u-boot to show the console - in which I'll start another ticket. Your advice about  #define CONFIG_SYS_DEVICE_NULLDEV 1 worked to a point but the pop-up menuconfig box displayed no config data or something and closed. There's a post a few weeks old complaining of the same issue.

Thanks for your help and persistence, much appreciated!

  

 

13 Views
edwardtyrrell
Senior Contributor I

That was in my last comment

KCONFIG_CONFIG_ENABLE_MENUCONFIG

 

Not CONFIG_SYS_DEVICE_NULLDEV

Tags (1)
0 Kudos
Reply