AMB82-mini: USB Ethernet failing

Hey everyone,

I’m trying to get the USB Ethernet (CDC-ECM) example (link to USB example) working on my AMB82-mini with a RTL8152B USB Ethernet dongle, but I’m hitting a wall. The board seems to initialize and sometimes even gets an IP, but the video engine (VOE) keeps failing with a timeout error.

[ECM] USB host ECM demo started...

Enter USB Ethernet host mode

[MEM] After do cmd, available heap 110194752

#

usb otg mode 1

USB_Init

[ECM]Usb Not Setup success,wait...

lwip_status 0 !!

[ECM]Usb Not Setup success,wait...

ecm deinit

[ECM]Usb Not Setup success,wait...

[ECM]Usb Not Setup success,wait...

ecm init fail

_freertos_delete_task(): ptask is NULL!

The bulk_task already deinit

The intr_task already deinit

USB_DeInit

ecm deinit ok

ecm_status 2

_freertos_delete_task(): ptask is NULL!

Sometimes I get this:

[ECM] USB host ECM demo started...

Enter USB Ethernet host mode

[MEM] After do cmd, available heap 110194752

#

usb otg mode 1

USB_Init

[ECM]Usb Not Setup success,wait...

usbh_cdc_ecm_set_ethernet_register_1 60

usbh_cdc_ecm_set_ethernet_register_2 a0

ecm init ok

ecm_status 1

CDC_ECM_NOTIFY_NETWORK_CONNECTION 1

connect

ecm lwip init

mac[00 e0 4c 36 07 40]

Lwip link up

BULK in failed 3

BULK in failed 3

---
---
---

BULK in failed 3

Lwip link down

link to unlink !!


LwIP_DHCP: dhcp stop.It can't get the DHCP

unlink to link !!

USB_DeInit

ecm deinit ok

ecm deinit

And sometimes I get an IP, but the video fails:

[ECM] USB host ECM demo started…
Enter USB Ethernet host mode

[MEM] After do cmd, available heap 110194752

usb otg mode 1
USB_Init
[ECM]Usb Not Setup success,wait…
usbh_cdc_ecm_set_ethernet_register_1 60
usbh_cdc_ecm_set_ethernet_register_2 a0
ecm init ok
ecm_status 1
CDC_ECM_NOTIFY_NETWORK_CONNECTION 1
connect
ecm lwip init
mac[00 e0 4c 36 07 40]
Lwip link up

Interface 2 IP address : 192.168.1.26
[LwIP_DHCP] dhcp offered_t0_lease: 86400DHCP Successful
unlink to link !!
UVID
Enable the video streaming test from ethernet

[MEM] After do cmd, available heap 109334592

[video_voe_presetting] fps:30  w:1920  h:1080

voe heap size = 19897344
fwin(1),enc_en(0),IQ_OFFSET = 0x17940
fwin(1),enc_en(0),SENSOR_OFFSET = 0x2a260
sensor id 1 iq_data 17940 sensor_data 2a260

RTSP[0] port: 554
hal_voe_ready 0x0 0xbf1208
ip = 192.168.1.26

read fcs_status 0x000000bf
[video_init] uvcd iq is null, use default.
[video_init] uvcd SNR is null, use default.
IQ:FW size (76042)
sensor:date 2024/9/12 version:RTL8735B_VOE_1.5.7.0
sensor:FW size (3996)
sensor timestamp: 2024/09/12
iq timestamp: 0000/00/00 00:00:00
voe_heap malloc 0x707ccb40, size 19897344
ISP:1 ENC:1 H265:1 NN:1
hal_voe_ready 0x0 0xbf1208
voe   :RTL8735B_VOE_1.7.0.0
sensor:RTL8735B_VOE_1.5.7.0
hal   :RTL8735B_VOE_1.7.0.0
load time sensor:53us iq:1054us itcm:0us dtcm:0us ddr:0us ddr2:0us
Set H264 default HIGH profile
rc_version RC_v1
[video_pre_init_procedure] START
hal_voe_send2voe too long 164527 cmd 0x00000206 p1 0x00000000 p2 0x00000000
VOE command 0x206 fail ret 0x0
rtsp stream enabled
[Local] Connected by 192.168.1.100
[Local] Enter rtsp request_loop
check_rtsp_url
No config
rtsp_cmd_options
check_rtsp_url
No config
rtsp_cmd_describe
[Local] REQUEST_PLAY

rtp started (TCP)
BULK in failed 3

[RTSP Err]Receive request len <=0, close socket
[Local] Socket closed
Lwip link down
link to unlink !!

rtp stopped (TCP)
USB_DeInit
ecm deinit ok
ecm deinit

When I try to play the RTSP stream using ffplayIt connects, but I get zero video data.
Any idea why this happens and how to fix this?
And also, how do I go about modifying the code to work with a 4G USB dongle?