Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
/ stg-8nn-scaffold Public archive

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

License

Unknown and 3 other licenses found

Licenses found

Unknown
COPYING
AGPL-3.0
COPYING.AGPL3
BSD-3-Clause
COPYING.BSD-3-Clause
GPL-3.0
COPYING.GPL3
Notifications You must be signed in to change notification settings

adolfogc/stg-8nn-scaffold

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

About

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

Resources

License

Unknown and 3 other licenses found

Licenses found

Unknown
COPYING
AGPL-3.0
COPYING.AGPL3
BSD-3-Clause
COPYING.BSD-3-Clause
GPL-3.0
COPYING.GPL3

Stars

Watchers

Forks

Packages

No packages published