是不是FLASH被鎖了啊?能不能不用USB解鎖.板子沒有USB口
您好,麻煩你截一張完整的指令和信息輸出圖,這邊看一下,可將截圖發(fā)至我的郵箱(lzs@wch.cn)?;蛘吣銍L試將BOOT0接VCC重新上電下載看一下,看能否下載燒錄。
Open On-Chip Debugger 0.11.0+dev-02215-gcc0ecfb6d-dirty (2022-03-10-09:55)
Licensed under GNU GPL v2
For bug reports, read
?? ?http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
Ready for Remote Connections
Started by GNU MCU Eclipse
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : WCH-Link version 2.3
Info : wlink_init ok
Info : This adapter doesn't support configurable speed
Info : JTAG tap: riscv.cpu tap/device found: 0x00000001 (mfg: 0x000 (), part: 0x0000, ver: 0x0)
Warn : Bypassing JTAG setup events due to errors
Info : [riscv.cpu.0] datacount=2 progbufsize=8
Info : Examined RISC-V core; found 1 harts
Info :? hart 0: XLEN=32, misa=0x40901125
[riscv.cpu.0] Target successfully examined.
Info : starting gdb server for riscv.cpu.0 on 3333
Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
Info : device id = 0x263e7847
Info : flash size = 256kbytes
Warn : Prefer GDB command "target extended-remote :3333" instead of "target remote :3333"
Info : JTAG tap: riscv.cpu tap/device found: 0x00000001 (mfg: 0x000 (), part: 0x0000, ver: 0x0)
Warn : Bypassing JTAG setup events due to errors
Error: error writing to flash at address 0x00000000 at offset 0x00000000
Warn : keep_alive() was not invoked in the 1000 ms timelimit. GDB alive packet not sent! (7754 ms). Workaround: increase "set remotetimeout" in GDB
Error: failed read at 0x11, status=10614148
Assertion failed: info, file src/target/riscv/riscv-013.c, line 252
這是我用OpenOCD+Telnet操作的情況:
program指令運(yùn)行時(shí)直接奔潰了
Open On-Chip Debugger
> reset init
JTAG tap: riscv.cpu tap/device found: 0x00000001 (mfg: 0x000 (), part: 0x0000, ver: 0x0)
Bypassing JTAG setup events due to errors
> flash erase_address 0x00000000 0x40000
device id = 0x263e7847
flash size = 256kbytes
erased address 0x00000000 (length 262144) in 0.212762s (1203.222 KiB/s)
> program C:/MRS_DATA/workspace/xx.bin 0x00000000
JTAG tap: riscv.cpu tap/device found: 0x00000001 (mfg: 0x000 (), part: 0x0000, ver: 0x0)
Bypassing JTAG setup events due to errors
** Programming Started **
error writing to flash at address 0x00000000 at offset 0x00000000
embedded:startup.tcl:1136: Error: ** Programming Failed **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 1201
at file "embedded:startup.tcl", line 1136
failed read at 0x11, status=0
使用flash write_image指令一樣的結(jié)果
> reset init
JTAG tap: riscv.cpu tap/device found: 0x00000001 (mfg: 0x000 (), part: 0x0000, ver: 0x0)
Bypassing JTAG setup events due to errors
> flash erase_address 0x00000000 0x40000
device id = 0x263e7847
flash size = 256kbytes
erased address 0x00000000 (length 262144) in 0.208332s (1228.808 KiB/s)
> flash write_image xxx.bin 0x00000000 bin
error writing to flash at address 0x00000000 at offset 0x00000000
failed read at 0x11, status=0
在MRS里面用菜單里的燒錄
您好,建議你先用WCHISPTool工具通過串口方式解除讀保護(hù),重新下載程序試一下,注意不要勾選啟用讀保護(hù)。使用串口方式下載時(shí):BOOT0接VCC,BOOT1接GND,使用的串口工具要注意防倒灌電。串口接串口1(PA9、PA10引腳)。后面若有問題,可將問題發(fā)我郵箱(lzs@wch.cn).
WCHISPTool工具下載鏈接:http://www.findthetime.net/downloads/WCHISPTool_Setup_exe.html?