Activation Codes and Methods, Hardware Details, Sniffing
Post Reply
WuCun
Posts: 1
Joined: 14 Mar 2022, 09:56

usb_modeswitch can't find device on mips board

Post by WuCun » 14 Mar 2022, 10:56

Hello everyone, I am trying to switch the mode of Realtek 8821cu (0bda:1a2b) from usb-storage to wlan on my mips development board, so I perform cross compile for usb_modeswitch. But when I run it on my platform, it shows there are not device is in default mode like this:

Code: Select all

[root@Zeratul:~]# usb_modeswitch -v 0bda -p 1a2b
Look for default devices ...
 No devices in default mode found. Nothing to do. Bye!
I am sure I was running it as root.

The result of lsusb command is:

Code: Select all

[root@Zeratul:~]# lsusb
Bus 001 Device 002: ID 2109:2817
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 003: ID 05e3:0749
Bus 001 Device 004: ID 0bda:1a2b
Bus 001 Device 005: ID 0bda:5412
Bus 001 Device 006: ID 0bda:8153
And this shell can show what I do when performing cross compile:

Code: Select all

ROOT_DIR=$(pwd)
INST_DIR=${ROOT_DIR}/output

CONFIG_HOST=mips
CONFIG_TOOLCHAIN_DIR=/mnt/system/zeratul_t40_release_20211118/Zeratul_T40_Release_20211118/tools/toolchain/gcc_720/mips-gcc720-glibc226/bin
CONFIG_CROSS_COMPILE_C=${CONFIG_TOOLCHAIN_DIR}/mips-linux-uclibc-gnu-gcc


echo
echo INST_DIR=${INST_DIR}
echo HOST=${CONFIG_HOST}
echo CC=${CONFIG_CROSS_COMPILE_C}
echo


PKG_CONFIG_PATH=${INST_DIR}/lib/pkgconfig:${PKG_CONFIG_PATH}
export PKG_CONFIG_PATH


rm -rf ${INST_DIR}


cd ${ROOT_DIR}/libusb-1.0.25
make uninstall && make clean 
./configure --disable-udev --host=${CONFIG_HOST} --prefix=${INST_DIR} CC=${CONFIG_CROSS_COMPILE_C} CFLAGS="${CFLAGS} -muclibc"
make && make install


DESTDIR=${INST_DIR}
export DESTDIR

cd ${ROOT_DIR}/usb-modeswitch-2.6.0
make uninstall && make clean 
make CC=${CONFIG_CROSS_COMPILE_C} CFLAGS="${CFLAGS} -muclibc" LDFLAGS="${LDFLAGS} -lpthread"
make install


cd ${ROOT_DIR}/usb-modeswitch-data-20191128
make uninstall
make CC=${CONFIG_CROSS_COMPILE_C} CFLAGS="${CFLAGS} -muclibc" LDFLAGS="${LDFLAGS} -lpthread"
make install
These commands will be execute to install modules after system reboot:

Code: Select all

modprobe usb-common
modprobe usbcore
modprobe dwc2
modprobe phy-ingenic-inno
modprobe usbserial
modprobe scsi_mod
modprobe sd_mod
modprobe usb-storage
These message are displayed with the plugged in of 8821cu:

Code: Select all

[  446.652952] usb 1-1.2: new high-speed USB device number 7 using dwc2
[  446.804920] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[  446.814314] scsi host2: usb-storage 1-1.2:1.0
[  447.815855] scsi 2:0:0:0: CD-ROM            Realtek  Driver Storage   1.00 PQ: 0 ANSI: 0 CCS
Is anyone have a idea about this issue? Sincerely appreciate your help.

Post Reply