Sipeed RISC-V调试器(ft2232d)调试longan,使用MounRiver Studio
在很久之前買了了sipeed的荔枝糖FPGA,就是安陸哪個片子,送了一個這個調試器,但是我個人來說就會fpga點個燈,太難的就不會了,這個調試器也就是一個擺設。今天逛淘寶看這個調試器已經漲到47塊,加上10塊的快遞費,需要57,我那個時候35包郵?還是25?這么貴一定要用一下,要不然浪費了。
我手里還有一塊longan,也是RISC-V內核的MCU,所以我就想用這個調試器作為jlink調試longan。
需要使用的軟件有:
MounRiver Studio,UsbDriverTool
UsbDriverTool下載路徑:Automatic USB driver installer for FTDI and LibUSB drivers
安裝:usb driver
?打開軟件
?到這一步驅動就配置好了,下一步我們就配置MounRiver Studio的debug信息
編譯器原生的openocd配置文件不適合我們的logan,所以我就找了一個,放到了下邊,需要就自己建一個文件弄進去,放到下邊的文件夾。
adapter_khz 1000 reset_config srst_only #adapter_nsrst_assert_width 1000interface ftdi ftdi_vid_pid 0x0403 0x6010## If ftdi_device_desc not specified, the device description is ignored during device selection. ## So if you want to specify a dedicated FTDI device, you can select following device description: ## "Dual RS232-HS" is for RVSTAR V1 on-board debugger ## "USB <-> JTAG-DEBUGGER" is for RVSTAR V2 on-board debugger ## Uncomment one which match your device description # ftdi_device_desc "Dual RS232-HS" # ftdi_device_desc "USB <-> JTAG-DEBUGGER"ftdi_layout_init 0x0008 0x001b ftdi_layout_signal nSRST -oe 0x0020 -data 0x0020 # These signals are used for cJTAG escape sequence on initialization only ftdi_layout_signal TCK -data 0x0001 ftdi_layout_signal TDI -data 0x0002 ftdi_layout_signal TDO -input 0x0004 ftdi_layout_signal TMS -data 0x0008 ftdi_layout_signal JTAG_SEL -data 0x0100 -oe 0x0100 transport select jtagset _CHIPNAME riscv jtag newtap $_CHIPNAME cpu -irlen 5# Work-area is a space in RAM used for flash programming if { [info exists WORKAREASIZE] } {set _WORKAREASIZE $WORKAREASIZE } else {set _WORKAREASIZE 0x5000 }set _TARGETNAME $_CHIPNAME.cpu target create $_TARGETNAME riscv -chain-position $_TARGETNAME $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0set _FLASHNAME $_CHIPNAME.flashflash bank $_FLASHNAME gd32vf103 0x08000000 0 0 0 $_TARGETNAME# Expose Nuclei self-defined CSRS range # See https://github.com/riscv/riscv-gnu-toolchain/issues/319#issuecomment-358397306 # Then user can view the csr register value in gdb using: info reg csr775 for CSR MTVT(0x307) riscv expose_csrs 770-800,835-850,1984-2032,2064-2070riscv set_reset_timeout_sec 1inithalt弄好之后就可以在線調試了。?
?
這樣就OK了
?原理說明:
ft22332d這個芯片本身來說的話就是兩個串口,所謂的openocd也就是通過一個openocd軟件控制ft2232d去模擬一個jlink,或者模擬其他的調試器。所以使用ft22232d這個芯片作為調試器,需要usb driver tool去更改驅動,然后再去通過openocd軟件去調用硬件和配置文件。
最后大家如果想要一個longan的工程可以去下邊的路徑去下載一份GD32VF103-RT_ThreadNano: gd32vf103cbt6移植了th-thread nano,暫存一下,以后還有別的用處
總結
以上是生活随笔為你收集整理的Sipeed RISC-V调试器(ft2232d)调试longan,使用MounRiver Studio的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: deadline集群渲染_Maya笔记
- 下一篇: SAP 后台配置之FM基金管理篇