cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE not flashing my board anymore

Pkemarco
Associate II

Hello everyone,

I'm currently facing an issue with STM32CubeIDE when trying to flash our board.

It wasn't like this before and nothing special really change in the project configuration but now when I try to run the code I get this :

 

STMicroelectronics ST-LINK GDB server. Version 7.8.0
Copyright (c) 2024, STMicroelectronics. All rights reserved.

Starting server with the following options:
        Persistent Mode            : Disabled
        LogFile Name               : ..\STM32CubeIDE\Debug\st-link_gdbserver_log.txt
        Logging Level              : 31
        Listen Port Number         : 61234
        Status Refresh Delay       : 15s
        Verbose Mode               : Enabled
        SWD Debug                  : Enabled

COM frequency = 4000 kHz
Target connection mode: Attach
Reading ROM table for AP 0 @0xe00fefd0
Hardware watchpoint supported by the target 
ST-LINK Firmware version : V2J45S7
Device ID: 0x472
PC: 0x7afb70
ST-LINK device status: LOCKUP
Enter STM32_SystemReset() function 
ST-LINK detects target voltage = 1.71 V
TrustZone: Inactive
Device in lock up state, possibly "read and debug" protected. Use monitor commands to remove the protection
ST-LINK device initialization OK
Stm32Device, pollAndNotify running...
ST-LINK device status: HALT_MODE
SwvSrv state change: 0 -> 1
Waiting for debugger connection...
Waiting for connection on port 61234...
Waiting for connection on port 61235...
Accepted connection on port 61234...
Debugger connected
Waiting for debugger connection...
Waiting for connection on port 61234...
GDB session thread running
GdbSessionManager, session started: 1
Accepted connection on port 61234...
Debugger connected
Waiting for debugger connection...
Waiting for connection on port 61234...
GDB session thread running
GdbSessionManager, session started: 2
Enter STM32_SystemReset() function 
Enter STM32_InitAfterReset() function 
NVIC_DFSR_REG = 0x00000009
NVIC_CFGFSR_REG = 0x00000000
GDB session, device event: 3
GDB session, device event: 3
GDB session, device event: 1
GDB session, device event: 1
GDB session terminated: Client connection lost
GdbSessionManager, session terminated: 2
Received Ctrl-C from the client 
ST-LINK device status: LOCKUP
Enter STM32_SystemReset() function 
ST-LINK device status: LOCKUP
Enter STM32_SystemReset() function 
GDB session, device event: 2
Device not halted(-2146893825), performing Ctrl-C
GDB session, device event: 4
Device halted
Cleanup session: 2
GDB session disposed: 2
GDB session terminated: Client connection lost
GdbSessionManager, session terminated: 1
GdbSrv, last session terminated, signal dispose
Stopping port 61234
Received stop for port 61234, not accepting new connections.
GdbSrv, deInit entry.
Shutting down...
GdbSessionManager, deInit entry.
Stopping port 61234
Stm32Device, pollAndNotify stopped
GDB session disposed: 1
GdbSessionManager, deInit exit
SwvSrv deInit entry
Stopping port 61235
Received stop for port 61235, not accepting new connections.
SwvSrv deInit exit
Stm32Device, closeDevice() entry
Stm32Device, closeDevice() exit
Stm32Device, deInit success
GdbSrv, deInit exit.
Exit.

 

I tried to reinstall the IDE but the same issue remains. I even tried to use OpenOCD but still the same problem.

I also tried to change the St-link but nothing changes. The STM32CubeProgrammer works perfectly by the way.

At the end, I tried to delete all debug and release configurations and to create a new one but still the same.

And because of this, I can't work properly anymore. So I don't really know what to do now.

Do you have any clue ? Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Pkemarco
Associate II

The problem has been solved. Here is the procedure :

  • close cubeide
  • install version 1.15
  • replace the FlashLoader folder of 1.16 ("C:\ST\STM32CubeIDE_1.16.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.1.400.202404281720\tools\bin\FlashLoader") with that of 1.15 ("C:\ST\STM32CubeIDE_1.15.1\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.1.201.202404072231\tools\bin\FlashLoader")
  • and it's done.

The procedure is the same for the 1.16.1. I don't know why this folder is always corrupted.

View solution in original post

8 REPLIES 8
Andrew Neil
Evangelist III
Device in lock up state, possibly "read and debug" protected. 
Use monitor commands to remove the protection

So did you try that?

I checked and there is currently no enabled protection on the chip.

I can read and write the chip memory with the STM32CubeProgrammer and I even erased the chip but still the same problem.

TDK
Guru

Is this a custom board? Does your board go into low power states? If you do a full erase in STM32CubeProgrammer, does the next try at programming in STM32CubeIDE produce different results?

> ST-LINK detects target voltage = 1.71 V

Seems awfully low. Is that expected?

If you feel a post has answered your question, please click "Accept as Solution".

Hello,

Yes it is a custom board and the flashing was working perfectly until recently. I'm the only one facing this issue.

The board is working at 1.8V so the 1.71 is expected for us.

Capture d’écran 2024-08-06 135108.jpg

> The board is working at 1.8V so the 1.71 is expected for us.

Now it says 1.70 V. Big difference between that and 1.8 V, given that the reset threshold is around 1.7 V. Any way to increase that to see if problems go away?

You didn't answer my other two questions.

If you feel a post has answered your question, please click "Accept as Solution".

Hello,

I can't increase that but even like this I can communicate and manage the device through the STM32CubePorgrammer without any issue and I has always been like this with it.

I tried to go back on the 1.15.1 version but same issue. I also tried a empty project, but still the same.

I tried to change the firewall parameters and even reinstall everything but still the same issue.

Pkemarco
Associate II

The problem has been solved. Here is the procedure :

  • close cubeide
  • install version 1.15
  • replace the FlashLoader folder of 1.16 ("C:\ST\STM32CubeIDE_1.16.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.1.400.202404281720\tools\bin\FlashLoader") with that of 1.15 ("C:\ST\STM32CubeIDE_1.15.1\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.1.201.202404072231\tools\bin\FlashLoader")
  • and it's done.

The procedure is the same for the 1.16.1. I don't know why this folder is always corrupted.