forked from michahoiting/rv-link
-
Notifications
You must be signed in to change notification settings - Fork 1
upload dlink firmware
Huaqi Fang edited this page Jul 2, 2024
·
5 revisions
最新的DLink固件可以从 https://github.com/Nuclei-Software/nuclei-dlink/releases/tag/v0.9.1 获取,然后使用
- GD32 DFU驱动: https://www.gd32mcu.com/data/documents/toolSoftware/GD32DfuDrivers_V3.6.6.6167.rar
- GD32 固件编程器: https://www.gd32mcu.com/data/documents/toolSoftware/GD32AllInOneProgrammer_win_V3.2.7.20225.7z
先安装DFU驱动,然后打开GD32 固件的编程软件。
确保GD32 DFU驱动和编程软件安装完毕,软件链接在上面。
-
将DLINK的USB-C口接到电脑上,打开 GD32AllInOneProgrammer.exe 软件
-
然后同时用卡针按下DLINK上 BOOT 和 NRST,再松开BOOT,最后松开NRST,这个 GD32 All in One Programmer软件上就会显示 如下框柱的 GD DFU DEVICE 1
- 点击软件上 Connect 连上gd32vf103芯片,然后选择固件,并点击 Download 开始下载更新固件
- 然后按下 BOOT 键 或者断开 USB-C重连,在设备管理器里面就可以看到两个串口
然后设备管理器中可以看到 PID=0x018A VID=0x28E9
的DLINK设备,符合我们的DLINK固件设置 https://github.com/Nuclei-Software/nuclei-dlink/blob/2d2d8e8b8675a35a01f883257c1dec6949cbc084/soc/gd32vf103/gd32vf103c_dlink/cdc_acm_core.c#L20-L21
- 使用 https://github.com/Nuclei-Software/nuclei-dlink_gdbserver/releases/tag/v0.9.1 这里下载
dlink_gdbserver_console
软件测试如下
参考的dlink配置文件位于 可执行文件 dlink_gdbserver_console.exe
相同目录下 dlink_gdbserver.cfg
C:\Work\Code\dlink_gdbserver>dlink_gdbserver_console.exe -h
Dlink GDB Server Console Tool v0.9.1
dlink_gdbserver_console -f <cfgfile> -p <gdbport>
# 下面将会起一个GDB Server
C:\Work\Code\dlink_gdbserver>dlink_gdbserver_console.exe
Using auto probed dlink debug serial port "COM6" .
Using serial port "COM6" as dlink debug port!
Opened "COM6" baud: 115200
Started by GNU MCU Eclipse
Dlink GDB Server: v0.9.1 Version
Server listen to port: 3333
- 使用DLINK的调试接口连接到芯来科技的FPGA开发版(DDR200T)上的调试插口,然后通过 riscv64-unknown-elf-gdb.exe 可以连上去,并查看相关寄存器信息。
C:\Work>C:\NucleiStudio_IDE_202406-win64\NucleiStudio\toolchain\gcc\bin\riscv64-unknown-elf-gdb.exe
GNU gdb (GDB) 13.2.90.20230712-git
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <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=i686-w64-mingw32 --target=riscv64-unknown-elf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) target remote :3333
Remote debugging using :3333
warning: No executable has been specified and target does not support
determining executable automatically. Try using the "file" command.
0x200002c4 in ?? ()
(gdb) info reg misa
misa 0x4094912b RV32ABDFIMPSUX
(gdb) info reg a0
a0 0x200202b0 537002672
(gdb) monitor nuclei cpuinfo
-----Nuclei RISC-V CPU Configuration Information-----
MARCHID: 308
MIMPID: 40200
ISA: RV32 A B D F I M P S U NICE Xxldspn1x Xxldspn2x Xxldspn3x
MCFG: TEE ECC ECLIC NICE ILM DLM ICACHE DCACHE DSP_N1 DSP_N2 DSP_N3 IREGION No-Safety-Mechanism DLEN=VLEN/2
ILM: 512 KB has-ecc
DLM: 256 KB has-ecc
ICACHE: 32 KB(set=512,way=2,lsize=32,ecc=1)
DCACHE: 32 KB(set=512,way=2,lsize=32,ecc=1)
IREGION: 0x18000000 4 MB
Unit Size Address
INFO 64KB 0x18000000
DEBUG 64KB 0x18010000
ECLIC 64KB 0x18020000
TIMER 64KB 0x18030000
ECLIC: VERSION=0x0 NUM_INTERRUPT=0 CLICINTCTLBITS=0 MTH=0 NLBITS=0
INFO-Detail:
mpasize : 0
----End of cpuinfo
(gdb) quit
- 使用Nuclei SDK测试下载运行,参考 https://doc.nucleisys.com/nuclei_sdk/quickstart.html 来快速设置 Nuclei SDK运行环境,然后打开串口终端连接 COM7(这个是输出串口)
下面演示编译N300的Coremark并下载到开发版(已经刷了N300 evalsoc的Bitstream)
- 也可以在Nuclei Studio 2024.06中直接使用,参见Nuclei Studio 2024.06 IDE文档