Skip to main content
Explorer II
December 5, 2021
Solved

STM32CubeIDE + NUCLEO-STM32G4 : can't program FLASH. Is this related to STLINK-V3?

  • December 5, 2021
  • 5 replies
  • 4220 views

I am trying to carry out a project with a NUCLEO-STM32G431 board.

With STM32CubeProgrammer I can program the MCU without problem.

But with STLM32CubeIDE I cannot program the flash.

STM32CubeIDE 1.8 freshly installed (as I could not achieve anything I reinstalled everything).

I create a new project: File / New / STM32 project ...

Without touching anything I compile it without problem. Then I try Debug, which creates the debug configuration and runs it.

(during the first tests the software of the STLINK-V3 was updated)

I get the message:

Error in final launch sequence:
 
Failed to execute MI command:
target remote localhost:61234
 
Error message from debugger back end:
localhost:61234: Le système a tenté de joindre un lecteur à un répertoire stocké sur un lecteur joint.
Failed to execute MI command:
target remote localhost:61234
 
Error message from debugger back end:
localhost:61234: Le système a tenté de joindre un lecteur à un répertoire stocké sur un lecteur joint.
localhost:61234: Le système a tenté de joindre un lecteur à un répertoire stocké sur un lecteur joint.

The debugger log file:

[0.000] initConfigParams(): Configuration flags start
[0.000] initConfigParams(): external-init false
[0.000] initConfigParams(): pend-halt-timeout (null)
[0.000] initConfigParams(): halt false
[0.000] initConfigParams(): config-file ""
[0.000] initConfigParams(): persistent false
[0.001] initConfigParams(): +log-file "G:\STM32_CubeIDE\AdAstraCubeWs\G431\Debug\st-link_gdbserver_log.txt"
[0.001] initConfigParams(): +log-level 31
[0.001] initConfigParams(): +port-number 61234
[0.001] initConfigParams(): +verbose true
[0.001] initConfigParams(): refresh-delay 15
[0.001] initConfigParams(): +verify true
[0.001] initConfigParams(): +swd true
[0.001] initConfigParams(): swo-port 61234
[0.001] initConfigParams(): cpu-clock 8000000
[0.001] initConfigParams(): swo-clock-div 128
[0.001] initConfigParams(): +initialize-reset true
[0.001] initConfigParams(): debuggers false
[0.001] initConfigParams(): serial-number ""
[0.001] initConfigParams(): +apid 0
[0.001] initConfigParams(): attach false
[0.001] initConfigParams(): shared false
[0.001] initConfigParams(): erase-all false
[0.001] initConfigParams(): memory-map ""
[0.001] initConfigParams(): ext-memory-loaders false
[0.001] initConfigParams(): extload ""
[0.001] initConfigParams(): +stm32cubeprogrammer-path "C:\ST\STM32CubeIDE_1.8.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.0.100.202110141430\tools\bin"
[0.001] initConfigParams(): temp-path ""
[0.001] initConfigParams(): preserve-temps false
[0.001] initConfigParams(): frequency -1
[0.001] initConfigParams(): licenses false
[0.001] initConfigParams(): ignore-rest false
[0.001] initConfigParams(): version false
[0.001] initConfigParams(): help false
[0.001] initConfigParams(): Configuration flags end
[0.003] init(): STMicroelectronics ST-LINK GDB server. Version 6.0.0
Copyright (c) 2021, STMicroelectronics. All rights reserved.
[0.019] openDevice(): COM frequency = 24000 kHz
[0.019] openDevice(): Target connection mode: Under reset
[0.030] readFromTarget(): Reading ROM table for AP 0 @0xe00fffd0
[0.034] reset_hw_wtchpt_module(): Hardware watchpoint supported by the target 
[0.038] initContext(): ST-LINK Firmware version : V3J9M3
[0.039] initContext(): Device ID: 0x468
[0.039] initContext(): PC: 0x800022c
[0.040] Device_GetStatus(): ST-LINK device status: HALT_MODE
[0.041] initContext(): ST-LINK detects target voltage = 3.30 V
[0.041] initContext(): ST-LINK device status: HALT_MODE
[0.042] initServerContext(): ST-LINK device initialization OK
[0.042] pollAndNotifyRun(): Stm32Device, pollAndNotify running...
[0.046] updateState(): SwvSrv state change: 0 -> 1
[0.046] WaitConnection(): Waiting for connection on port 61234...
[0.046] WaitConnection(): Waiting for connection on port 61235...
[18.354] WaitConnection(): Accepted connection on port 61234...
[18.355] WaitConnection(): Waiting for connection on port 61234...
[18.355] run(): GDB session thread running
[18.355] handleSessionEvent(): GdbSessionManager, session started: 1
[18.356] run(): GDB session terminated: Client connection lost
[18.356] handleSessionEvent(): GdbSessionManager, session terminated: 1
[18.356] handleSessionEvent(): GdbSrv, master session terminated, signal dispose
[18.356] stop(): Stopping port 61234
[18.386] cleanup(): Cleanup session: 1
[18.386] ~GdbSession(): GDB session disposed: 1
[18.464] WaitConnection(): Received stop for port 61234, not accepting new connections.
[18.464] deInit(): GdbSrv, deInit entry.
[18.464] deInit(): GdbSessionManager, deInit entry.
[18.496] deInit(): GdbSessionManager, deInit exit
[18.496] deInit(): SwvSrv deInit entry
[18.496] stop(): Stopping port 61235
[18.497] stop(): Stopping port 61234
[18.604] WaitConnection(): Received stop for port 61235, not accepting new connections.
[18.604] deInit(): SwvSrv deInit exit
[18.604] closeDevice(): Stm32Device, closeDevice() entry
[18.711] pollAndNotifyRun(): Stm32Device, pollAndNotify stopped
[18.719] closeDevice(): Stm32Device, closeDevice() exit
[18.719] deInit(): Stm32Device, deInit success
[18.719] deInit(): GdbSrv, deInit exit.

