- app/
- some_module/
- another_module/
- main.cpp
- common.h
- platform/
- stm32f103-gcc-newlib/
- retarget.cpp
- pic32mx-gcc-newlib/
- pic32mx-xc32/
- stub/
- host/
- platform.h
- boot/
- platform/
- some_module/
- main.cpp
- ci/
- third_party/
- CMSIS/
- freertos/
- printf/
- cjson/
- cmake-build/ <- Not in SCM
- cmake-build-fw/ <- Not in SCM
- CMakeLists.txt
- toolchain-gcc-newlib.cmake
- toolchain-xc32.cmake
- unit_tests.cmake
Here goes the firmware itself, it's business logic and it's own platform specific
initialization. It may be as simple as single main.cpp
or can have complex
functionality split into multiple modules. There is a single main.cpp
suitable
for every platform it is intended to be run on.
All the platform specific code is located in platform/
and can be used
universally across all supported platform by calling functions declared in
platform/platform.h
. The platforms may be various MCUs as well as simulation
running on developer's PC in form of CLI application, graphical application or
some virtual machine like QEMU.
The code that is identical between several platforms may be extracted to a file
and shared as symlink like this: app/platform/pic32mx-xc32/retarget.cpp
->
app/platform/pic32mx-gcc-newlib/retarget.cpp
.
Bootloader code.
The code that is common between a bootloader and an app may be extracted to a file or module and shared as a symlink.