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?

Hi @k-adarsh,

Have you tried opening the RTSP stream via VLC player?

Kindly refer to this link for the USB-to-Ethernet adapter that we have tested on our end.

Possible to share which USB Ethernet adapter model or brand you are using?

May I also check if you are using the default JXF37 sensor? We can provide a test firmware for you to try, which may help narrow down whether the issue is related to hardware or the source code.

Support for 4G USB dongles is currently under discussion and development.

Hey @Pammy, thanks for the reply. I am using this QHM8106 USB LAN device. I opened it up and verified it’s using the `RTL8152B` IC inside, and it works with my pc.

The camera is the one that came with the AMB82-mini dev board (which should be JXF37), and I modified the line to #define USE_SENSOR SENSOR_F37 in project/realtek_amebapro2_v0_example/inc/sensor.h.

If you can provide test firmware, I’ll try it out and get back to you with the results.

Hi @k-adarsh ,

You may verify the issue again with this testfw.

Thank you.

usb_example_testfw_f37.zip (1.6 MB)

No luck, here is the log

== Rtl8735b IoT Platform ==

[Normal mode]
BootFromNORFlash
[Start Boot ROM…]
=== Load PARTBL ===
=== Load Done ===
=== Load ISP_IQ ===
[fcs chk pass]
ISP_IQ @ 0x8461080, 0x65f80, 0x4
mfcs_data version 0x00010001
fcs_data version 0x00013700
=== Process ISP_IQ ===
=== Load Done ===
=== Load BL ===
[Image Start Table @ 0x18200]
=== Load Done ===

== Boot Loader ==
Nov  4 2025:14:24:05
=== Load FCS Para ===
=== Load Done ===
[crc pass]
=== Load ISP_IQ Sensor ===
ISP_IQ @ 0x8461080, 0x65f80
=== Process ISP_IQ ===
=== Load Done ===
=== Load FW1 ===
FW_ISP_IQ @ 0x8061080, 0x67f80
=== Process FW_ISP_IQ ===
DRAM_TYPE is DDR2 128MB.
ddr_freq = 533
VOE flash @ 0x80c9080, 0x82f80
FCS KM_status 0x00000082 err 0x00000000
Wait KM fcs done 0 us
FCS TM_status 0x003f0000
dark mode 0 adc final value 0 sample 1 mode 0
fcs final cmd 0x3d7a0b48 index 17
store fcs data for application
fcs OK
read fcs_status 0x0000007f
read fcs_status 0x0000007f
Can’t find ff ff ff ff
load time sensor:254us iq:4587us itcm:1101us dtcm:57us ddr:12422us ddr2:11305us
=== Process VOE IMG ===
[Image Start Table @ 0x20106200]
RAM Load @ 0x814c100->0x20106200, 0x5fc0
DDR Load @ 0x8153080->0x70100000, 0x201dd4
=== FW Load Done ===

Boot Loader <==

== RAM Start ==
Build @ 17:44:37, Apr  8 2026

$8735b>Enter atcmd for USB
interface 0 is initialized
interface 1 is initialized
interface 2 is initialized
cfg_size_lib = 120, cfg_size_user = 120

Initializing WIFI …[Driver]: [HALMAC]
11692M HALMAC_MAJOR_VER = 1
HALMAC_PROTOTYPE_VER = 4
HALMAC_MINOR_VER = 20
HALMAC_PATCH_VER =
[Driver]: The driver include MP
[Driver]: Ver = libwlan:2026.03.31.09.32_b9.6_8da5876be9c7aa226733778c75c3b38b242fedec
RFE type = 0
start_addr=(0x4000), end_addr=(0x8000), buffer_size=(0x4000), smp_number_max=(2048)

WIFI initialized
[Driver]: PSCAN_FAST_SURVEY channel: 1

[Driver]: set ssid [WPO]
[Driver]: rtw_joinbss_cmd MGMT_FRAME_PROTECTION_OPTIONAL no pmf.
[Driver]: Bcn (ie: 264, rsn: 0, wpa: 0) ch: 1, seq: 3640, ts: 1211956228643

[Driver]: start auth to c4:27:28:fc:1f:05

[Driver]: auth success, start assoc
[Driver]: listen_interval: 10, bcn_interval: 100

[Driver]: association success(res=1)

[Driver]: set pairwise key to hw: alg:4(WEP40-1 WEP104-5 TKIP-2 AES-4)

[Driver]: set group key to hw: alg:2(WEP40-1 WEP104-5 TKIP-2 AES-4) keyid:1
(0) Scan: 1, Auth: 1, Assoc: 1, 4way: 1, connect: 1, reason: 0

Interface 0 IP address : 192.168.1.28
[LwIP_DHCP] dhcp offered_t0_lease: 86400
init_thread(59), Available heap 0x4a7e3e0
[Driver]: TSFValue = 1211957555637, tsf = 0, shift_set= 0x8000, bcn int = 100

UECM

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

[MEM] After do cmd, available heap 78115168


#
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

Hi @k-adarsh ,

As I am not able to replicate issue from my end, I will try to assist you based on the provided logs.

The initialization sequence seems to be correct. The device initializes, gets a MAC address, and establishes a network link, but then encounters repeated BULK input failures. This suggests the problem occurs after initial network connection, potentially during data transfer attempts, we suspect something is interrupting the communication between the USB host and the RTL8152 adapter.

One of the reasons could be timing misalignments that leads to incomplete device initialization. While we are looking into this problem, would you mind to test again with this testfw? I have added a small delay before starting the BULK IN transfer as the RTL8152 might need more time after the packet filter is set and before switching over to the transfer state.

Thanks.

