Skip to main content
Visitor II
March 16, 2025
Question

Bootloader over UART with Nucleo-64 Board(MB1136) - No response?

  • March 16, 2025
  • 2 replies
  • 1210 views

Hi all,

I recently purchased a Nucleo-64 board with a STM32F401 and started programming it, while doing so, I accidentally re-configured PA14 & PA13 used for SWD and used by the ST-Link to program the MCU to be GPIO pins. To fix this, I thought of re-flashing the MCU with updated firmware where SWD is enabled again over UART. I tried this by pulling BOOT0 high, a USB-Serial adapter on PA10 & PA9, and doing a power cycle on the board. The USB connection is exposed as COM11 on Windows, so I tried to connect to it using CubeProgrammer but got the following error:
"Error: Activating device: KO".

I have set the baud rate to 115200, parity to even and the stop bit to 1 - But no dice. I then tried to use Realterm to send raw HEX (0x7F) to the MCU but got no response. I figured the issue might be my USB-Serial adapter, but a simple loopback test proved the adapter to be working. Worth pointing out, maybe, is that my adapter is 5V - But my MCU's datasheet states that PA10 & PA9 are FT so 5V tolerant, so that shouldn't be an issue if I'm not mistaken.

Am I missing something?

Thanks!

    This topic has been closed for replies.

    2 replies

    Graduate II
    March 16, 2025

    Pulling BOOT0 HIGH should be sufficient to stop your code running, to the point where the ST-LINK connection should be able to erase the part, unless there's an electrical issue. So via the SWD connection, or drag-n-drop of a binary to the USB MSC

    gflyerAuthor
    Visitor II
    March 16, 2025

    I have pulled BOOT0 high and connected the board to my PC through the micro USB connector on the ST-Link part of the board as you said, but it still fails to connect:

    19:38:08 : UR connection mode is defined with the HWrst reset mode
    19:38:09 : ST-LINK SN : 0672FF333041383043202759
    19:38:09 : ST-LINK FW : V2J46M31
    19:38:09 : Board : NUCLEO-F401RE
    19:38:09 : Voltage : 3.26V
    19:38:09 : Error: Unable to get core ID
    19:38:09 : Error: No STM32 target found! If your product embeds Debug Authentication, please perform a discovery using Debug Authentication

    I believe this approach wouldn't work if I disabled SWD on my firmware - Or is it that SWD gets re-enabled when using the built-in bootloader? If it is the latter, I think my board has some electrical problems I have to look into, but I hope not :).

    Graduate II
    March 16, 2025

    Check the jumper pair (CN2) on the NUCLEO, that connect the SWDIO/SWCLK pins to the local target (F401)

    Make sure the board is not on a conductive surface (foam or mat)

    Super User
    March 16, 2025

    With USB already connected and CN2 jumpers in place, wire BOOT0 to 3V3, then press and release the (black) reset button, and connect over STM32CubeProgrammer over SWD as normal.

    If that doesn't work, chip is damaged or there is some other miswiring configuration.

    Is LD1 red immediately after plugging in USB? If not something is likely wrong.

    gflyerAuthor
    Visitor II
    March 17, 2025

    LD1 is red after plugging in the USB, and the board gets power through the USB. I have wired BOOT0 to VDD and pressed the reset button, then tried to connect over SWD in CubeProgrammer but still "no STM32 target found". There is no other wiring setup on the board other than BOOT0 to VDD. I also tried wiring BOOT0 to 3V3, but same result.

    This problem only occurred after I re-assigned PA14 & PA13 and disabled SWD through CubeIDE, and then flashed the chip (on accident). 

    The Hardware Layout for my Nucleo board also states that ST-Link is only available over SWD. Could it be that the system bootloader doesn't actually start SWD? 

     

    swd nucleo.png

    In AN2606 I don't see any mention of SWD being available in sys bootloader:

    Screenshot 2025-03-17 182043.png

    If useful, here is my setup:
    IMG_1716.jpg

     

     

    Thanks in advance for any insight!!

    Super User
    March 17, 2025

    > LD1 on the ST-Link part of the board is green.

    At what point does the LED turn green? That would indicate it is connected.

     

    Could it be that the system bootloader doesn't actually start SWD? 

    No, SWD is part of the cortex core, not the bootloader. The only way to disable it would be to set RDP 2.