zephyr: STM32 USB: netusb: kernel crash when testing example echo_server with nucleo_f412zg (ECM on Windows)

I have configured board with this command cmake -GNinja -DBOARD=nucleo_f412zg -DOVERLAY_CONFIG=overlay-netusb.conf ..

when i boot up kernel crashed.

uart:~$ ***** Booting Zephyr OS v1.14.0-rc1-348-gcda3fad5c8 *****
[00:00:00.059,036] <inf> usb_net: netusb initialized
uart:~$ [00:00:00.059,210] <err> usb_net: interface disabled
uart:~$ [00:00:00.059,380] <err> usb_net: interface disabled
uart:~$ [00:00:00.059,532] <err> usb_net: interface disabled
uart:~$ [00:00:00.059,684] <err> usb_net: interface disabled
uart:~$ [00:00:00.064,681] <inf> net_config: Initializing network
uart:~$ [00:00:00.064,716] <inf> net_config: IPv4 address: 192.0.2.1
uart:~$ [00:00:00.064,918] <err> usb_net: interface disabled
uart:~$ [00:00:00.065,077] <err> usb_net: interface disabled
uart:~$ [00:00:00.160,084] <inf> net_config: IPv6 address: fe80::200:5eff:fe00:5300
uart:~$ uart:~$ [00:00:00.166,094] <inf> net_config: IPv6 address: fe80::200:5eff:fe00:5300

***** USAGE FAULT *****
  Division by zero
***** Hardware exception *****
Current thread ID = 0x20003620
Faulting instruction address = 0x80027d4
Fatal fault in ISR! Spinning...

so anyone have met this issue?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 24 (1 by maintainers)

Commits related to this issue

Most upvoted comments

Could you try enabling USB_DEVICE_OS_DESC, it should install Windows drivers automatically.

@finikorg I enabled it but Windows drivers didn’t install automatically.

I think you need to remove old drivers associated with this VID/PID, you can change that pair.

I changed VID/PID pair and “Remote NDIS Compatible device” driver installed automatically.

Hi @Jeepgoing,

On windows, I had to edit overlay-netusb.conf and change CONFIG_USB_DEVICE_NETWORK_ECM=y to CONFIG_USB_DEVICE_NETWORK_RNDIS=y.

Then I run:

$ cmake -DBOARD=96b_carbon -DOVERLAY_CONFIG=overlay-netusb.conf ../zephyr/samples/net/sockets/echo_server
$ make flash

I connected the device to Windows machine. A new Unknown device showed up in Device Manager. I chose to update drivers with the option Pick from a list and then selected ‘Network Adapters’ -> ‘Microsoft Corp’ -> ‘Remote NDIS Compatible device’.

New adapter showed up in network interfaces.