ch32v307 openocd

我用openocd下代码

Info : device id = 0x7b45b051

Info : flash size = 288kbytes

Info : ROM 192 kbytes RAM 128 kbytes

Info : Flash write discontinued at 0x00028778, next section at 0x00030000

Warn : no flash bank found for address 0x00048000

报错是为什么

您好,有可能是代码超出192K的范围了,可将FLASH、RAM的配置修改成288K+32K试一下。此外,麻烦说一下是调试还是命令行下载,完整的输出信息是啥,可以截图发出来看一下。



Info : only one transport option; autoselect 'sdi'

Warn : Transport "sdi" was already selected

Ready for Remote Connections

Info : WCH-LinkE  mode:RV version 2.9

Info : wlink_init ok

Info : clock speed 6000 kHz

Info : [wch_riscv.cpu.0] datacount=2 progbufsize=8

Info : [wch_riscv.cpu.0] Examined RISC-V core; found 1 harts

Info : [wch_riscv.cpu.0]  XLEN=32, misa=0x40901125

[wch_riscv.cpu.0] Target successfully examined.

Info : gdb port disabled

** Programming Started **

Info : device id = 0x7b45b051

Info : flash size = 288kbytes

Info : ROM 192 kbytes RAM 128 kbytes

Info : Flash write discontinued at 0x00028778, next section at 0x00030000

Warn : no flash bank found for address 0x00048000

** Programming Finished **

shutdown command invoked




另外,我用了CH32的非零等待区,所以代码是比192K大的,如果用MRS是可以下载的


而且我注意到他报回来的log显示

Info : flash size = 288kbytes

Info : ROM 192 kbytes RAM 128 kbytes

Info : Flash write discontinued at 0x000284e0, next section at 0x00030000

Warn : no flash bank found for address 0x00048000


我有两个问题:

1. Info : Flash write discontinued at 0x000284e0, next section at 0x00030000这句是在说什么意思,为什么flash写入没有继续

2. 0x00048000是288kbytes,但是我整个配置都没有288kbytes,这个288kbytes是从哪蹦出来的


openocd.exe -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s "D:\\SRB2\\SRB-CH32V" -f "c:/Users/lee88/.vscode/extensions/marus25.cortex-debug-1.12.1/support/openocd-helpers.tcl" -f "C:/MounRiver/MounRiver_Studio/toolchain/OpenOCD/bin/wch-riscv.cfg"

Open On-Chip Debugger 0.11.0+dev-02415-gfad123a16-dirty (2024-01-24-13:40)

Licensed under GNU GPL v2

For bug reports, read

        http://openocd.org/doc/doxygen/bugs.html

CDLiveWatchSetup

Info : only one transport option; autoselect 'sdi'

Warn : Transport "sdi" was already selected

Ready for Remote Connections

Info : Listening on port 50001 for tcl connections

Info : Listening on port 50002 for telnet connections

Info : WCH-Link-CH549  mode:RV version 2.10 

Info : wlink_init ok

Info : clock speed 6000 kHz

Info : [wch_riscv.cpu.0] datacount=2 progbufsize=8

Info : [wch_riscv.cpu.0] Examined RISC-V core; found 1 harts

Info : [wch_riscv.cpu.0]  XLEN=32, misa=0x40901105

[wch_riscv.cpu.0] Target successfully examined.

Info : starting gdb server for wch_riscv.cpu.0 on 50000

Info : Listening on port 50000 for gdb connections

Info : accepting 'gdb' connection on tcp/50000

Info : device id = 0x7136abcd

Info : flash size = 32kbytes

Info : Flash write discontinued at 0x00000004, next section at 0x00002000

Error: error writing to flash at address 0x00000000 at offset 0x00000000


我也遇到了相同的问题。

似乎程序在FLASH中分多个部分,就会遇到这个问题。

这个问题,你解决了吗?


您好,可以参考下图配置一下是否还会有该问题

image.png


只有登录才能回复,可以选择微信账号登录