Sipeed Longan Nano
The Sipeed Longan Nano is a board made by Sipeed using a GD32VF103CBT6 as main MCU. Is is similar to the well known STM32-based Blue Pill board.
There are two versions of this board available.
GD32VF103CBT6 with 128k Flash / 32k RAM
GD32VF103C8T6 with 64k Flash / 20k RAM. This is sometimes called the lite version.
If you want to buy one, carefully take a look at the description because sometimes they are offered with the GD32VF103CB controller, but they only contain the GD32VF103C8 controller.
The pinout of Sipeed Logan Nano is shown in the following picture
Click Sipeed Longan Nano Documentation to get all information about this board from Sipeed website.
To setup the board, make sure the following items are set correctly:
Power up the board by either the USB-C port or the by the debugger.
The default serial port is USART0, whitch is also available at the debug header. See Sipeed Longan Nano Pinout.
How to use
For Sipeed Longan Nano board, the DOWNLOAD and CORE variables
are fixed to
n205. The VARIANT variable can be used for choosing a board variant.
You can find its linker scripts in
gcc_gd32vf103xb_flashxip.ld: Linker script file for
DOWNLOAD=flashxipand 128k flash, this is the default.
gcc_gd32vf103x8_flashxip.ld: Linker script file for
DOWNLOAD=flashxipand 64k flash, the lite version, you can pass extra
VARIANT=litevia make command to select this linker script.
If you want to specify your own modified linker script, you can follow steps described in Change Link Script
You can find its openocd configuration file in
To run this application in Sipeed Longan Nano board in Nuclei SDK, you just need to use this SOC and BOARD variables.
# Clean the application
make SOC=gd32vf103 BOARD=gd32vf103c_longan_nano clean
# Build the application
make SOC=gd32vf103 BOARD=gd32vf103c_longan_nano all
# Upload the application using openocd and gdb
make SOC=gd32vf103 BOARD=gd32vf103c_longan_nano upload
# Debug the application using openocd and gdb
make SOC=gd32vf103 BOARD=gd32vf103c_longan_nano debug
To build for the lite variant you also need to set the VARIANT variable.
# Build the application
make SOC=gd32vf103 BOARD=gd32vf103c_longan_nano VARIANT=lite all
There are three extensions on the board:
On the back of the circuit board there is a socket for a micro SD card.
The SD-card is connected to SPI1.
On the front there is a socket for a small LCD which is offered by some sellers.
The LCD is connected to SPI0.
The controller on the LCD is similar to Sitronix’ ST7735.
The red LED is controlled via PC13. This LED can be addressed by LED3 or LEDR.
The green LED is controlled via PA1. This LED can be addressed by LED1 or LEDG.
The blue LED is controlled via PA2 This LED can be addressed by LED2 or LEDB.
There are two buttons on the board. One is the reset button and the other is to activate the internal bootloader. Unfortunately, none of these buttons can be used as user inputs.