RT-Thread Studio Driver

This article introduces the RT-Thread Studio's support for hardware peripheral drivers. The RT-Thread Nano version does not have a device concept so the RT-Thread mentioned in this article is the RT-Thread Standard version. The RT-Thread Nano version recommends using the HAL library directly for driver development.

RT-Thread Drivers Introduction

The current RT-Thread Studio driver development is divided into two main ways.

  • Automatically generated by RT-Thread Studio, drivers that can be used directly without modifying any files or simply defining a few macros, such as GPIO, UART, I2C, SPI, SDIO, ETH, etc.
  • If there is no connected device drive frame, HAL library function is recommended for driver development, such as DAC, FSMC, and so on.

RT-Thread Studio Supported Drivers

Peripherals RT-Thread Studio automatically generates HAL library functions
PIN Support Support
UART Support Support
I2C Support Support
SPI Support Support
QSPI Support Support
WDT Support Support
PWM Support Support
RTC Support Support
FLASH Support Support
SDIO Support Support
USB HOST Support Support
USB DEVICE Support Support
ETH Support Support
TIMER Support (but HAL library is more recommended) Support
ADC Support (but HAL library is more recommended) Support
DAC Not Yet Support
FSMC Not Yet Support
CAN Not Yet Support

Get Started with RT-Thread Studio Drivers

Automatically Generated by RT-Thread Studio

When you create a new full-version project with RT-Thread Studio, you don't need to modify any code, for example:

  • PIN: The driver is docked to the device drive frame and can be used directly, refer to the use of the PIN Device.
  • UART: For serial drives, serial drivers are also automatically docked to the device drive frame when generating projects, using macros that require their own definition of serial slogans and serial pins, as detailed by reference to the Serial Devices.
  • I2C: Software I2C drivers are also connected to device drivers framework when generating project by RT-Thread Studio, software I2C driver development please refer to I2C Device.
  • SPI: Please refer to SPI Device for more information about device drivers development.
  • More devices: For more device drivers development, please refer to the RT-Thread official website documentation center.


Although the ADC and Timer peripherals are docked to the device drive frame, they are not fully functional, such as, DMA is not supported and some advanced features of the timer are not available, and so on. For this type of driver, it is recommended to use the HAL library function for development.

Using HAL library functions

Device drivers code can be added automatically or manually through Studio, there are still some peripherals that are temporarily unable to access the device framework.

You can directly develop the corresponding drivers following the HAL library development method.