GSoC 2022 RTEMS — Final Report

Duc Doan
3 min readSep 11, 2022

--

This is the summary of all my work during Google Summer of Code 2022 at RTEMS Project.

This project has three objectives:

  • To improve RTEMS Board Support Package (BSP) libraries by creating a new GPIO API and ADC API. Currently RTEMS has a GPIO API, but it has limitation of not being generic enough. The new APIs aim to create portability and simplicity for these fundamental functionalities for RTEMS BSPs.
  • To implement GPIO and ADC functionalities for STM32F4 BSP, which currently is lacking those. STM32 HAL and LL drivers will be integrated to add new features to the BSP.
  • To add networking capability for STM32F4 BSP and other STM32 chips by porting lwIP networking stack.

Repositories

This section lists my personal repositories that contain my work:

List of work

This section will list all the components of my work with a history of patches in the RTEMS devel mailing list archive. The patch history order will be from newest to oldest.

GPIO API

The original GPIO API comes with some limitation: it was designed around Beagle’s and Raspberry Pi’s hardware, so implementing it for other platforms could be not straight-forward. Therefore, I created a new GPIO API that aims for portability and simplicity.

More details of the GPIO API can be found in a separate blog post: https://medium.com/@dtbpkmte/gsoc-2022-rtems-coding-period-week-4-gpio-wiki-1f10e5c4458

ADC API

The ADC API was created with the same goal of portability and simplicity as the GPIO API. It supports a number of useful features, such as blocking/non-blocking reading raw value or with transfer function. Users can also configure some ADC parameters like resolution or data alignment.

More details of the ADC API can be found in a separate blog post: https://medium.com/@dtbpkmte/gsoc-2022-rtems-adc-api-d1795e24db05

GPIO and ADC support for STM32F4 BSP

The GPIO and ADC functionalities are implemented for STM32F4 BSP with the new APIs mentioned above. They are tested with the sample applications in my RTEMS sample app repository on STM32F4 Discovery and STM32F446RE Nucleo boards.

The GPIO API, ADC API and implementation for STM32F4 BSP are combined into patch sets.

Link to newest code (v6) in my repo: https://github.com/dtbpkmte/GSoC-2022-RTEMS/commits/hal-and-fixed-simple-console

The version history is below:

lwIP port for STM32F4 BSP

This project aims to port lwIP for STM32F4 BSP. The ported code can also be used for other STM32 chips that use STM32 HAL.

This project has been tested using TCP Echo server example on STM32F4 Discovery board (STM32F407) with DP83848 PHY. Note that these patches require my STM32F4 v6 patches as prerequisite.

From v2, the patch set also improves architecture- and BSP-specific build for the supported BSPs.

Link to newest branch (v4) in my repo: https://github.com/dtbpkmte/GSoC-2022-RTEMS-lwIP/commits/gsoc-v4-2

Other Contribution

I also sent some patches that fix small bugs of RTEMS:

What’s left to do

The project is almost complete. What remains is to continue refining to merge and add documentation to rtems-doc.

After GSoC, I will keep working with RTEMS, specifically rtems-lwip. I want to help developing it and maintain the STM32 port.

I have been having a great time working with RTEMS. I have learned a lot, both technical knowledge and skills from the smart people here. Once again, I want to thank my mentors and RTEMS members for actively and tirelessly helping me with my project (sometimes I feel like I am having so many revisions, but everyone is still very willing to review them xD).

--

--

Duc Doan

Robotics Engineering, Electrical and Computer Engineering, WPI 2024. Contributor at RTEMS, Google Summer of Code 2022.