Code repository for the Goose VI general platform board for the electrical architecture.
git clone https://github.com/waterloop/G6-MCU-Platform-Board.git
cd G6-MCU-Platform-Board
git submodule update --init --recursive
Each supported device has its own corresponding directory. To build for a particular device,
pass the device directory into make
using the DEV
variable.
For example:
make DEV=STM32G473CBTx
The build will generate the following:
- Object files contained in
build/objects
- A standalone executable in
build/standalone
- A static library in
build/platform
to be linked with an application
Intellisense and autocomplete are available through the clangd
language server. It is supported on
most modern editors.
If you use VSCode, there exists an extension for it.
clangd
is already installed on your vagrant VMs.
It also easily installed through apt and brew if you like.
clangd
uses the auto-generated file compile_commands.json
to provide intellisense and autocomplete.
This file is gitignored in this repository, so you will need to generate it yourself if you want
intellisense. This can be easily done using bear
, which is pre-installed on your vagrant VMS.
# this is an example, can replace DEV with whatever device you need
bear -- make DEV=STM32G473CBTx
Write your code in the platform
directory.
You can auto-generate HW initialization code using STM32CubeMX, but only code in the
platform
directory will be put into the static library. This means that you will have
to wrap (copy and paste, lol) any auto-generated code that you need into the platform
directory.
The executable main.elf
in the build/standalone
directory - if flashed onto HW - will
run the platform layer by itself (with no application layer). This will prove useful for testing.
Some useful makefile targets for developers include:
make analyze # provides an object dump of the standalone executable `main.elf`
make flash # flash the standalone executable onto HW if an ST-Link programmer is connected
The "main" makefile is in the project's root directory. It simply a wrapper to call other makefiles, which are located in the device directories.
The BUILD_DIR
variable is passed into the device makefiles, which do the actual building.
You can use the existing makefiles as a template of sorts if you ever need to write a makefile to support a new device.