将示例闪存到 stm32 时目标未停止错误

target not halted error when flashing sample into stm32

我有 stm32 nucleo 开发板 wb55rg,我正在尝试将一些示例写入其中,例如闪烁和自定义示例,但是当我在构建项目后尝试将项目写入开发板时,我遇到了同样的错误( 等待目标暂停时超时),我不知道如何处理。我在网上搜索,发现了一些关于强迫症的信息,但我不是很明白。我不使用 STMCubeIDE,只使用 zephyr 的示例 blinky。任何人都可以帮我吗? 我正在使用来自 VM box 的 linux OS 和来自 zephyr 的简单眨眼示例。

My steps are:

    west build -b nucleo_wb55rg samples/basic/blinky ( building project )
    west flash 

错误讯息

-- west flash: rebuilding
[0/1] cd /home/nikos/Desktop/my_try/bu.../cmake/flash && /usr/bin/cmake -E echo

-- west flash: using runner openocd
-- runners.openocd: Flashing file: /home/nikos/Desktop/my_try/build/zephyr/zephyr.hex
Open On-Chip Debugger 0.10.0+dev-01508-gf79c90268-dirty (2021-03-26-16:13)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
srst_only separate srst_nogate srst_open_drain connect_deassert_srst

Info : clock speed 500 kHz
Info : STLINK V2J37M26 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.229148
Info : stm32wbx.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32wbx.cpu on 3333
Info : Listening on port 3333 for gdb connections
    TargetName         Type       Endian TapName            State       
--  ------------------ ---------- ------ ------------------ ------------
 0* stm32wbx.cpu       hla_target little stm32wbx.cpu       running

Info : Unable to match requested speed 500 kHz, using 480 kHz
Info : Unable to match requested speed 500 kHz, using 480 kHz
Error: timed out while waiting for target halted
TARGET: stm32wbx.cpu - Not halted
FATAL ERROR: command exited with status 1: /home/nikos/zephyr-sdk-0.12.4/sysroots/x86_64-pokysdk-linux/usr/bin/openocd -s /home/nikos/zephyrproject/zephyr/boards/arm/nucleo_wb55rg/support -s /home/nikos/zephyr-sdk-0.12.4/sysroots/x86_64-pokysdk-linux/usr/share/openocd/scripts -f /home/nikos/zephyrproject/zephyr/boards/arm/nucleo_wb55rg/support/openocd.cfg -c init -c targets -c 'reset halt' -c 'flash write_image erase /home/nikos/Desktop/my_try/build/zephyr/zephyr.hex' -c 'reset halt' -c 'verify_image /home/nikos/Desktop/my_try/build/zephyr/zephyr.hex' -c 'reset run' -c shutdown

我找到了这个issue的问题。这块板是用过的,它的前任主人改变了板上的一些切换销。所以我搜索了 stm32wb55rg 的默认引脚,当我设置默认引脚时,错误就解决了。非常感谢所有对此做出回复的人 post 以帮助我了解发生了什么。