Same thing with NUCLEO-STM32G491

My other NUCLEO boards with STLINK-V2-1 have no problem

With TrueSTUDIO it's even more curious:

With NUCLEO-STM32G431 no problem

With NUCLEO-STM32G491 the FLASH is not programmed, but I can debug the program flashed by STM32CubeProgrammer !!!!

See joined TrueSTUDIO debugger log files

Has anyone had this problem or can suggest a solution?

Thank you

    This topic has been closed for replies.
    Best answer by Nikita91

    CubeIDE problem solved with the help of ST support. Thank you.

    The fault comes from my Avast antivirus which detected false positives, and put files in quarantine. As notifications were disabled, it was done silently, and therefore CubeIDE behaved abnormally.

    The lesson to be learned: enable antivirus notifications before installing software!

    For the problem of TrueSTUDIO with the NUCLEO-G491RE board:

    The STM32_Programmer_CLI.exe inside TrueSTUDIO is too old (V1.3).

    I updated STM32_Programmer_CLI.exe to V2.10 in TrueSTUDIO and now I can flash G491!

    5 replies

    Graduate II
    December 7, 2021

    The Stlinkv3 is know to be picky when connecting. Connect under reset will probably work.

    Nikita91Author
    Explorer II
    December 8, 2021

    I have already tried all the "Reset behaviour" options

    Thank you

    Visitor II
    December 8, 2021

    Hi,

    in the meantime there are some more reports about problems during programming the devices. I have several STM32 µC in use and I assume the problem is in the area STLinkv3 together with STM32CubeIDE 1.8 (better say STLink GDB Server 6.0.0). Try to go back to STM32CubeIDE 1.7. With 1.7 you get the STLink GDBServer 5.9.1. This solved the problems on my side (STM32L5 discovery board).

    Best Regards

    Markus

    Nikita91Author
    Explorer II
    December 8, 2021

    No chance. I had version 1.3 which didn't work so I went straight to the newer one. Big mistake...

    It's not easy to port a project to a previous version, but I'll try.

    This does not explain why TrueSTUDIO works with the NUCLEO-STM32G431 and not with the NUCLEO-STM32G491 ...

    Thank you

    Nikita91Author
    Explorer II
    December 8, 2021

    No luck. Same behavior with IDE 1.7 and G491 and G431

    ST Employee
    March 8, 2022

    I shared an update today in thread:

    https://community.st.com/s/question/0D53W00001EywtESAR/stm32cube-ide-v18-not-be-able-to-download-to-discovery-l5-board-anymore

    Maybe the same tests can be applied to this issue?

    Please share your findings!

    Nikita91AuthorAnswer
    Explorer II
    March 9, 2022

    CubeIDE problem solved with the help of ST support. Thank you.

    The fault comes from my Avast antivirus which detected false positives, and put files in quarantine. As notifications were disabled, it was done silently, and therefore CubeIDE behaved abnormally.

    The lesson to be learned: enable antivirus notifications before installing software!

    For the problem of TrueSTUDIO with the NUCLEO-G491RE board:

    The STM32_Programmer_CLI.exe inside TrueSTUDIO is too old (V1.3).

    I updated STM32_Programmer_CLI.exe to V2.10 in TrueSTUDIO and now I can flash G491!