首页 > 解决方案 > 连接 gdb 时出现 ocd 断言错误

问题描述

我正在使用 openocd 和 arm-none-eabi-none 在 Ubuntu 20.04 上调试板 STM32f4 Discovery。直到昨天为止一切都很好。今天,当我将 gdb 连接到 localhost:4444 时,发生了以下断言并 ocd 退出:

Open On-Chip Debugger 0.10.0
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
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Started by GNU MCU Eclipse
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v37 API v2 SWIM v26 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 2.894743
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'gdb' connection on tcp/3333
Info : device id = 0x100f6413
Info : flash size = 8194kbytes
openocd: src/flash/nor/stm32f2x.c:990: stm32x_probe: Assertion `(bank->size >> 10) == flash_size_in_kb' failed.

我看到它使用的是stm32f2x.c,这是正确的,因为芯片是stm32f407vgt?

标签: openocd

解决方案


我发现了问题:我在没有切换到适当的闪存延迟的情况下提高了时钟速度,因此调试器将丢失此处提到的程序地址跟踪,在时钟和初始设置部分: https ://vjordan.info/log/fpga/ stm32f4.html 的第一步


推荐阅读