2025-06-25 3:37 PM
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?
2025-06-26 4:36 PM
Just to clarify:
board is powered on with JTAG connected and issue run command from STM32CubeIDE | software runs, ping works |
board is powered on with JTAG connected, no commands | software runs, no response to ping |
board is powered on with no JTAG connected | software runs, no response to ping |
2025-06-26 8:21 PM
Dump RCC and ETH registers in the working / not working cases.
Focus on clocks, clock sources, GPIOA, perhaps PB3 and BOOT0 pin state.
2025-06-27 6:15 AM
Hello @CCP,
Thank you for your report.
To help us further analyze the problem, could you please:
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,
2025-07-07 11:56 AM
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?
2025-07-11 4:29 PM
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?
2025-07-11 11:48 PM
Are you using printf redirected to SWO?
2025-07-14 9:56 AM
printf is directed to UART5, which provides a debug serial output whether the J-Link is connected or not.
2025-07-14 10:02 AM
I changed the code to dump the RCC and Eth registers each time in the thread's loop, instead of just during initialization. Initial testing shows that the Eth registers do not change when the J-Link's USB is unplugged from the laptop and the jtag header is unplugged from the board.
I should clarify - I didn't realize it, but the code actually stops executing when only the J-Link's USB is unplugged - at least the thread that is acting as the main loop. Execution seems to continue if I also unplug the jtag header from the board with power applied.
I need to repeat this test to confirm that the RCC registers also do not change.
2025-07-16 1:00 AM
Look at the reset pin, i have some thought that if you unplug the usb the JLINK keep the reset line issued.
That's probably why if you remove the jtag header , everything works.
D.