2019年9月29日 星期日

RISC-V探索002--openocd-gd32v的設定

> Executing task: C:\Users\ch\.platformio\penv\Scripts\platformio.exe run --target upload <

Processing sipeed-longan-nano (platform: gd32v; framework: gd32vf103-sdk; board: sipeed-longan-nano)
-------------------------------------------------------------------------------------------------------------------------------------------------------------
PackageManager: Installing tool-openocd-gd32v @ ~0.1.1
Downloading  [####################################]  100%
Unpacking  [##########################----------]   73%  00:00:02
Unpacking...
Warning! Package Mirror: [Errno 22] invalid mode ('wb') or filename: 'C:\\Users\\ch\\.platformio\\packages\\_tmp_installing-gi6rvh-package\\scripts\\target\\1986\xd0\xb2\xd0\xb51\xd1\x82.cfg'
Looking for another mirror...
Downloading  [####################################]  100%
Unpacking  [##########################----------]   73%  00:00:02
Unpacking...
Warning! Package Mirror: [Errno 22] invalid mode ('wb') or filename: 'C:\\Users\\ch\\.platformio\\packages\\_tmp_installing-izvrbw-package\\scripts\\target\\1986\xd0\xb2\xd0\xb51\xd1\x82.cfg'
Looking for another mirror...
Error: Could not install 'tool-openocd-gd32v' with version requirements '~0.1.1' for your system 'windows_amd64'.

Please try this solution -> http://bit.ly/faq-package-manager
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

=> 自己下載 解開後安裝到自己的目錄下 <=

> Executing task: C:\Users\ch\.platformio\penv\Scripts\platformio.exe run --target upload <

Processing sipeed-longan-nano (platform: gd32v; framework: gd32vf103-sdk; board: sipeed-longan-nano)
-------------------------------------------------------------------------------------------------------------------------------------------------------------
PackageManager: Installing tool-gd32vflash @ ~0.1.0
Downloading  [####################################]  100%
tool-gd32vflash @ 0.1.0 has been successfully installed!
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/gd32v/sipeed-longan-nano.html
PLATFORM: GigaDevice GD32V 1.0.0 > Sipeed Longan Nano
HARDWARE: GD32VF103CBT6 108MHz, 32KB RAM, 128KB Flash
DEBUG: Current (altera-usb-blaster) External (altera-usb-blaster, gd-link, jlink, sipeed-rv-debugger, um232h)
PACKAGES: toolchain-gd32v 9.2.0, tool-openocd-gd32v 0.1.1, framework-gd32vf103-sdk 1.0.0, tool-gd32vflash 0.1.0
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Checking size .pio\build\sipeed-longan-nano\firmware.elf
Memory Usage -> http://bit.ly/pio-memory-usage
DATA:    [=         ]   7.0% (used 2310 bytes from 32768 bytes)
PROGRAM: [=         ]   5.0% (used 6572 bytes from 131072 bytes)
Configuring upload protocol...
AVAILABLE: altera-usb-blaster, gd-link, jlink, serial, sipeed-rv-debugger, um232h
CURRENT: upload_protocol = serial
Looking for upload port...
Auto-detected: COM7
Uploading .pio\build\sipeed-longan-nano\firmware.bin
stm32flash 0.4

http://stm32flash.googlecode.com/

Using Parser : Raw BINARY
Interface serial_w32: 115200 8E1
Version      : 0x30
Option 1     : 0x00
Option 2     : 0x00
Device ID    : 0x0410 (Medium-density)
- RAM        : 20KiB  (512b reserved by bootloader)
- Flash      : 128KiB (sector size: 4x1024)
- Option RAM : 16b
- System RAM : 2KiB
Write to memory
Erasing memory
Wrote address 0x080019b8 (100.00%) Done.

Starting execution at address 0x08000000... done.

GET returns unknown commands (0x 6)
=============================================================== [SUCCESS] Took 12.78 seconds ===============================================================
=> 有沒有看到stm32flash 阿.. 使用stm32flash 也是可以下載的歐!!
=> 親測可用. <=

RISC-V探索001 -- 選擇探索的目標

開始接觸Risc-V 32. 市面上又有MipsOpen, 連最老牌IBM的 PowerPC 架構也變成open 的 https://openpowerfoundation.org/
但是應用端, 我是只有用MCU, Peripherals. 著重在硬體本身.所以, 並沒有需要深入了解ISA...當然讀一下相關的優缺點還是必須的.
1. 看書太累: https://riscv.org  https://open-isa.org/
2. 看影片追劇: RISC-V 的頻道
3. 找自己興趣: $38 FPGA with 8 cores Risc-V.
4. 找到一顆便宜GD32V, 還有一份NXP 的 VEGABoard.
==> 看來晶片有NXP加持, 連Tools/Documents 都比較完善.
https://github.com/open-isa-org/open-isa.org/releases
https://open-isa.org/developers/
==> 稍微 順便 看一下 VEGABoard 有什麼特異功能.
4.1 它是 ARM-Cortex-M0+/M4F, RISC-V RI5C/ZERO RISCY
總共四核心...哇!! 是要累死人歐.
4.2 看個大概..原來用M4F 配 RISC-V RI5C, M0+ 配 Zero RISCY 所以其實是雙核心.
5. 玩轉 Risc-V 需要 JTAG, 或者用OpenOCD. VEGABoard 內建的是 OpenSDA (兼容 OpenOCD嗎?)
6. 最後, 還是選定最便宜 最庶民的GD32V來 作為入門磚. 搞一下 Sipeed Longan Nano (龍眼? 請點下. 可以溫補. )