Difference between revisions of "Sipeed Longan Nano"
(→Pinout) |
|||
(20 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | [[Category:Development Board]][[Category:RISC-V]]{{metadesc|Sipeed Longan Nano RISC-V Development Board}} | + | [[Category:Development Board]][[Category:RISC-V]]{{metadesc|Sipeed Longan Nano RISC-V Development Board}}[[File:Sipeed Longan Nano - top view aligned.jpg|thumb]] |
− | + | The [[Sipeed Longan Nano]] is a development board built around a [[GD32VF103xx]] [[MCU]]. The [[GD32VF103xx]] is a [[GigaDevice]] [[MCU]] with a [[RISC-V]] core and an architecture which generally assembles a [[STM32]] [[MCU]]. | |
+ | |||
+ | This page contains noted on how to get a full featured development environment - including (important dammit!) single step debugging - up and running. | ||
== Pinout == | == Pinout == | ||
− | [[File:longan_nano_pinout_v1.1.0_w5676_h4000_large.png| | + | [[File:longan_nano_pinout_v1.1.0_w5676_h4000_large.png|1200 px]] |
+ | |||
+ | == DFU == | ||
+ | |||
+ | The [[GD32VF103]] on the [[Sipeed Longan Nano|Longan Nano]] board, like [[STM32]] [[MCU]]s has got a built-in system bootloader, which can be activated by holding down the [[Boot0]] button during reset. Contrary to the [[STM32F103]] on [[Blue Pill]] boards, this bootloader appears to support [[DFU]]. | ||
+ | |||
+ | Adding a UDEV rule to make it readable: | ||
+ | |||
+ | <pre> | ||
+ | # make this usb device accessible for users, used in WebUSB | ||
+ | # change the mode so unprivileged users can access it, insecure rule, though | ||
+ | SUBSYSTEMS=="usb", ATTR{idVendor}=="28e9", ATTR{idProduct}=="0189", MODE:="0666" | ||
+ | </pre> | ||
+ | |||
+ | the device is recognized by dfu-util: | ||
+ | |||
+ | <pre> | ||
+ | lth@ncpws04:~/tmp/mylifeline$ dfu-util -l | ||
+ | dfu-util 0.9 | ||
+ | |||
+ | Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc. | ||
+ | Copyright 2010-2016 Tormod Volden and Stefan Schmidt | ||
+ | This program is Free Software and has ABSOLUTELY NO WARRANTY | ||
+ | Please report bugs to http://sourceforge.net/p/dfu-util/tickets/ | ||
+ | |||
+ | Found DFU: [28e9:0189] ver=0100, devnum=23, cfg=1, intf=0, path="2-4.5.3", alt=0, name="@Internal Flash /0x08000000/128*001Kg", serial="??" | ||
+ | </pre> | ||
+ | |||
+ | It is working although it is a bit weird they decided to treat the entire flash as one block of 128 kB. According to the [https://ipfs.subutai.io/ipfs/QmRfXyXBzjKSehAQtXzmxRwJUsatZJDB6h7ygWEks8eHfv/GD32VF103_User_Manual_EN_V1.0.pdf User Manual] the flash _can_ be erased per 1 kB page. | ||
+ | |||
+ | |||
+ | == DIY JTAG == | ||
+ | [[File:Green Pill as JTAG adapter.jpg|thumb]] | ||
+ | In this case we will be using a home developed development board, the [[Green Pill]] as a JTAG programmer. Our [[Green Pill]] board is largely compatible with a traditional [[Blue Pill]]. | ||
+ | |||
+ | |||
+ | |||
+ | {| class=wikitable | ||
+ | |- | ||
+ | ! Name | ||
+ | ! Green Pill | ||
+ | ! Longan Nano | ||
+ | |- | ||
+ | | TDI | ||
+ | | PB15 | ||
+ | | jTDI | ||
+ | |- | ||
+ | | TDO | ||
+ | | PB14 | ||
+ | | jTDO | ||
+ | |- | ||
+ | | TCK | ||
+ | | PB13 | ||
+ | | jTCK | ||
+ | |- | ||
+ | |TMS | ||
+ | | PB4 | ||
+ | | jTMS | ||
+ | |} | ||
== Gallery == | == Gallery == | ||
Line 18: | Line 78: | ||
* [https://vivonomicon.com/2020/02/11/bare-metal-risc-v-development-with-the-gd32vf103cb/ Bare metal RISC-V on GD32VF103CB] | * [https://vivonomicon.com/2020/02/11/bare-metal-risc-v-development-with-the-gd32vf103cb/ Bare metal RISC-V on GD32VF103CB] | ||
+ | * [https://www.susa.net/wordpress/2019/10/longan-nano-gd32vf103/ Longan Nano (GD32VF103) details] | ||
+ | * [https://ipfs.subutai.io/ipfs/QmPYmZYHweiszEKn74Pd5JTCe9Ee6Z88ZqmwUkASZM7Vmu Original firmware] | ||
+ | * [https://github.com/esmil/gd32vf103inator GD32VF103Inator] | ||
+ | * [https://robbert-groen.medium.com/getting-started-with-the-gd32vf103-risc-v-microcontroller-22cb34718b0d Getting started with the GD32VF103 RISC-V microcontroller] | ||
+ | * [https://ipfs-pin.com/ipfs/QmWQFk7MB1TYR1Xc4MrXSbN54xzTzJf3u5abT6T8MAgNJN/GD32VF103_Firmware_Library_User_Guide_V1.0.pdf GD32VF103 Firmware Library User guide] |
Latest revision as of 09:13, 31 October 2021
The Sipeed Longan Nano is a development board built around a GD32VF103xx MCU. The GD32VF103xx is a GigaDevice MCU with a RISC-V core and an architecture which generally assembles a STM32 MCU.
This page contains noted on how to get a full featured development environment - including (important dammit!) single step debugging - up and running.
Pinout
DFU
The GD32VF103 on the Longan Nano board, like STM32 MCUs has got a built-in system bootloader, which can be activated by holding down the Boot0 button during reset. Contrary to the STM32F103 on Blue Pill boards, this bootloader appears to support DFU.
Adding a UDEV rule to make it readable:
# make this usb device accessible for users, used in WebUSB # change the mode so unprivileged users can access it, insecure rule, though SUBSYSTEMS=="usb", ATTR{idVendor}=="28e9", ATTR{idProduct}=="0189", MODE:="0666"
the device is recognized by dfu-util:
lth@ncpws04:~/tmp/mylifeline$ dfu-util -l dfu-util 0.9 Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc. Copyright 2010-2016 Tormod Volden and Stefan Schmidt This program is Free Software and has ABSOLUTELY NO WARRANTY Please report bugs to http://sourceforge.net/p/dfu-util/tickets/ Found DFU: [28e9:0189] ver=0100, devnum=23, cfg=1, intf=0, path="2-4.5.3", alt=0, name="@Internal Flash /0x08000000/128*001Kg", serial="??"
It is working although it is a bit weird they decided to treat the entire flash as one block of 128 kB. According to the User Manual the flash _can_ be erased per 1 kB page.
DIY JTAG
In this case we will be using a home developed development board, the Green Pill as a JTAG programmer. Our Green Pill board is largely compatible with a traditional Blue Pill.
Name | Green Pill | Longan Nano |
---|---|---|
TDI | PB15 | jTDI |
TDO | PB14 | jTDO |
TCK | PB13 | jTCK |
TMS | PB4 | jTMS |