stm32l0:执行MI命令失败。使用vFlashErase数据包擦除闪存错误 [英] stm32l0: Failed to execute MI command. Error erasing flash with vFlashErase packet
问题描述
我写我的应用程序并进入调试模式,一直运行良好,直到我添加我应用程序中的另一个功能我注意到,当我删除/注释 new_function 时,软件可以再次进入调试模式。但是,当我添加 new_function 到代码进行调试时,会发生错误,无法进入调试模式。
错误:最终启动顺序错误
无法执行MI命令:
加载C:Project_STM32L031K6-Nucleo\\\Debug\\\Project.elf
调试器后端的错误消息:
使用vFlashErase数据包擦除闪存错误
使用vFlashErase数据包擦除闪存错误
此错误不仅针对此特定的new_function,而且也适用于其他功能,如STM32Cube生成的TIM21_Init()。
我试图搜索解决方案,但找不到。
感谢
Bien
这是一个OpenOCD问题,而不是你的代码的问题。调试器命令文件指的是一个stlink-v2-1,但我实际上是一个stlink-v2,我遇到了这个问题。我正在使用STM32F0发现板。
我相信Nucleo板有stlink-v2-1,所以你可能有与我相反的问题。检查以确保运行菜单>调试配置>调试器> OpenOCD设置下的设置被设置为正确的调试器。
如果正在使用调试配置文件选择使用默认脚本或使用本地脚本选项)打开该文件并查找如下所示的行:
source [find interface / stlink-v2.cfg]
在我的情况下,项目向导已经创建了一个模板正在引用stlink-v2-1。
更新:
我也是当Eclipse崩溃并在后台运行OpenOCD时遇到此问题。运行
$ ps aux | grep openocd
如果您看到一个OpenOCD的实例在调试器不运行时,请将其删除。
I'm using a Nucleo STM32L031 with AC6 STM32 workbench (eclipse).
I write my application and go to debug mode, everthing was working well until I add another function in my application. I notice that when I remove/comment the "new_function", the software can go to debug mode again. However when I add the "new_function" to the code and go to debug, an error occurs and it cannot go to debug mode.
Error: Error in final launch sequence
Failed to execute MI command:
load C:Project_STM32L031K6-Nucleo\\Debug\\Project.elf
Error message from debugger back end:
Error erasing flash with vFlashErase packet
Error erasing flash with vFlashErase packet
This error does not occur only for this specific "new_function", but also for other functions e.g TIM21_Init() generated by STM32Cube.
I tried to search for the solution, but couldn't find it.
Thanks Bien
This is an OpenOCD issue, not a problem with your code. I got this issue when the debugger command file was referring to a "stlink-v2-1" but what I actually have is an "stlink-v2". I'm using the STM32F0 Discovery board.
I believe the Nucleo board has the "stlink-v2-1" so you might have the opposite problem as me. Check to make sure that the setting under "Run menu > Debug Configurations > Debugger > OpenOCD setup" is set to the correct debugger.
If a debug configuration file is being used (the "use default script" or "use local script" option is selected) open that file and look for a line like:
source [find interface/stlink-v2.cfg]
In my case the project wizard had created a template that was referencing stlink-v2-1. Changing it to the above fixed the problem.
UPDATE:
I also got this problem when Eclipse crashed and left OpenOCD running in the background. Run
$ ps aux | grep openocd
And if you see an instance of OpenOCD running when the debugger is not, kill it.
这篇关于stm32l0:执行MI命令失败。使用vFlashErase数据包擦除闪存错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!