2023-09-30 11:44 AM
Hi! I'm trying to flash a STM32L422KBT6 with STM32CubeIDE 1.13.2 and ST-LINK V2 and I keep getting this error:
Error: failed to erase memory
Encountered Error when opening C:\ST\STM32CubeIDE_1.13.2\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.1.0.202305091550\tools\bin\STM32_Programmer_CLI.exe
Error in STM32CubeProgrammer
Shutting down...
Exit.
How can I solve it?
2023-10-01 12:10 AM
Delete your debug and run configurations (note any non default settings if made) and create new one.
2023-10-01 12:18 AM
Based on the error message you're seeing, it seems like there might be an issue with the STM32CubeProgrammer. Here are a few steps you can try to resolve this:
If you're still encountering issues, it might be helpful to enable verbose logging in STM32CubeProgrammer to get more detailed error messages. This can be done by activating verbose 3 in the settings.
Remember to check the path to your STM32_Programmer_CLI.exe file. The error message indicates that there might be an issue opening this file, so make sure the path is correct and the file is accessible.
Lastly, ensure that your STM32L422KBT6 MCU is compatible with the version of STM32CubeIDE you're using. You can check this in the MCU/MPU Selector on the STMicroelectronics website.
2023-10-01 10:44 AM
Genuine programmer or a fake one? There should be more to the log above the "Error: failed to erase memory" line which would indicate where exactly in the process it is failing.
2023-10-03 07:01 PM
I'm getting the same problem, although on Linux, trying to flash a STM32H743VIT6
-------------------------------------------------------------------
STM32CubeProgrammer v2.14.0
-------------------------------------------------------------------
Log output file: /tmp/STM32CubeProgrammer_pqbbR9.log
ST-LINK SN : 54FF6D064982515710391287
ST-LINK FW : V2J42S7
Board : --
Voltage : 3.22V
Error: ST-LINK error (DEV_TARGET_RESET_ERR)
Encountered Error when opening /opt/st/stm32cubeide_1.13.2/plugins/com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.linux64_2.1.0.202305091550/tools/bin/STM32_Programmer_CLI
Error in STM32CubeProgrammer
Shutting down...
Exit.
I would show you the content of /tmp/STM32CubeProgrammer_pqbbR9.log but it does not exist !!
The file metioned as causing the error (STM32_Programmer_CLI) does exist and is readable by my user account.
I was using this ST-Link just fine with CubeIDE 1.12.1 until a few minutes ago, when the IDE forced me to update the firmware after installing CubeIDE 1.13.1
2023-10-04 04:25 AM
The problem was SystemClock_Config() not working properly above certain clock speeds, causing the ST-Link to lose connection when the debug port didn't respond. I'll start a different thread for that. Almost a whole day spent and I'm only just getting an LED to blink.... ugh.
2023-10-04 07:49 AM
> The problem was SystemClock_Config() not working properly above certain clock speeds, causing the ST-Link to lose connection
TL;DR always use "connect under reset" mode, unless you know what you're doing.