Sipeed Longan Nano

Overview

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.

Sipeed Longan Nano Board

Sipeed Longan Nano Board.

Versions

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.

Pinout

The pinout of Sipeed Logan Nano is shown in the following picture

Sipeed Longan Nano Pinout

Sipeed Longan Nano Pinout.

Schematic

Sipeed Longan Nano Schematic

Sipeed Longan Nano Schematic.

Resources

Click Sipeed Longan Nano Documentation to get all information about this board from Sipeed website.

Setup

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 flashxip and n205. The VARIANT variable can be used for choosing a board variant.

  • You can find its linker scripts in SoC/gd32vf103/Board/gd32vf103c_longan_nano/Source/GCC/

    • gcc_gd32vf103xb_flashxip.ld: Linker script file for DOWNLOAD=flashxip and 128k flash, this is the default.

    • gcc_gd32vf103x8_flashxip.ld: Linker script file for DOWNLOAD=flashxip and 64k flash, the lite version, you can pass extra VARIANT=lite via 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 SoC/gd32vf103/Board/gd32vf103c_longan_nano/openocd_gd32vf103.cfg

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

Extensions

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.

  • One RGB-LED

    • 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.