Skip to main content

Tools, libraries and Submodules

SatNOGS COMMS software utilizes several packages and libraries to work properly which are listed here with a short explanation. Table of contents

Zephyr

Zephyr RTOS is a real-time operating system (RTOS) designed for resource-constrained embedded devices. It’s lightweight, modular, and scalable which makes it suitable for satellites and as a base for satellite firmware, among other things. Zephyr is open source and created under the Linux Foundation. Its documentation can be found here.

SatNOGS COMMS uses Zephyr as a base abstraction layer, on top of which the software operates. For more information on this, take a look at the board support package (BSP) documentation page.

West

West is a versatile command line tool developed for Zephyr, which has its own installation guide and explanation on the SatNOGS COMMS Software

Embedded Template Library (ETL)

The SATNOGS_COMMS sofware features the Embedded Template Library, which provides data structures in C++ where the size is known at compile-time, which was previously reserved for C. Especially for Strings, Stacks and Queues, this library provides useful alternatives to the C++ standard structures.

SatNOGS COMMS code utilizes several features of the ETL, for example the following in the mission.hpp description:

Each hook is defines as an etl::delegate allowing any type of C++ method to be passed (e.g method of an object, static method, C function etc).

Since the STM32H7 has 564kB RAM, code size is predicted to be of no issue, even during operation.

LittleFS

located in workspace/modules/fs/littlefs/lfs.h, the header file also contains a “detailed documentation (or at least as much detail as is currently available)”, according to the LittleFS GitHub. Because of this, it could also be included as a git submodule to keep updating it, however this might also break the setup if it’s fragile (I do not understand the code well enough to tell). The README tells us the following:

A little fail-safe filesystem designed for microcontrollers.

Power-loss resilience - littlefs is designed to handle random power failures. All file operations have strong copy-on-write guarantees and if power is lost the filesystem will fall back to the last known good state.

Dynamic wear leveling - littlefs is designed with flash in mind, and provides wear leveling over dynamic blocks. Additionally, littlefs can detect bad blocks and work around them.

Bounded RAM/ROM - littlefs is designed to work with a small amount of memory. RAM usage is strictly bounded, which means RAM consumption does not change as the filesystem grows. The filesystem contains no unbounded recursion and dynamic memory is limited to configurable buffers that can be provided statically.

OpenOCD and gdb

These are the tools we use for setting up debugging and talking to the board while debugging. One redditor describes these tools like this:

OpenOCD talks to your programming/debugging adapter that is connected to the board. OpenOCD also talks to the gdb-server protocol. This by itself is not a debugger but a high-level protocol used to implement debuggers.

Gdb is the debugger application that connects via gdb-server to your OpenOCD instance. If you enter commands in gdb they will get translated into gdb-server packages, sent over to OpenOCD. OpenOCD will then translate it to something your debugging hardware understands, performs the required actions and send the data back to gdb.

By itself OpenOCD can do a few other things directly (e.g. without using gdb) like reading/writing/verifying flash.”

Protobuf (deprecated in next major update)

Protobuffers are a Google messaging specification that compiles in every language to specify messages, like a header code for messages that can be parsed by every relevant language. This specification makes a lot of sense for us since we send bytes of data over programming languages and want a header to specify what it actually is. for SatNOGS COMMS, it has specified messages but maybe we can build in other messages from other parts of the system as well. But since it is deprecated we will no longer aim to use this.