Longan Nano

Overview

The Sipeed Longan Nano and Longan Nano Lite is an simple and tiny development board with an GigaDevice GD32VF103 SoC that based on N200 RISC-V IP core by Nuclei system technology. More information can be found on:

Hardware

  • 4 x universal 16-bit timer

  • 2 x basic 16-bit timer

  • 1 x advanced 16-bit timer

  • Watchdog timer

  • RTC

  • Systick

  • 3 x USART

  • 2 x I2C

  • 3 x SPI

  • 2 x I2S

  • 2 x CAN

  • 1 x USBFS(OTG)

  • 2 x ADC(10 channel)

  • 2 x DAC

Supported Features

The board configuration supports the following hardware features:

Peripheral

Kconfig option

Devicetree compatible

GPIO

CONFIG_GPIO

gd,gd32-gpio

Machine timer

CONFIG_RISCV_MACHINE_TIMER

riscv,machine-timer

Nuclei ECLIC Interrupt Controller

CONFIG_NUCLEI_ECLIC

nuclei,eclic

PWM

CONFIG_PWM

gd,gd32-pwm

USART

CONFIG_SERIAL

gd,gd32-usart

I2C

CONFIG_I2C

gd,gd32-i2c

DAC

CONFIG_DAC

gd,gd32-dac

ADC

CONFIG_ADC

gd,gd32-adc

SPI

CONFIG_SPI

gd,gd32-spi

The microSD card reader in Longan Nano board is connected to SPI1.

Serial Port

USART0 is on the opposite end of the USB. Connect to TX0 (PA9) and RX0 (PA10).

Programming and debugging

Building & Flashing

Here is an example for building the Blinky application.

# From the root of the zephyr repository
west build -b longan_nano samples/basic/blinky
west flash

When using a custom toolchain it should be enough to have the downloaded version of the binary in your PATH.

The default runner tries to flash the board via an external programmer using openocd. To flash via the USB port, select the DFU runner when flashing:

west flash --runner dfu-util

Debugging

You can debug an application in the usual way. Here is an example for the Blinky application.

# From the root of the zephyr repository
west build -b longan_nano samples/basic/blinky
west debug