Skip to main content
Visitor II
June 25, 2025
Question

STM32H723ZGT6 Ethernet only works when J-Link USB interface is connected to board

  • June 25, 2025
  • 6 replies
  • 992 views

We have developed a custom board based on an eval board that has a LoRa transceiver and an RFID tag reader connected to two UARTs of the MCU. A serial console is also connected to a third UART. DMA streams are configured for the LoRa and RFID UARTs, and for Ethernet. The software application uses FreeRTOS and has an Ethernet stack implemented using LwIP. The app responds to UDP commands received by the device, which trigger interactions with the LoRa or RFID devices.

The application works as expected when a USB J-Link JTAG interface is connected to the board, whether using the debugger, or just running. However, if the board is powered on without the USB J-Link attached, Ethernet does not work. The board does not receive any UDP packets or even respond to pings. The LEDs still flash, indicating that the main thread is still running.

Any suggestions?

 

    This topic has been closed for replies.

    6 replies

    CCPAuthor
    Visitor II
    June 26, 2025

    Just to clarify:

    board is powered on with JTAG connected and issue run command from STM32CubeIDEsoftware runs, ping works
    board is powered on with JTAG connected, no commandssoftware runs, no response to ping
    board is powered on with no JTAG connectedsoftware runs, no response to ping



    Graduate II
    June 27, 2025

    Dump RCC and ETH registers in the working / not working cases.

    Focus on clocks, clock sources, GPIOA, perhaps PB3 and BOOT0 pin state.

    CCPAuthor
    Visitor II
    July 7, 2025

    Hi, thanks for your suggestion.

    I dumped all RCC and ETH registers to a serial port for both cases, saved the outputs to files and diffed them.

    All RCC registers were identical.

    The only ETH register differences were the MDIO Address and Data registers (which had different address bits and different data), and the RX DMA buffer pointer register value. I think these differences could be expected, because in one case the Ethernet hardware has started from a cold boot, and in the other case, it was running previously to downloading and running the code.

    However, in both cases (working and not) the values in the RX DMA buffer are in the 0x2400xxxx range, whereas I created a region at 0x30000000 for the RX DMA descriptor in the linker description file. Is this expected?

    ST Employee
    June 27, 2025

    Hello @CCP,

    Thank you for your report.

    To help us further analyze the problem, could you please:

    • Compare the Ethernet peripheral and clock registers with and without the JTAG connected to identify any differences?
    • Verify that all clocks required for Ethernet operation are enabled regardless of the JTAG connection?

    The issue you are experiencing is most likely related to the activation of clocks and the initialization of the Ethernet PHY. The presence of the JTAG connection might be keeping the MCU in a state that facilitates proper Ethernet initialization.

    Any additional information would be very helpful for a deeper investigation.

     

    With Regards,

    CCPAuthor
    Visitor II
    July 11, 2025

    Using the same code as before (it was previously flashed to the board), I connected the J-Link USB to the laptop, and then powered the board on. The IDE was not running. From the serial terminal connected to the board, I could see that once the firmware configured the board, it received UDP packets from another system and sent responses. This continued, as long as the J-Link was connected to the laptop. As soon as I unplugged the J-Link's USB cable from the laptop, the board would no longer received UDP packets.

    If I plugged in the J-Link's USB connector again, the board would reset, the firmware would configure it again, and then it would receive UDP packets.

    It seems like Ethernet only works when the J-Link interface is physically connected to the board and the laptop.

    I guess I should confirm if any of the ETH or RCC registers change when the J-Link USB is unplugged. Suggestions?

    Visitor II
    July 12, 2025

    Are you using printf redirected to SWO? 

    CCPAuthor
    Visitor II
    July 14, 2025

    printf is directed to UART5, which provides a debug serial output whether the J-Link is connected or not.

    Technical Moderator
    July 16, 2025

    Hello @CCP

    Could you please attach your STM32CubeMX configuration file (.ioc) so I can review it? If the project is private, feel free to send it to me privately.

    Best regards,

    CCPAuthor
    Visitor II
    October 1, 2025

    Ethernet started working today with no J-Link connected. I've gone over my diffs, but I can't see any change that could be responsible. I backed out all the changes I made since my last attempt, when Ethernet did not work unless J-Link was connected.

    I disabled the Eth and RCC register dumps that run in the main thread's loop, and Ethernet stopped working. After enabling only the ETH register reads (no dump), Ethernet works. 

    Technical Moderator
    October 2, 2025

    Hello,

    That sounds unusual and quite unsatisfying. Aside from the files, have you made any changes to the PCB? Have you tried using other hardware for testing? Did you change or update the IDE to a newer version? Have you tried opening the project in a different working environment? Any small change could help us pinpoint the cause.

    Best regards,

    CCPAuthor
    Visitor II
    October 2, 2025

    Hi, no changes to PCB, no other hardware, no IDE changes, no environment change.

    I think I'll disable the ETH register dump and use my console messages to pinpoint where it fails - are there any ETH interrupts that indicate a DMA transfer should start, etc. I was previously looking only at what happened after a DMA completion and the received data was copied from the buffer, after the semaphore that hands over control to the Ethernet stack.

    Technical Moderator
    October 2, 2025

    Hello, the information you're looking for can be found in the Debug Status Register (ETH_DMADSR); it contains the status for both Tx and Rx DMA channels.