Skip to content

SeeedStudio GD32 RISC-V board

Support for the SeeedStudio GD32 RISC-V board @author Koen Zandberg koen@bergzand.net @author Gunar Schorcht gunar@schorcht.net

Overview

The Seedstudio GD32 RISC-V Dev Board is a development board for the GigaDevice GD32VF103VBT6 MCU with the following on-board components:

  • GD32VF103VBT6 RISC-V MCU @108MHz
  • 8MB on-board Flash W25Q64
  • 256 byte EEPROM
  • LCD Interface: 16-bit 8080 interface and SPI touch screen control interface
  • USB Type C
  • TF card slot
  • 2 user buttons
  • 3 user LEDs

Seeedstudio GD32 RISC-V Dev Board

Hardware:

MCUGD32VF103VBT6Supported
FamilyRISC-V with ECLIC
VendorGigaDevice
RAM32 kByte
Flash128 KByte
Frequency108 MHz
Power Modes3 (Sleep, Deep Sleep, Standby)yes
GPIOs80yes
Timers5 x 16-bit timeryes
RTC1 x 32-bit counter, 20-bit prescaleryes
WDT2 x 12-bit counter, 3-bit prescaleryes
ADC2 x 12-bit units, 16 channels @ 1 Mspsyes
DAC2 x 12-bit channelyes
UART2yes
USART3yes
SPI3yes
I2C2 x Fast Mode 400 kHzyes
I2S2no
CAN2 x CAN 2.0B with up to 1 Mbpsno
PWM6 Channelsyes
USB1 x USB FS OTGyes
Vcc3.0V - 3.6V
DatasheetDatasheet
Reference ManualReference Manual
Board ManualBoard Manual
Board SchematicBoard Schematic

Pin Layout / Configuration

The general pin layout is shown below.

Seeedstudio GD32 RISC-V Dev Board Pinout

The following tables show the connection of the on-board components with the MCU pins and their configuration in RIOT sorted by RIOT peripherals and by pins.

RIOT PeripheralMCU PinMCU PeripheralBoard FunctionRemark
ADC_LINE(0)PA1ADC01_IN1
ADC_LINE(1)PA2ADC01_IN2
ADC_LINE(2)PA3ADC01_IN3
ADC_LINE(3)PC0ADC01_IN10
ADC_LINE(4)PC1ADC01_IN11
ADC_LINE(5)PC2ADC01_IN12
ADC_LINE(6)PC3ADC01_IN13
ADC_LINE(7)PC4ADC01_IN14
ADC_LINE(8)PC5ADC01_IN15
ADC_LINE(9)-ADC01_IN16internal Temperature channel
ADC_LINE(10)-ADC01_IN17internal VFEF channel
BTN0PA0BOOT0KEY1
BTN1PC13KEY2
I2C_DEV(0) SCLPB6I2C0 SCL
I2C_DEV(0) SDAPB7I2C0 SDA
I2C_DEV(1) SCLPB10I2C1 SCL
I2C_DEV(1) SDAPB11I2C1 SDA
LED0PB5LED red
LED1PB0LED green
LED2PB1LED blue
PWM_DEV(0) CH0PB0LED1 green
PWM_DEV(0) CH1PB1LED2 blue
PWM_DEV(1) CH0PB8N/A if CAN is used
PWM_DEV(1) CH1PB9N/A if CAN is used
SPI_DEV(0) CSPB12SPI0 CS
SPI_DEV(0) SCLKPB13SPI0 SCLK
SPI_DEV(0) MISOPB14SPI0 MISO
SPI_DEV(0) MOSIPB15SPI0 MOSI
SPI_DEV(1) CSPA4SPI1 CS
SPI_DEV(1) SCLKPA5SPI1 SCLK
SPI_DEV(1) MISOPA6SPI1 MISO
SPI_DEV(1) MOSIPA7SPI1 MOSI
UART_DEV(0) TXPA9USART0 TXUART TX
UART_DEV(0) RXPA10USART0 RXUART RX
PinBoard FunctionRIOT Function 1RIOT Function 2RIOT Function 3
PA0KEY1BTN0
PA1ADC_LINE(0)
PA2ADC_LINE(1)
PA3ADC_LINE(2)
PA4FLASH CSSPI_DEV(1) CS
PA5FLASH SCKSPI_DEV(1) SCLK
PA6FLASH MISOSPI_DEV(1) MISO
PA7FLASH MOSISPI_DEV(1) MOSI
PA8
PA9UART_DEV(0) TX
PA10UART_DEV(0) RX
PA11USB D-
PA12USB D+
PA13JTAG TMS
PA14JTAG TCK
PA15JTAG TDI
PB0LED greenPWM_DEV(0) CH0LED1
PB1LED bluePWM_DEV(0) CH1LED2
PB3JTAG TDO
PB4JTAG NRST
PB5LED redLED3
PB6I2C_DEV(0) SCL
PB7I2C_DEV(0) SDA
PB8PWM_DEV(1) CH0
PB9PWM_DEV(1) CH1
PB10I2C_DEV(1) SCL
PB11I2C_DEV(1) SDA
PB12SD CSSPI_DEV(0) CS
PB13SD SCKSPI_DEV(0) SCLK
PB14SD MISOSPI_DEV(0) MISO
PB15SD MOSISPI_DEV(0) MOSI
PC0ADC_LINE(3)
PC1ADC_LINE(4)
PC2ADC_LINE(5)
PC3ADC_LINE(6)
PC4ADC_LINE(7)
PC5ADC_LINE(8)
PC13KEY2BTN1
-TemperatureADC_LINE(9)
-VREFADC_LINE(10)

All other pins are either not broken out or have no special usage.

Flashing the Device

The board is flashed via a JTAG interface with OpenOCD (at least release version 0.12.0). By default, an FTDI adapter according to the configuration defined in interface/openocd-usb.cfg is assumed.

BOARD=seeedstudio-gd32 make -C examples/basic/hello-world flash

To use an FTDI adapter with a different configuration, the configuration can be defined using the variable OPENOCD_FTDI_ADAPTER, for example:

OPENOCD_FTDI_ADAPTER=tigar BOARD=seeedstudio-gd32 make -C examples/basic/hello-world flash

If another adapter is used, it can be specified using variable OPENOCD_DEBUG_ADAPTER, for example for a Segger J-Link adapter:

OPENOCD_DEBUG_ADAPTER=jlink BOARD=seeedstudio-gd32 make -C examples/basic/hello-world flash

Accessing STDIO

By default, the stdio is provided by the USBUS CDC ACM module stdio_cdc_acm. This interface is mapped to /dev/ttyACM<n> on a Linux host, where <n> is the index of the CDC ACM interface, which is 0 by default.

To use the first UART interface for stdio instead, the stdio_uart module has to be enabled:

USEMODULE=stdio_uart BOARD=seeedstudio-gd32 make -C examples/basic/hello-world flash

The stdio is then directly accessible through the first UART interface. If an external USB-to-UART interface is used, this interface is mapped to /dev/ttyUSB<n> on a Linux host, where <n> is the index of the UART interface, which is 0 by default.

Use the term target to connect to the board using /dev/ttyUSB0:

BOARD=seeedstudio-gd32 make -C examples/basic/hello-world term PORT=/dev/ttyUSB0

If the UART interface index of the USB-to-UART interface is not 0, use the following command to connect:

BOARD=seeedstudio-gd32 make -C examples/basic/hello-world term PORT=/dev/ttyUSB<n>