Skip to main content
Visitor II
September 24, 2025
Question

STM32F7: Zephyr Ethernet errors after disconnecting and reconnecting ethernet cable

  • September 24, 2025
  • 5 replies
  • 601 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?

 


    This topic has been closed for replies.

    5 replies

    Graduate
    September 24, 2025

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

    Graduate 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.

    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

     

    Super User
    September 26, 2025

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

     

    shreyas15Author
    Visitor 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.
     
    Graduate
    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.

    Super User
    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).