Skip to main content
Associate II
September 24, 2025
Solved

STM32F7: Zephyr Ethernet errors after disconnecting and reconnecting ethernet cable

  • September 24, 2025
  • 8 replies
  • 691 views

I'm trying to disconnect a ethernet cable after flashing a code 
Then I'm getting 
[00:01:50.522,000] <err> net_tcp: net_send_data()
[00:01:52.200,000] <wrn> net_if: iface 1 is down
[00:01:52.200,000] <err> net_tcp: net_send_data()
[00:01:52.480,000] <wrn> net_if: iface 1 is down
[00:01:52.480,000] <err> net_tcp: net_send_data()
[00:01:52.900,000] <wrn> net_if: iface 1 is down
[00:01:52.900,000] <err> net_tcp: net_send_data()
[00:01:53.530,000] <wrn> net_if: iface 1 is down
[00:01:53.530,000] <err> net_tcp: net_send_data()
[00:01:54.475,000] <wrn> net_if: iface 1 is down
This is expected since trying to connect it back
When I reconnect ethernet cable 
Im getting an below error 
[00:01:54.475,000] <wrn> net_if: iface 1 is down
[00:01:54.475,000] <err> net_tcp: net_send_data()
[00:01:55.282,000] <inf> phy_mii: PHY (0) Link speed 100 Mb, full duplex
[00:01:56.212,000] <err> os: ***** USAGE FAULT *****
[00:01:56.212,000] <err> os: Illegal load of EXC_RETURN into PC
[00:01:56.212,000] <err> os: r0/a1: 0xaaaaaaaa r1/a2: 0xaaaaaaaa r2/a3: 0xaaaaaaaa
[00:01:56.212,000] <err> os: r3/a4: 0xaaaaaaaa r12/ip: 0xaaaaaaaa r14/lr: 0xaaaaaaaa
[00:01:56.212,000] <err> os: xpsr: 0xaaaaaa00
[00:01:56.212,000] <err> os: Faulting instruction address (r15/pc): 0xaaaaaaaa
[00:01:56.212,000] <err> os: >>> ZEPHYR FATAL ERROR 34: Unknown error on CPU 0
[00:01:56.212,000] <err> os: Current thread: 0x200233f8 (rx_q[0])
[00:01:56.307,000] <err> os: Halting system
The mcu is going halt what is the reason for this issue?
How to resolve this?

 


Best answer by Guillaume K

Hi

You didn't mention what precise STM32F7 and what HW board you are using.

Did you look for support at Zephyr OS project ?

They have Discord channel and mailing lists:

main@lists.zephyrproject.org | Subgroups

 

8 replies

mbarg.1
Senior III
September 24, 2025

which sw are you running ? Some example do not implement interface management, aka cable disconneciton

LCE
Principal II
September 24, 2025

Already checked the Zephyr ethernet source code?

These errors make sense, and as @mbarg.1 already said, some (dis-) connection management is required.

This means that the MCU periodically asks the PHY if it has some physical connection.

Ethernet Management — Zephyr Project Documentation

Not much there, but a starting point. Try to trace it back to find some periodic connection handler to the PHY.

Guillaume K
Guillaume KBest answer
ST Employee
September 25, 2025

Hi

You didn't mention what precise STM32F7 and what HW board you are using.

Did you look for support at Zephyr OS project ?

They have Discord channel and mailing lists:

main@lists.zephyrproject.org | Subgroups

 

Pavel A.
September 26, 2025

Hmm looks like a bogus return address in a function, due to thread stack corruption?

 

shreyas15Author
Associate II
September 30, 2025

@Pavel A. @Guillaume K @LCE @mbarg.1 
Im using STM32F767ZI board zephyr is supported 
I'm trying to handle the connection management through below api still Im facing same issue

#include <zephyr/net/net_mgmt.h>
#include <zephyr/net/net_event.h>
#include <zephyr/net/net_if.h>
net_mgmt_init_event_callback(&net_cb, link_event_handler,
NET_EVENT_L4_CONNECTED | NET_EVENT_L4_DISCONNECTED);
net_mgmt_add_event_callback(&net_cb);
But above callback is not called when network goes down.
 
mbarg.1
Senior III
September 30, 2025

As far as I can see ( looking at examples in libs), threre is no code (no thread ) monitoring link status - you have to add your code - that is why call back is never called.

Unless you are running somthing different or proprietary - in that case share it to get better advice.

Pavel A.
September 30, 2025

net_mgmt_init_event_callback(&net_cblink_event_handler,

And what do you do in your link_event_handler() ?

Note that the net_cb struct must be valid all the time while the callback is registered (it should be "static" etc. not on a function stack).

shreyas15Author
Associate II
July 9, 2026

@Guillaume K ​@Pavel A. ​@mbarg.1 
The error is resolved it's not an STM driver issue, I issue was with the zenoh-pico protocol which I was using in my application.
When network goes and comes back, zenoh was creating new thread to handle communication where old threads were not freed or cleared, so memory overflow was happening. That’s the reason I was facing above error.