2025-04-11 4:28 AM
Hi all!
First time poster.
I'm working on a prototype that utilizes a Nucleo-G474RE to move some motors and read some sensors. The design is working great and my code is running as it should. However, recently I've been having some issues with the virtual COM-port on my Nucleo board. Whenever I program the device, it works perfectly.
When I unplug and replug the USB however, my serial connection doesn't respond in any way. This is true even when I plug in a completely fresh Nucleo directly to my PC, powered by 5V_STLK, no peripherals. The status LEDs on the device do function as expected, but no messages are received or transmitted.
Plugging in and then resetting the micro or removing and replacing JP6 fixes the issue, making the serial work again.
There has been a firmware update to the ST-Link 3 that's built in, and we made some minor changes to the code, but even rolling back to a known working version of our firmware does not help. I want to share our source, but it's for a customer, so I don't think I can.
Things I've tried:
The issue exists in Windows as well Linux (in a VM), using terminal, putty and arduino IDE serial monitor.
I'm kind of starting to think the issue is with the ST-link firmware. I would love some help. My embedded engineer has given up and tells me to resort to manually resetting or reflashing the micro every time we need to use the machine, but that's unsatisfying to me.
Best wishes,
Thomas
2025-04-11 4:48 AM
@twjdeboer wrote:When I unplug and replug the USB however, my serial connection doesn't respond in any way.
Please give more details on that:
@twjdeboer wrote:Plugging in and then resetting the micro or removing and replacing JP6 fixes the issue, making the serial work again.
JP6 is the IDD link - so power-cycling the Target chip.
What JP5 settings are you using?
2025-04-11 5:07 AM
Thanks, I appreciate it!
2025-04-11 5:08 AM
Get the chip into the "bad" state, then attach a debugger and see where the code is at. Create a new debug configuration to do this which does not reset the chip or download the program.
2025-04-11 5:45 AM
I'n not quite sure how to attach the debugger without also reflashing. If I uncheck 'download' from the startup tab in the debugger configuration, I cannot connect to the ST-link it seems. The console shows the following:
Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
InitWhile : Enabled
Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
2025-04-11 6:12 AM
We've switched the LPUART1 to UART1 and are checking with an external UART to USB interface. Everything is working as it should, indicating an issue with the initialization of the ST-LINK portion of the NUCLEO board.
2025-04-11 6:18 AM
Yes, setting 'Download' to false on the 'Startup' tab should do it.
You'd also want to disable the reset on connecting:
Does your code go into low-power mode, and/or reconfigure the SWD pins?
2025-04-11 6:21 AM
Well, you changed two things - so it could be either the ST-Link or something to do with LPUART1 ...
2025-04-11 6:30 AM
We are using Free RTOS, but we're not using any of the low power modes in there. We're also not reconfiguring any of the SWD pins as far as I know.
2025-04-11 6:39 AM
Do you get the same issue without FreeRTOS ?