usb_example_testfw_f37_2.zip (1.7 MB)

@KevinKL Here is the output.

UECM

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

[MEM] After do cmd, available heap 78113536



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, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
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
UECM      # << Tried again

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

[MEM] After do cmd, available heap 78113536



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, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
INTR 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
UECM     # << Tried again

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

[MEM] After do cmd, available heap 78113536



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.35  # << Got IP

write_fast_connect_data_to_flash():not the same ssid/passphrase/channel/offer_ip, write new profile to flash
[LwIP_DHCP] dhcp offered_t0_lease: 86400DHCP Successful
unlink to link !!
Lwip link down       #<< But failed again after a few seconds.
link to unlink !!
USB_DeInit
ecm deinit ok
ecm deinit

hi @k-adarsh ,

Thank you for testing. The RTL8152 might require the Ethernet Packet Filter to be set before it can properly receive data on the BULK IN endpoint. The set packet filter process has been skipped previously, I have added it back. Please help to test again with this firmware. If this still does not work, you may consider testing with another USB-Ethernet adapter first while we are verifying the issue.

usb_example_testfw_f37_3.zip (1.7 MB)

This works finally, but it’s still unstable.

Please check the comments that I have added in the logs with # <<.

UECM

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

[MEM] After do cmd, available heap 78114592

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
usbh_cdc_ecm_set_ethernet_packetfilter 28
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.39 # << Got the IP

write_fast_connect_data_to_flash():not the same ssid/passphrase/channel/offer_ip, write new profile to flash
[LwIP_DHCP] dhcp offered_t0_lease: 86400DHCP Successful
unlink to link !!
[USBH] Device disconnected, bulk test aborted[0]
[USBH] Device disconnected, intr test aborted[0]
Lwip link down
link to unlink !!  # << But disconnected after a few seconds
USB_DeInit
ecm deinit ok
ecm deinit
UECM  # << Tried again

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

[MEM] After do cmd, available heap 78114592

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
usbh_cdc_ecm_set_ethernet_packetfilter 28
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.40 
# << This time the connection was stable and I could do ping

write_fast_connect_data_to_flash():not the same ssid/passphrase/channel/offer_ip, write new profile to flash
[LwIP_DHCP] dhcp offered_t0_lease: 86400DHCP Successful
unlink to link !!
UVID # << Started streaming
Enable the video streaming test from ethernet

[MEM] After do cmd, available heap 77254432



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

voe heap size = 32070912
fwin(1),enc_en(0),IQ_OFFSET = 0x4dc00
fwin(1),enc_en(0),SENSOR_OFFSET = 0x65c40
sensor id 4 iq_data 4dc00 sensor_data 65c40

RTSP[0] port: 554
hal_voe_ready 0x0 0x1718
ip = 192.168.1.40

rc_version RC_v1
The fcs setup is finished
[VOE]load time sensor:254us iq:4587us itcm:1097us dtcm:57us ddr:12382us ddr2:11302us
[VOE]VOELOAD(18377)/FCS(43527)/ISPReady(26326)/FrameDone(88769) KMRST(143839) us
fcs_start_time 66 fcs_voe_time 75 frame_done_time 163
g_enc_buff_size 0 = 2356352
g_enc_buff_size 1 = 1163776
g_enc_buff_size 2 = 8

[VID Wrn]
CH 0 MMF ENC Queue full

[VID Wrn]
CH 0 MMF ENC Queue full

[VID Wrn]
CH 0 MMF ENC Queue full
----
----
----
----
----

[VID Wrn]
CH 0 MMF ENC Queue full

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 (UDP) # << I was able to stream for a few minutes

ch = 0 sf:901 df:0 l:0%

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

rtp stopped (UDP) # << Then It disconnected by itself
USB_DeInit
ecm deinit ok
ecm deinit

Hi @k-adarsh ,

Thanks for verifying, the fix resolves the initial “BULK in failed 3” error. The occasional disconnection after extended use may be due to USB power management or RTL8152 suspend mode, which would require additional keepalive mechanisms to fully resolve. I have added another 50ms delay before setting packet filter to ensure the device is ready. Please test again with this test firmware and let us know the outcome.

Thank you.

usb_example_testfw_f37_4.zip (1.7 MB)



UECM

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

[MEM] After do cmd, available heap 78114592



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
usbh_cdc_ecm_set_ethernet_packetfilter 28
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, hc_state=0
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
UECM

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

[MEM] After do cmd, available heap 78114592



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
usbh_cdc_ecm_set_ethernet_packetfilter 28
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
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
UECM

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

[MEM] After do cmd, available heap 78114592



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
usbh_cdc_ecm_set_ethernet_packetfilter 28
ecm init ok
ecm_status 1
lwip_status 0 !!
USB_DeInit
ecm deinit ok
ecm deinit
UECM

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

[MEM] After do cmd, available heap 78114592



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
usbh_cdc_ecm_set_ethernet_packetfilter 28
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, hc_state=0
BULK in failed 3, hc_state=0
INTR in failed 3
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
INTR in failed 3

Interface 2 IP address : 192.168.1.44

write_fast_connect_data_to_flash():not the same ssid/passphrase/channel/offer_ip, write new profile to flash
[LwIP_DHCP] dhcp offered_t0_lease: 86400DHCP Successful
unlink to link !!
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
INTR in failed 3
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
INTR in failed 3
BULK in failed 3, hc_state=0
BULK in failed 3, hc_state=0
Lwip link down
link to unlink !!
USB_DeInit
ecm deinit ok
ecm deinit

Hi @k-adarsh,

May I know where do you purchase this QHM8106 USB LAN device? We would like to see if we can purchase to do some testing