Skip to main content

Board Support Packages

warning

🚧 This document is still being actively worked on and is subject to change. 🚧

Responsible
  • Sebastian Pfeilr
Last Updated10/12/2025, 12:48:54 PM
Last AuthorKai Berszin

The board support packages are organized in the directory bsp/<bsp-name>/. Each board upport package provides:

  1. device_tree.h, which lists common defines for devices
  2. CMakeLists.txt, which includes the bsp specific Makefile generated from CubeMx
  3. the directories Drivers as well as Core which contain the generated code from CubeMX.

A Board Support Package is selected either through a preset in the root json file or via specifying the name of the board support package as the OBC_TARGET_PLATFORM.

Supported Boards​

Creating a BSP from a .ioc file​

  1. Create a new subdirectory in bsp/ wich the name of the new board.
  2. move the ioc file into that directory.
  3. CubeMX settings: 3.1 NVIC settings for freertos:
    • TODO 3.2 Tools Tab
    • Generate as pair of .c/.h files
    • Only copy necessary library files
    • delete unused library files
    • CMakeProject
  4. Generate Code
  5. run tools/fix_cubemx_files.py in the sage-obc-sw directory. it changes the references to CURRENT_SOURCE_DIR in the generated CMakeFiles.txt to use the BSP directory variable instead.
  6. create the bsp level CMakeLists.txt which only includes bsp/<name>/cmake/stm32cubemx.

Toolchain​

The toolchain file is unified between all board support packages inside of bsp/shared/toolchain.cmake.

Discussion Points​

  • Should the device_tree.h file exists? It is useful for multiple different configurations, but once we are only working on the latest OBC revision and are solidifying the codebase maybe every driver with device access should probably privately declare the necessary extern T handles.