cancel
Showing results for 
Search instead for 
Did you mean: 

Debugger connection lost. Shutting down... monitor flash mass_erase didnt help

TKebi.1
Associate II

Hello,

Im just starting with the nucleo board STM32L476RG using mac (10.13.6) and cube IDE 1.6.1. I also updated the firmware on the ST-link to the newest one when prompted.

For the very first program I just wanted to make it blink to see if it works, so I created a project according to the tutorials, added:

HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_5);

  HAL_Delay(1000);

to the while (1) loop (user code begin 3) in the main and set LD2 pin as output in the pinout view.

Building is without a problem:

12:11:40 **** Incremental Build of configuration Debug for project first_blinking_LED ****

make -j3 all 

arm-none-eabi-size  first_blinking_LED.elf 

  text  data   bss   dec   hex filename

 12036   20  1700  13756  35bc first_blinking_LED.elf

Finished building: default.size.stdout

12:11:41 Build Finished. 0 errors, 0 warnings. (took 221ms)

But when I hit Run main I get (onboard LD1 blinking red and green):

STMicroelectronics ST-LINK GDB server. Version 5.8.0

Copyright (c) 2020, STMicroelectronics. All rights reserved.

Starting server with the following options:

    Persistent Mode      : Disabled

    Logging Level       : 1

    Listen Port Number     : 61234

    Status Refresh Delay    : 15s

    Verbose Mode        : Disabled

    SWD Debug         : Enabled

    InitWhile         : Enabled

Waiting for debugger connection...

Debugger connected

Debugger connection lost.

Shutting down...

I tried adding "monitor flash mass_erase" to the initialization commands, but it didnt help. Also what is really strange, every time I try to Run or Debug, I have aprox. 1,28 GB less free space on my HDD! And I cant find from where this space was taken as neither the repository, neither the workspace_1.6.1 folder, neither the app increased in size.

Anny suggestions on how to get it unstucked? Would be much appreciated. Thanks

12 REPLIES 12
TKebi.1
Associate II

Hi,

no just this one

LaurentL
ST Employee

OK, thanks for the answer, can help some other that have similar issue.

Don't understand why activating STlink shared mode solved the issue.

Can you set the post as best answer for other to see directly the trick.

TKebi.1
Associate II

Sure, @mattias norlander​ , @LaurentL​ thanks a lot for advices