GitXplorerGitXplorer
a

stg-8nn-scaffold

public
6 stars
1 forks
0 issues

Commits

List of commits on branch main.
Unverified
23aa1fe00b8ab2c01a94b15e0f20700177156d0b

update STM32CubeF0 to v1.11.5

aadolfogc committed 7 months ago
Unverified
36e96d32f2791e48faa794ccefac78fcdb26c2ba

update QP/C to v7.3.4

aadolfogc committed 7 months ago
Unverified
fd026dfac5b79d62cc6838fa3974df6c1f11b94e

update QP/C

aadolfogc committed 9 months ago
Unverified
066dec15d40483726f3c37fe08e316e9fdb39525

update project layout in CMakeLists.txt

aadolfogc committed 9 months ago
Unverified
bf57850a59234eaa0cd262911c663dfdf965ffcb

Update QP/C

aadolfogc committed 9 months ago
Unverified
3332ef204d5d44aaf38e45c8fa0c8c7134e3519b

Update QP/C

aadolfogc committed a year ago

README

The README file for this repository.

STG-8nn-Scaffold

A base project for programming the BARTH® STG-8nn mini-PLCs.

Note (2024): this project will no longer be updated.

Motivation

This project serves as a scaffold to make firmware in C for the BARTH® STG-8nn mini-PLCs, using macOS or Linux + Docker as the development platform. For an example on how to use this project, refer to the one provided in the stg-8nn-scaffold-example repository.

Design Goals

  • Use a modern embedded real-time framework, i.e., Quantum Leaps's QP™/C.
  • Use Linux or macOS as the development platform.
  • Use the DroneCAN protocol over CAN bus for communication.

Main Software Components

You should be acquainted with the QP™/C framework, DroneCAN and their concepts in order to use this project effectively.

Building instructions

Hardware

Getting the code

git clone https://github.com/adolfogc/stg-8nn-scaffold.git
cd stg-8nn-scaffold
git submodule init
git submodule update --init --recursive

Getting the toolchain and the flashing utility

See .devcontainer directory.

Compiling the project

GNU Arm:

mkdir build && cd build
cmake -DSTG_MODEL:STRING=850 -DCMAKE_TOOLCHAIN_FILE=arm-gcc-toolchain.cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -GNinja ..
cmake --build .

LLVM Arm:

mkdir build && cd build
cmake -DSTG_MODEL:STRING=850 -DCMAKE_TOOLCHAIN_FILE=arm-clang-toolchain.cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -GNinja ..
cmake --build .
  1. Compilation database

The above commands use the -DCMAKE_EXPORT_COMPILE_COMMANDS=ON flag so that CMake generates a compilation database. You can use it to check how the source files will get compiled by inspecting the generated file compile_commands.json. Also, other tools like Cppcheck and Clang-Tidy use this file.

Flashing the firmware

# Flash it using openocd:
openocd \
  -f ../openocd/stm32f0x-stlinkv2.cfg \
  -f ../openocd/stm32f0x-utils.cfg \
  -c "custom_flash firmware.bin" \
  -c "shutdown"

# Flash it using st-flash (currently not working for me):
st-flash write firmware.bin 0x0800000

License

AGPL-3

For more information see COPYING.

References

A compilation of some useful references that were consulted when creating this project is available in the doc/REFERENCES.md file.