You can see here
Thank you! The /dev/at_ush2 works well. Now will figure out how to redirect linux console.
Interesting, I discovered that it’s impossible to disable “MODEM” function on USB by at!usbcomp commmand. Is it correct or I’m doing something wrong? I would like to leave only “diag,rawdata” functions for testing device, and “rawdata” for production device.
And it’s not possible to use “console=at_usb2,115200” (i tried different baudrates) for kernel serial console, because looks /dev/at_usb2 is not initialized on boot. The kernel initializes it much later:
[ 0.000000] Kernel command line: console=at_usb2,115200 root=/dev/ram rootfs_ro=true user1_fs=ubifs verity=on ima_ready=0 lkversion=SWI9X06Y_03.00.15.03 androidboot.serialno=f0cd1af8 quiet androidboot.baseband=msm rootfstype=ubifs rootflags=bulk_read
[ 13.634186] f_cdev_alloc: port_name:at_usb1 (c378adf9) portno:(1)
[ 13.871634] f_cdev_alloc: port_name:at_usb0 (b2d8b7c0) portno:(0)
[ 14.054215] f_cdev_alloc: port_name:at_usb2 (01c2fe27) portno:(2)
I have followed this document:
in FW R14.1, we can use the following commands to disable the modem port:
echo 0 > /sys/class/android_usb/android0/enable
echo diag,rmnet,ecm > /sys/class/android_usb/android0/functions
echo 1 > /sys/class/android_usb/android0/enable
But in FW R15.1, there is no such function in /sys/class/android_usb/android0/
You might need to refer to this:
FYI, my test shows that it is possible to remove modem port in Windows by the following command on WP7702 FW 15.1:
echo "" > /sys/kernel/config/usb_gadget/g1/UDC
mkdir /sys/kernel/config/usb_gadget/g2/
mkdir /sys/kernel/config/usb_gadget/g2/configs/c.1/
mkdir /sys/kernel/config/usb_gadget/g2/functions/diag.diag
ln -s /sys/kernel/config/usb_gadget/g2/functions/diag.diag /sys/kernel/config/usb_gadget/g2/configs/c.1/
mkdir /sys/kernel/config/usb_gadget/g2/functions/ecm.usb0
ln -s /sys/kernel/config/usb_gadget/g2/functions/ecm.usb0 /sys/kernel/config/usb_gadget/g2/configs/c.1
mkdir /sys/kernel/config/usb_gadget/g2/functions/rmnet_bam.rmnet_bam_dmux
ln -s /sys/kernel/config/usb_gadget/g2/functions/rmnet_bam.rmnet_bam_dmux /sys/kernel/config/usb_gadget/g2/configs/c.1
chmod 777 -R /sys/kernel/config/usb_gadget/g2/bDeviceClass /sys/kernel/config/usb_gadget/g2/bDeviceProtocol /sys/kernel/config/usb_gadget/g2/bDeviceSubClass /sys/kernel/config/usb_gadget/g2/bMaxPacketSize0 /sys/kernel/config/usb_gadget/g2/bcdDevice /sys/kernel/config/usb_gadget/g2/bcdUSB /sys/kernel/config /usb_gadget/g2/idProduct /sys/kernel/config/usb_gadget/g2/idVendor
cat /sys/kernel/config/usb_gadget/g1/bDeviceClass > /sys/kernel/config/usb_gadget/g2/bDeviceClass
cat /sys/kernel/config/usb_gadget/g1/bDeviceProtocol > /sys/kernel/config/usb_gadget/g2/bDeviceProtocol
cat /sys/kernel/config/usb_gadget/g1/bDeviceSubClass > /sys/kernel/config/usb_gadget/g2/bDeviceSubClass
cat /sys/kernel/config/usb_gadget/g1/bMaxPacketSize0 > /sys/kernel/config/usb_gadget/g2/bMaxPacketSize0
cat /sys/kernel/config/usb_gadget/g1/bcdDevice > /sys/kernel/config/usb_gadget/g2/bcdDevice
cat /sys/kernel/config/usb_gadget/g1/bcdUSB > /sys/kernel/config/usb_gadget/g2/bcdUSB
cat /sys/kernel/config/usb_gadget/g1/idProduct > /sys/kernel/config/usb_gadget/g2/idProduct
cat /sys/kernel/config/usb_gadget/g1/idVendor > /sys/kernel/config/usb_gadget/g2/idVendor
echo "msm_hsusb" > /sys/kernel/config/usb_gadget/g2/UDC
Thank you very much!
By the way, looks like there is path inconsistency in configuration made by Leaf environment and swi-linux-src, legato-src (downloaded by Leaf as well).
There is no recipe to write toolchain to build_bin/tmp/sysroots which is expected by rest part of Leaf environment (WP77XX_TOOLCHAIN_DIR in manifests).
So, the correct way is to use the sequence:
make image
make toolchain
After this should toolchain installation file in build_bin/tmp/deploy/sdk.
After this we should build SDK itself, with all development files for packages were build for root filesystem:
. poky/oe-init-build-env build_bin
bitbake -c populate_sdk mdm9x28-image-minimal
In build_bin/tmp/deploy/sdk directory will be installation file for SDK.
There was a problem with meta-swi/common/recipes-support/ntp/ntp_%.bbappend. In this file post-install hook will delete all NTP package files in /etc and /usr/bin, and entire ntp package became buggy. During making of SDK, it will fail on ntp packet post-install. I deleted this bbappend file, because I need normal ntp daemon and tools in my device.
After installing of toolchain and SDK to /opt/swi/y31-ext/, the Legato sources was able to use them. At least “make wp77xx” was successful.
FYI, I found a better solution on how to only remove MODEM port.
Below has been tested in WP76 FW17.1
- cp /etc/init.d/usb /home/root/
- cp /usr/bin/usb/boot_hsusb_composition /home/root
- chmod 777 /home/root/boot_hsusb_composition
- chmod 777 /home/root/usb
- modify “/home/root/usb” by “vi /home/root/usb”, in line 42, change it to call /home/root/boot_hsusb_composition
case $KERNEL in
[34].*)
# boot hsusb composition:
#/usr/bin/usb/boot_hsusb_composition n
/home/root/boot_hsusb_composition n
- modify “/home/root/boot_hsusb_composition” by “vi /home/root/boot_hsusb_composition”, in line 252, always remove the “smd” string in the variable “serialstr”:
serialstr=$(/usr/bin/ud_getusbinfo SERIALSTR)
if [ $? -ne 0 ];
then
echo "ud_getusbinfo gets SERIALSTR failed"
serialstr='smd,tty'
fi
serialstr=$(echo "$serialstr" | \
sed -e 's/^smd,//' \
-e 's/,smd,/,/' \
-e 's/,smd$//')
- /home/root/usb restart
- the USB port will be re-enumerated, and you should not see the MODEM port anymore while other port like raw data port or NMEA port should be still there in device manager