Dear NXP,
I am using the imx6d board and using the UUU tool to flash the image into the board but while flashing and using the FBK command while booting i am getting below error while executing the linuxrc file
Start handle command
udc-core: couldn't find an available UDC or it's busy
./linuxrc: line 143: echo: write error: Device or resource busy
uuc /dev/utp
uuc 0.6 [built Nov 7 2019 19:25:07]
UTP: Waiting for /dev/utp to appear
UTP: file/device node /dev/utp already exists
below is my u-boot configuration.
ONFIG_CMD_FASTBOOT=y
CONFIG_USB_FUNCTION_FASTBOOT=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_DOWNLOAD=y
CONFIG_USB_GADGET_MANUFACTURER="FSL"
CONFIG_USB_GADGET_VENDOR_NUM=0x0525
CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
CONFIG_CI_UDC=y
CONFIG_FSL_FASTBOOT=y
CONFIG_FASTBOOT=y
CONFIG_FASTBOOT_BUF_ADDR=0x83800000 # Address need change according ←-
system, generally it can be the same as ${LOADADDR}
CONFIG_FASTBOOT_BUF_SIZE=0x40000000
CONFIG_FASTBOOT_FLASH=y
CONFIG_FASTBOOT_FLASH_MMC_DEV=1
CONFIG_EFI_PARTITION=y
CONFIG_ANDROID_BOOT_IMAGE=y
I have done below kernel configuration .
CONFIG_USB_CONFIGFS_F_FS=y
CONFIG_USB_CONFIGFS_MASS_STORAGE=y
CONFIG_USB_F_MASS_STORAGE=y
CONFIG_USB_F_FS=y
CONFIG_USB_CONFIGFS_F_FS=y
below is my linuxrc file content
#!/bin/sh export PATH=/sbin:/bin:/usr/sbin:/usr/bin mount -t sysfs none /sys mount -t proc none /proc mount -t devtmpfs none /dev mount -t configfs none /sys/kernel/config modprobe sysflags # disable turn off display echo -e "\033[9;0]" > /dev/tty0 #mkdir -p /myconf/config/usb_gadget/g1 #cd /myconf/config/usb_gadget/g1 mkdir -p /sys/kernel/config/usb_gadget/g1 cd /sys/kernel/config/usb_gadget/g1 echo 0x066F > idVendor echo 0x9BFF > idProduct mkdir -p strings/0x409 echo 0000000000000000 > strings/0x409/serialnumber echo "FSL i.MX Board" > strings/0x409/product mkdir -p configs/c.1 echo 5 > configs/c.1/MaxPower mkdir os_desc echo 1 > os_desc/use echo "MSFT100" > os_desc/qw_sign echo 0x40 > os_desc/b_vendor_code mkdir -p functions/ffs.utp mkdir /dev/usb-utp mount -t functionfs utp /dev/usb-utp ln -s functions/ffs.utp configs/c.1/ ln -s configs/c.1 os_desc
echo /fat > functions/mass_storage.1/lun.0/file
ufb /dev/usb-utp$2/ep0 &
echo run utp at /dev/usb-utp$2/ep0;
while [ ! -e /dev/usb-utp$2/ep1 ]
do
echo "."
sleep 1;
done
echo $1 > UDC ===> this is the line 143
Please help me on this issue , where i misconfigure the kernel in this .
Attaching the linuxrc file.
Regards,
Rakesh
Hi Aldo,
I am using the below script as linuxrc .
#!/bin/sh
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
mount -t sysfs none /sys
mount -t proc none /proc
mount -t devtmpfs none /dev
mount -t configfs none /sys/kernel/config
cmdline=`cat /proc/cmdline`
# disable turn off display
echo -e "\033[9;0]" > /dev/tty0
last=0;
UDC_DIR=/sys/class/udc
function launch_dhcpd() {
touch -f /var/lib/misc/udhcpd.leases
echo start 168.1.1.50 > /conf
echo end 168.1.1.253 >> /conf
echo interface usb$1 >>/conf
ifconfig usb$1 168.1.1.1
udhcpd /conf
}
function contains() {
for i in "${files[@]}"
do
if [ "$i" == "$1" ]; then
return 1;
fi
done
return 0
}
function launch_uuc() {
echo $1 $2
mkdir /sys/kernel/config/usb_gadget/$1
cd /sys/kernel/config/usb_gadget/$1
echo 0x066F > idVendor
if [[ ${cmdline} == *nfsroot* ]]; then
echo 0x9CFF > idProduct
else
echo 0x9BFF > idProduct
fi
mkdir strings/0x409
if [ -e /sys/devices/soc0/soc_uid ]; then
cat /sys/devices/soc0/soc_uid > strings/0x409/serialnumber
else
echo 0000000000000000 > strings/0x409/serialnumber
fi
echo "FSL i.MX Board" > strings/0x409/product
mkdir configs/c.1
echo 5 > configs/c.1/MaxPower
echo ffs.utp$2
echo 1 > os_desc/use
echo "MSFT100" > os_desc/qw_sign
echo 0x40 > os_desc/b_vendor_code
if [[ ${cmdline} == *nfsroot* ]]; then
mkdir functions/ncm.1
ln -s functions/ncm.1 configs/c.1/
# mkdir functions/acm.1
# ln -s functions/acm.1 configs/c.1/
echo $1 > UDC
echo "Start config network"
ifconfig usb$2 up
while [ ! -e /find_one ]
do
if [[ `ifconfig usb$2` == *inet6* ]]; then
break;
fi
sleep 1
done
if [ -e /find_one ]; then
exit 0
fi
touch /find_one
launch_dhcpd $2
remote=""
while [[ "$remote" == "" ]];
do
sleep 2
echo retry get remote ipaddress
ping6 -c2 -I usb$2 ff02::1
remote=`ip -6 neighbor show dev usb$2`
remote=(${remote})
remote=${remote[0]}
done
nfs=${cmdline#*nfsroot=}
nfs=($nfs)
nfs=${nfs[0]}
nfs=${nfs##*:}
echo ${remote} ${nfs}
mount -t nfs [${remote}%usb$2]:${nfsroot}/${nfs} /mnt/
cd /
touch /exit_scan
else
mkdir functions/ffs.utp$2
mkdir /dev/usb-utp$2
mount -t functionfs utp$2 /dev/usb-utp$2
ln -s functions/ffs.utp$2 configs/c.1/
ln -s configs/c.1 os_desc
mkdir functions/mass_storage.1
ln -s functions/mass_storage.1 configs/c.1/
echo /fat > functions/mass_storage.1/lun.0/file
ufb /dev/usb-utp$2/ep0 &
echo run utp at /dev/usb-utp$2/ep0;
while [ ! -e /dev/usb-utp$2/ep1 ]
do
echo "."
sleep 1;
done
echo $1 > UDC
if [ $2 == "0" ]; then
echo uuc /dev/utp
uuc /dev/utp &
else
echo uuc /dev/utp$2
uuc /dev/utp$2 &
fi
fi
return 0;
}
while true; do
if test "$(ls -A "$UDC_DIR")"; then
cd $UDC_DIR
for entry in *
do
if contains $entry; then
files[$last]=$entry;
id=$last;
last=`expr $last + 1`;
echo "Found New UDC: $entry";
launch_uuc $entry $id &
fi
done
sleep 1
else
echo "No udc Available!"
sleep 30
fi
if [ -e /exit_scan ]; then
echo find one active ncm
exec switch_root /mnt /sbin/init
exit 1;
fi
done
echo bye
Here i am using the kernel version 5.10 and u-boot 2021.
Here error is coming at command "echo $1 > UDC"
Regards,
Rakesh
Hello,
thank you for sharing more information, have you tried using the UUU script to flash using Linux kernel?
https://github.com/nxp-imx/mfgtools/wiki/Sample-script#burn-yocto-image-to-emmc-by-linux-kernel
Best regards,
Aldo.