MCPcopy Create free account
hub / github.com/DISTORTEC/distortos

github.com/DISTORTEC/distortos @v0.7.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.7.0 ↗ · + Follow
6,246 symbols 11,188 edges 842 files 1,930 documented · 31% updated 10d agov0.7.0 · 2019-05-05★ 4684 open issues

Browse by type

Functions 5,157 Types & classes 1,089
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

distortos Build Status

object-oriented C++ RTOS for microcontrollers

Homepage

Documentation

Source Code @ GitHub

Forum

Configuration & building

To configure & build distortos you need: - CMake (version 3.7 or later); - a build tool supported by CMake - it is highly recommended to use Ninja; - arm-none-eabi bleeding-edge-toolchain (GCC version 5 or later);

distortos tries to follow typical CMake cross-compiling workflow, which means that you always have to use a so-called toolchain file. Toolchain files in distortos also serve another purpose - they select the board which is going to be used by your application.

  1. Download source package of distortos in zip or tar.gz format and extract it;
  2. Create a build folder, for example output;
  3. From within the build folder, initialize it with CMake, for example with cmake .. -DCMAKE_TOOLCHAIN_FILE=../source/board/ST_STM32F4DISCOVERY/Toolchain-ST_STM32F4DISCOVERY.cmake -GNinja if you want a default configuration or cmake -C../configurations/ST_STM32F4DISCOVERY/test/distortosConfiguration.cmake .. -GNinja if you want to start from a saved configuration;
  4. Edit distortos configuration with a tool of your choice, for example cmake-gui .. (a GUI application) or ccmake .. (curses-based application);
  5. Execute selected build tool, for example ninja or ninja -v if you want to see all command lines while building;

You can obviously replace step 1 with git clone https://github.com/DISTORTEC/distortos.

Steps 2-4 can be all done from within cmake-gui. After starting the application use Browse Source... button to select the folder with distortos and Browse Build... button to select the build folder. Then click on Configure button. In the CMakeSetup window which appears select the generator of your choice and make sure that Specify toolchain file for cross-compiling is selected before going any further. Click Next and specify the toolchain file (which also selects the board), for example `

/source/board/ST_STM32F4DISCOVERY/Toolchain-ST_STM32F4DISCOVERY.cmake` and click Finish button.

Test application

The default target of build - all - is just the static library with distortos libdistortos.a. If you want to build the test application, specify distortosTest as the target (for example ninja distortosTest if you use Ninja).

tl;dr

$ wget https://github.com/DISTORTEC/distortos/archive/master.tar.gz
$ tar -xf master.tar.gz
$ cd distortos-master
$ mkdir output
$ cd output
$ cmake .. -DCMAKE_TOOLCHAIN_FILE=../source/board/ST_STM32F4DISCOVERY/Toolchain-ST_STM32F4DISCOVERY.cmake -GNinja
$ cmake-gui ..
$ ninja

or

$ wget https://github.com/DISTORTEC/distortos/archive/master.tar.gz
$ tar -xf master.tar.gz
$ cd distortos-master
$ mkdir output
$ cd output
$ cmake -C../configurations/ST_STM32F4DISCOVERY/test/distortosConfiguration.cmake .. -GNinja
$ cmake-gui ..
$ ninja

Generating board

To generate a board you need: - Python (version 2.7, version 3.6 or later); - Jinja2 template engine for Python (version 2.10 or later); - ruamel.yaml YAML loader/dumper package for Python;

Both Jinja2 and ruamel.yaml can be easily installed with pip install jinja2 && pip install ruamel.yaml (or python -m pip install jinja2 followed by python -m pip install ruamel.yaml on Windows), however they may also be available in the package manager of your system.

Board generator - scripts/generateBoard.py - takes a *.yaml file as an input and produces a folder containing various board files: source files, headers, CMake files (including CMake toolchain file) and so on. The input *.yaml file describes the board hardware in a tree-like form. The idea is very close to devicetree and in fact earlier versions of board generator used devicetree files.

To get an idea about the format of the board YAML files, take a look at some of the existing files, for example source/board/ST_STM32F4DISCOVERY/ST_STM32F4DISCOVERY.yaml - which describes STM32F4DISCOVERY board from ST - or source/chip/STM32/STM32F4/chipYaml/ST_STM32F407VG.yaml - which describes STM32F407VG chip used on this board. There is also some documentation about YAML bindings in documentation/yaml-bindings

Assuming that you already have distortos either as part of your project or as a standalone folder, the basic invocation of the board generator is just path/to/distortos/scripts/generateBoard.py path/to/board.yaml (or python path/to/distortos/scripts/generateBoard.py path/to/board.yaml on Windows), for example ./scripts/generateBoard.py source/board/ST_STM32F4DISCOVERY/ST_STM32F4DISCOVERY.yaml. You may also generate so-called raw-boards, using chip YAML file as the input directly, for example ./scripts/generateBoard.py source/chip/STM32/STM32F4/chipYaml/ST_STM32F407VG.yaml -o output/path/of/raw/board.

Core symbols most depended-on inside this repo

Shape

Function 3,027
Method 2,130
Class 1,017
Enum 72

Languages

C++96%
Python2%
C2%

Modules by API surface

unit-test/external/Catch2/catch.hpp1,141 symbols
unit-test/external/Trompeloeil/trompeloeil.hpp258 symbols
source/architecture/ARM/ARMv6-M-ARMv7-M/external/CMSIS/cmsis_gcc.h136 symbols
source/board/ST_32F769IDISCOVERY/ST_32F769IDISCOVERY-vectorTable.cpp120 symbols
source/architecture/ARM/ARMv6-M-ARMv7-M/external/CMSIS/cmsis_armclang_ltm.h110 symbols
source/board/ST_32F746GDISCOVERY/ST_32F746GDISCOVERY-vectorTable.cpp108 symbols
source/board/ST_NUCLEO-F429ZI/ST_NUCLEO-F429ZI-vectorTable.cpp101 symbols
source/board/ST_32F429IDISCOVERY/ST_32F429IDISCOVERY-vectorTable.cpp101 symbols
source/board/ST_NUCLEO-F446RE/ST_NUCLEO-F446RE-vectorTable.cpp96 symbols
source/devices/memory/SdCard.cpp95 symbols
source/board/ST_STM32F4DISCOVERY/ST_STM32F4DISCOVERY-vectorTable.cpp92 symbols
source/board/ST_NUCLEO-L476RG/ST_NUCLEO-L476RG-vectorTable.cpp92 symbols

For agents

$ claude mcp add distortos \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page