This document is intended for developers who need to add more peripheral drivers to their existing RA series BSPs. By reading this article, developers can add their own drivers to existing BSPs according to their actual situation.
This section uses the example of adding on-chip peripheral drivers to explain how to add more drivers available to BSPs. If the on-chip peripherals you want to use are not available in the 'On-chip peripheral configuration menu', you need to add them yourself. Below we will demonstrate how to add a UART9 port for ra6m4-cpk.
Adding peripheral support for UART requires the following steps:
Open the board\kconfig file in the BSP and add the UART9 configuration.
After the modification is complete, open the ENV tool in the BSP directory and enter the 'menuconfig' command on the command line to see if the UART9 configuration has been added.
Once the configuration of Kconfig is added, you also need to add the corresponding configuration in the configuration file and driver file.
Open the file libraries\HAL_Drivers\config\ra6m4\uart_config.h
to add the UART9 configuration.
Open `librariesHAL_Driversdrv_usart_v2.c' and add the following code:
This tutorial translated by Josh Zou