3174 views|5 replies

1662

Posts

0

Resources
The OP
 

Gigabit RISC-V GD32VF103 debugging tool introduction [Copy link]

 

There are not many debugging tools available for RSCV microcontrollers. For GD32VF103, only gd-link is recommended by the manufacturer. Here I would like to share with you a simple way to use the FT232 series high-speed port module to make a debugging and downloading tool. I would also like to share with you the pitfalls in the hardware and software when making this debugging tool.
1. The hardware must use FT232H, FT2232H, FT4232H and other hardware with suffixes without HL or HQ. These series support high-speed USB, and those with suffix D only support full speed; these modules can be bought on Taobao for dozens of yuan, and you can also solder them yourself if you are interested;

2. After the hardware module is purchased and manufactured, the EEprom of 93C55 and other modules is empty. Before inserting the hardware USB port into the computer, install the FTDI official driver CDM v2.12.28 WHQL Certified and the EEprom configuration software FT_Prog. Use FT_Prog to configure the driver of the hardware portA or portB to D2xx mode. No other changes are required. Remember to write the configuration after configuration;
3. Some online tutorials recommend using Zadig to force the driver from libusb to winusb. This step is not necessary after verification. When using openocd for debugging, openocd directly uses the D2xx driver. If forced to change to winusb, FT_prog will not be able to recognize the hardware and needs to be changed back to libusb. You can use it according to your own situation;
4. Openocd interface configuration, FT232, FT2232, FT4232 have the same vid, but different pid, so in the configuration interface file, ftdi_vid_pid 0x0403 0x6010 #ftdi_vid_pid 0x0403 0x6014 needs to be modified according to the module used, FT232 is 0x6014, FT2232 is 0x6010, FT4232 is 0x6012. In the configuration file, port pin configuration needs to be used for SRST, such as ftdi_layout_signal nSRST -oe 0x0040 -data 0x0040, the four signals of JTAG use 1--4 respectively, so the following 5-8 can be allocated, and here 0x0040 is binary 00100000; Therefore, NRST uses the 6th pin.
5. In the interface configuration, you need to use adapter_khz 20000 to configure the speed. The example configuration is 20M. After use, it can be configured to 30M at the highest, but the stability is not good. 20M can run very stably;
6. Used for GD32VF103 debugging, usually openocd is used. You can download the official version of openocd on the Internet. This version can be connected, but the flash writing and debugging will exit due to errors at the flash recognition. The main reason is that the GD32VF series target configuration file on the official website does not configure the flash. In addition, the official version has not yet added the driver for the GD32VF103 flash. Therefore, you must use the openocd version provided by the Xinlai official website. In this customized version, there is a customized GD32VF103 flash driver. set _FLASHNAME $_CHIPNAME.flash flash bank $_FLASHNAME gd32vf103 0x08000000 0 0 $_TARGETNAME
7. This tool can also be used for ARM debugging. It can support both JTAG and SWD modes, but the SWD mode requires appropriate hardware changes. There are many tutorials on the Internet. The interfacd and target configuration files of openocd are in my previous use of VS code for gdvf103 debugging, which you can refer to.

This post is from Domestic Chip Exchange

Latest reply

I found on the Internet that Jlink can upgrade the firmware support, but I haven't tried it specifically  Details Published on 2021-8-23 10:51
 
 

7422

Posts

2

Resources
2
 

Thanks for sharing, looking forward to the follow-up.

This post is from Domestic Chip Exchange
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 
 

1412

Posts

3

Resources
3
 

If the only debugging tool is gd-link, then everyone has to buy one? Is J-LINK not applicable?

This post is from Domestic Chip Exchange

Comments

I found on the Internet that Jlink can upgrade the firmware support, but I haven't tried it specifically  Details Published on 2021-8-23 10:51
Personal signature

没有什么不可以,我就是我,不一样的烟火! 

 
 
 

1

Posts

0

Resources
4
 

Thanks for sharing, it helps a lot, looking forward to the next post
hahahaha

This post is from Domestic Chip Exchange

Comments

Okay, that helps.  Details Published on 2021-8-23 09:45
 
 
 

1662

Posts

0

Resources
5
 
Ding ding ding ding ding Kang published on 2021-8-22 17:17 Thanks for sharing, it is very helpful, looking forward to the next post hahahaha

OK, that helps.

This post is from Domestic Chip Exchange
 
 
 

9702

Posts

24

Resources
6
 
annysky2012 posted on 2021-8-7 09:14 If the debugging tool can only use gd-link, then everyone has to buy one? Is J-LINK not applicable?

I found on the Internet that Jlink can upgrade the firmware support, but I haven't tried it specifically

This post is from Domestic Chip Exchange
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list