Skip to content

Arduino style API for GD32 F1, GD32F3, GD32VF1, CH32F1, CH32V30x and STM32F1, FreeRTOS and Cmake build system included. Some rust was added too, just in case.

Notifications You must be signed in to change notification settings

mean00/lnArduino

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lnArduino : Arduino style API for GD32 chips

The aim of this project is to offer an Arduino style framework for the Longan Nano board (RISCV) or GD32F1/F3 (ARM) boards. It also works with STM32F1 chips.

The API is 99% the same between the Riscv & Arm versions. Mostly tiny pinout/clock/interrupt changes.

What are the differences compared to vanilla Arduino ?

  • Cmake based build system, use whatever IDE you want.
  • Support ARM and RISCV GD32 MCUs, same API (tested with GD32VF103, GD32F103,GD32F303 and STM32F103).
  • FreeRTOS out of the box, using the RISCV port made by QQxiaoming [1] / or vanilla ARM M3/M4
  • Better peripherals support (DMA, tasks..)
  • Only loosely compatible with Arduino API but easy to port

A note of warning : This is my take on what i would like to have/use for such a board It might not fit your needs.

What works for the moment :

  • FreeRTOS
  • Spi transmit (DMA)
  • Serial transmit (DMA)
  • I2C Transmit (DMA) / Receive (Interrupt)
  • GPIO + interrupt
  • PWM support
  • Onboard LCD support (Longan Nano)
  • DAC (DMA) support
  • very basic ADC support / Timer triggered ADC
  • Flash storage

Demos The demoProject contains simple API demonstration programs.

How to build the demos :

  • Symlink/copy the lnArduino folder under the demo folder Fill-in platformconfig.cmake to point to your toolchain (adjust flags if needed) mkdir build && cd build && cmake .. && make
  • edit mcuSelect.Cmake to define which MCU you are using

By default they use a shared common_CMakeLists.txt / common_mcuSelect etc...

Bonus:

There is also some python helper scripts to have basic FreeRTOS support with gdb

Heritage:

  • FreeRTOS from FreeRTOS
  • Embedded_printf from [2]
  • The riscv freeRTOS port is from QQxiaming (see [1])
  • A couple of header file from arduino to offer a basic compatibility API
  • A couple of header from nucleisys to access n200 extra functions
  • Everything else has been written from scratch, no licensing issue.

The demoProject folder contains sample code to show the API.

[1] https://github.com/QQxiaoming/gd32vf103_freertos.git [2] https://github.com/mpaland/printf

About

Arduino style API for GD32 F1, GD32F3, GD32VF1, CH32F1, CH32V30x and STM32F1, FreeRTOS and Cmake build system included. Some rust was added too, just in case.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published