cancel
Showing results for 
Search instead for 
Did you mean: 

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

QRich.1
Associate

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

3 REPLIES 3
TDK
Guru

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".

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 Venmo
Up vote any posts that you find helpful, it shows what's working..
QRich.1
Associate

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