Search code examples
stm32nucleost-link

st-link doesn't detect nucleo stlink


I am using NUCLEO-F446RE on M3 MacBook Pro (with terminal in x86 architecture - so, terminal software is x86). Though the board shows up in USB device tree in "System Information", it can't be detected either by st-link (v1.8.0) or STM32CubeProgrammer (STM32CubeProgrammer API v2.18.0 | MacOS-64Bits).

I know that st-link has removed Mac support from v1.7.1 onwards. Still that was the version that home-brew allowed me to install. The issue still seems to happen in STM32CubeProgrammer. So, something seems off here. The board is new out of the box. This is the first time I am trying to connect to it.

USB Device Tree Output:

STM32 STLink (I have redacted the serial number from the output):

Product ID: 0x374b
Vendor ID:  0x0483  (STMicroelectronics)
Version:    1.00
Serial Number:  <some serial number>
Manufacturer:   STMicroelectronics
Location ID:    0x02100000

Perhaps the issue is that the device doesn't somehow map to tty? I don't see any /dev/tty.usb* devices.

Will appreciate help with how to resolve this.


Solution

  • The problem is that MacBook usb-c is not supply enough power to turn on the STM32 MCU. Only STM link turns on, and shows up in USB list. Since the processor is not turned on, it can't be detected.

    The solution will be to probably connect it to a dock, or provide a separate power supply to turn it on (the green LED will blink when it turns on).

    Update Confirmed that it now connects after enough power was supplied via E5V (and gnd pin next to it). I can now connect via st-util:

    st-util 1.8.0
    2024-12-02T20:58:17 INFO common.c: STM32F446:     128 KiB SRAM, 512 KiB flash in at least 128 KiB pages.
    2024-12-02T20:58:17 INFO gdb-server.c:     Listening at *:4242...
    

    And these are the instructions from STM manual that I followed to figure out and fix the issue. enter image description here


    USB Power Steps From The Manual

    Please note the 300ma current requirement during USB enumeration before the mcu will be turned on. That part likely failed in the macbook. This seemed to result in only st-link USB connection being visible but no microcontroller being detected. Until the issue was fixed as described above.

    enter image description here