RISCV_K210.mk - GaloisInc/betaflight GitHub Wiki

Purpose of this document

This document is meant to describe the purpose of and the content found within the MCU make files. There is also a brief overview of the MCU makefile our team created for the new Maixbit target.

MCU makefiles

Each type of microprocessor supported by Betaflight has its own MCU makefile. These files are located within make/MCU. The general purpose of these MCU makefiles is to provide MCU-specific source files needed to boot and run programs on each of the supported MCU. Each MCU model needs its own makefile because each model uses different source files.MCU source files include vendor-supplied peripheral driver software, assembly startup files, and linker scripts.

Additionally, the MCU makefiles are where device-specific compiler and linker flags are set. Each MCU makefile follows a similar structure to source.mk; source files, flags, and other data are saved as variables that get accessed by the top-level Makefile during the make process.

MAIXBIT.mk

Our team created an MCU makefile for our Maixbit target which utilizes a K210 RISC-V microprocessor. This file is similar to the other MCU makefiles, but it points to RISC-V resources instead of ARM. We’ve added a few custom variables which point to peripheral header files, and also added a variable to create a .map during the make process. We’ve intentionally kept the Maixbit makefile as similar to the others as possible to conform with Betaflight’s make process.