cancel
Showing results for 
Search instead for 
Did you mean: 

NUCLEO-G431 does not communicate on M5 Mac with a direct USB-C port connection

CTapp.1
Senior III

CubeProgrammer 2.22.0 under MacOS 26.4.1 is not able to connect to my NUCLEO-G431, with the log window showing:

ST-LINK error (DEV_CONNECT_ERR)

Strange thing is this only happens when I have a direct cable connection between the USB-C port on the Mac and the ST-LINK V3 USB on the board - it works as expected if I connect via a USB-C hub.

VS Code is also not able to connect to the board to run a debug session without the hub, so I suspect this is an ST-LINK USB driver issue on the Mac.

All posts are made in a personal capacity
MISRA C++ Chair
MISRA C WG Member
Director The MISRA Consortium Limited (TMCL)
1 ACCEPTED SOLUTION

Accepted Solutions
Kouthair
ST Employee

Hello there @CTapp.1 ,

This behavior appears to match the known issue reported in this FAQ: Possible communication failure between STLINK-V3 and some recent computers. The FAQ might help explain the root cause of this behavior and how to mitigate it, including one of the workarounds which you have already found.

Kind regards,
Kouthair

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

8 REPLIES 8
Pavel A.
Super User

 it works as expected if I connect via a USB-C hub.

Is the hub powered?

 

Xiaojie
Associate III
It also works abnormally on my Mac Studio (M4 Max) with STM32WBA65I-DK1

Whilst it does support PD, it does not need to be connected to external power for things to work (one wire to Mac, on to the board).

All posts are made in a personal capacity
MISRA C++ Chair
MISRA C WG Member
Director The MISRA Consortium Limited (TMCL)
Pavel A.
Super User

These devices work well with many Windows, Linux and Intel Mac hosts. The drivers are very thin - no dedicated kernel modules. So it looks unlikely that ST could "fix" anything in their drivers. Using a hub is a good workaround.

Of course, people that are motivated and have a type-C analyzer can debug and find the real cause of the connection failures.

 

I'm using the latest MacBook Pro M5, so it will soon be "one of the many" ;)

If there is a potential issue here that can't be fixed, it would be useful if that could be documented somewhere - it took me a couple of hours to find the workaround, and the diagnostic messages that were given didn't give any clues.

CubeProgrammer also appeared to connect to the probe at times (though in a non-functional way - just the serial number and target voltage shown), and even allowed the "firmware update" for the ST-LINK to be activated - though that failed with something like "bad firmware checksum". Sounds like USB packet loss, but that's just a guess.

All posts are made in a personal capacity
MISRA C++ Chair
MISRA C WG Member
Director The MISRA Consortium Limited (TMCL)
Kouthair
ST Employee

Hello there @CTapp.1 ,

This behavior appears to match the known issue reported in this FAQ: Possible communication failure between STLINK-V3 and some recent computers. The FAQ might help explain the root cause of this behavior and how to mitigate it, including one of the workarounds which you have already found.

Kind regards,
Kouthair

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
Andrew Neil
Super User

@CTapp.1 wrote:

it works as expected if I connect via a USB-C hub.


Checking with/without a hub is, indeed, one of the recommended steps in dealing with ST-Link comms issues:

https://community.st.com/t5/stm32-mcus/how-to-solve-debugger-connection-issues/ta-p/49693#:~:text=If%20connecting%20via%20a%20hub%2C%20try%20without%20it%3B%20if%20connecting%20without%20a%20hub%2C%20try%20with%20one

 

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
Pavel A.
Super User

Type-C connectors on these thin laptops are too overloaded: they carry USB and Thunderbolt video and smart power functions, maybe also something Apple proprietary. Hubs help to untangle this complexity. Without a good analyzer it's hard to tell more. Better treat this as Somebody Else's problem.