Hi @Tomas , @Paul and @Jim , 

First of all a big THANK YOU for your help with this issue (flashing the 
GigaDevice RISC-V board) ^_^. I managed to get OpenOCD connected with the 
target chip and I can connect a GDB client to OpenOCD. So most problems are 
already fixed! Unfortunately - the "monitor" command doesn't work in the GDB 
client. In other words, I can't enter direct OpenOCD commands from the GDB 
client. I'll explain in more detail. 

This is the OpenOCD version I'm using: 
[ https://dl.sipeed.com/LONGAN/platformio/dl-packages | 
https://dl.sipeed.com/LONGAN/platformio/dl-packages ] => 
tool-openocd-gd32v-v0.1.1-win.tar.gz 

I've also tried with the OpenOCD version that Reuben Townsend (engineer from 
GigaDevice) sent directly to me: 
[ https://1drv.ms/u/s!Ap1I4tV1BIXr2wXKkhQeYreBjzLH?e=c9XSQq | 
https://1drv.ms/u/s!Ap1I4tV1BIXr2wXKkhQeYreBjzLH?e=c9XSQq ] => 
0.10.0-12-20190722-0746.rar 

I fire up OpenOCD with the following script: 

# Script for GD32VF103 with GD-Link 
# ================================== 
adapter_khz 1000 
reset_config srst_only 
adapter_nsrst_assert_width 100 
interface cmsis-dap 
transport select jtag 
set _CHIPNAME riscv 
jtag newtap $_CHIPNAME cpu -irlen 5 -expected-id 0x1000563d 
set _TARGETNAME $_CHIPNAME.cpu 
target create $_TARGETNAME riscv -chain-position $_TARGETNAME 
$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size 20480 
-work-area-backup 0 

# Work-area is a space in RAM used for flash programming 
if { [ info exists WORKAREASIZE] } { 
set _WORKAREASIZE $WORKAREASIZE 
} else { 
set _WORKAREASIZE 0x5000 
} 

# Allow overriding the Flash bank size 
if { [ info exists FLASH_SIZE] } { 
set _FLASH_SIZE $FLASH_SIZE 
} else { 
# autodetect size 
set _FLASH_SIZE 0 
} 

# flash size will be probed 
set _FLASHNAME $_CHIPNAME.flash 
flash bank $_FLASHNAME gd32vf103 0x08000000 0 0 0 $_TARGETNAME 
riscv set_reset_timeout_sec 1 
init 
halt 
# ======================= END ========================== # 

OpenOCD starts and I see the following output: 



C:\beetle_projects\gd32vf103c_ start> "C:/embeetle/openocd_giga/bin/ 
openocd.exe" -f openocd_chip.cfg -s "C:/embeetle/openocd_giga/ scripts" -c 
"init; reset halt" 

GNU MCU Eclipse OpenOCD, 64- bitOpen On-Chip Debugger 0.10. 
0+dev-00593-g23ad80df4-dirty ( 2019-07-22-07:51) 

Licensed under GNU GPL v2 

For bug reports, read 
[ http://openocd.org/doc/doxygen/bugs.html | 
http://openocd.org/doc/doxygen/bugs.html ] 

adapter speed: 1000 kHz 

srst_only separate srst_gates_ jtag srst_open_drain connect_ deassert_srst 

adapter_nsrst_assert_width: 100 

Info : CMSIS-DAP: SWD Supported 

Info : CMSIS-DAP: JTAG Supported 

Info : CMSIS-DAP: FW Version = 2.0.0 

Info : CMSIS-DAP: Interface Initialised (JTAG) 

Info : SWCLK/TCK = 1 SWDIO/ TMS = 1 TDI = 1 TDO = 0 nTRST = 0 nRESET = 1 

Info : CMSIS-DAP: Interface ready 

Info : clock speed 1000 kHz 

Info : cmsis-dap JTAG TLR_ RESET 

Info : cmsis-dap JTAG TLR_ RESET 

Info : JTAG tap: auto0.tap tap/device found: 0x790007a3 ( mfg: 0x3d1 
(GigaDevice Semiconductor (Beijing)), part: 0x9000, ver: 0x7) 

Warn : AUTO auto0.tap - use " jtag newtap auto0 tap -irlen 5 -expected-id 
0x790007a3" 

Info : datacount=4 progbufsize=2 

Info : Examined RISC-V core; found 1 harts 

Info : hart 0: XLEN=32, misa= 0x40901105 

Info : Listening on port 3333 for gdb connections 

Info : cmsis-dap JTAG TLR_ RESET 

Info : cmsis-dap JTAG TLR_ RESET 

Info : cmsis-dap JTAG TLR_ RESET 

Info : JTAG tap: auto0.tap tap/device found: 0x790007a3 ( mfg: 0x3d1 
(GigaDevice Semiconductor (Beijing)), part: 0x9000, ver: 0x7) 

Info : Listening on port 6666 for tcl connections 

Info : Listening on port 4444 for telnet connections 

Now I fire up a GDB client in another console. I'm using the 
riscv-none-embed-gdb.exe from the GitHub release from @Liviu Ionescu : 
[ 
https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases/tag/v8.3.0-1.1/
 | 
https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases/tag/v8.3.0-1.1/
 ] => xpack-riscv-none-embed-gcc-8.3.0-1.1-win32-x64.zip 

I get the following output: 

C:\beetle_projects\gd32vf103c_ start> "C:/embeetle/gnu_riscv_xpack_ 
64b/bin/riscv-none-embed-gdb. exe" 
warning: Couldn't determine a path for the index cache directory. 
GNU gdb (xPack GNU RISC-V Embedded GCC, 64-bit) 8.3 
Copyright (C) 2019 Free Software Foundation, Inc. 
License GPLv3+: GNU GPL version 3 or later < [ http://gnu.org/licenses/gpl.html 
| http://gnu.org/licenses/gpl.html ] > 
This is free software: you are free to change and redistribute it. 
There is NO WARRANTY, to the extent permitted by law. 
Type "show copying" and "show warranty" for details. 
This GDB was configured as "--host=x86_64-w64-mingw32 
--target=riscv-none-embed". 
Type "show configuration" for configuration details. 
For bug reporting instructions, please see: 
< [ https://github.com/sifive/freedom-tools/issues | 
https://github.com/sifive/freedom-tools/issues ] >. 
Find the GDB manual and other documentation resources online at: 
< [ http://www.gnu.org/software/gdb/documentation/ | 
http://www.gnu.org/software/gdb/documentation/ ] >. 
For help, type "help". 
Type "apropos word" to search for commands related to "word". 
(gdb) target remote localhost:3333 
Remote debugging using localhost:3333 
bfd requires xlen 8, but target has xlen 4 
(gdb) monitor reset halt 
"monitor" command not supported by this target. 
(gdb) monitor flash erase_address 0x08000000 0x00010000 
"monitor" command not supported by this target. 

As you can see, the "monitor" command simply doesn't work. It's the first time 
this happens to me. I have absolutely no clue how to solve this. 

Kind regards, 
Kristof Mulier 






Van: "Tomas Vanek" <tom_...@users.sourceforge.net> 
Aan: "kristof mulier" <kristof.mul...@telenet.be> 
Cc: "openocd-devel" <openocd-devel@lists.sourceforge.net> 
Verzonden: Donderdag 30 april 2020 09:23:09 
Onderwerp: Re: [OpenOCD-devel] Support for GigaDevice microcontrollers 

Hi Kristof, 

On 29/04/2020 17:34, [ mailto:kristof.mul...@telenet.be | 
kristof.mul...@telenet.be ] wrote: 



Hi @jmn 
I just got the following reply from Reuben Townsend from GigaDevice: 

Hi Kristof, the GD-LINK uses the CMSIS-DAP interface 
and for the GD32E230 MCU, you can use the stm32f0x.cfg 
configuration file. 







Please be aware there are at least two patches for GD32 devices in gerrit 

[ http://openocd.zylin.com/4592 | http://openocd.zylin.com/4592 ] 


[ http://openocd.zylin.com/5246 | http://openocd.zylin.com/5246 ] 


They cannot be applied cleanly to the current git master and authors seem not 
responding. 

Tom 




_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to