Skip to main content
QRich.1
Associate
June 4, 2020
Question

Loose connection to the STM32 of a hoverboard after a first launch of an empty program

  • June 4, 2020
  • 3 replies
  • 1364 views

Hi,

I try to flash an hoverboard MCU but after the first launch, it is impossible to connect again to the MCU. It is like it was damaged :'(

Steps:

  • I put the board under battery
  • I connect the ST-Link to the 4 pin
  • I connect the ST-Link to the usb
  • I Connect with ST-Link Utility -> It works !
  • I Create an empty project in STM32CubeIDE with the correct .ld
  • I build and run
  • I loose the connection forever, even on the IDE or the Utility

The MCU is a STM32F103RCT6 the project is configured with stm32f103rctx_flash.ld

It is the second board I fail, I am totally stuck.

Thanks for any help

This topic has been closed for replies.

3 replies

TDK
Super User
June 4, 2020

Are you reassigning the SWDIO/SWDCLK pins? This will prevent ST-Link from being able to connect when your program is running.

If you hold the chip in reset (NRST low), it should be possible to connect with ST-Link.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Tesla DeLorean
Guru
June 4, 2020

Pulling BOOT0 HIGH will block flash code running, allowing you to recover.

Check your build for entering low power mode, or actively supressing/disabling the debug pins.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
QRich.1
QRich.1Author
Associate
June 5, 2020

Victory !!

I succeed to connect to my board in the mode "Connect under target" with putting NRST to low and high.

I erase the memory and now I could connect in mode "Normal".

I guess it was the call to the function __HAL_AFIO_REMAP_SWJ_DISABLE() in HAL_MspInit() but why call this function in the blank program of STM32CubeIDE ?

Thanks a lot