Key Points

  • Using JSON text files for flight software parameters simplifies creating, editing and viewing parameter files.
  • Basecamp uses FreeRTOS’ coreJSON library that is an efficient and standards compliant JSON parser.
  • Basecamp’s application framework library wraps the coreJSON library with an API that simplifies flight software app development.
  • Basecamp apps use JSON for initialization parameter files and table parameter files.

Introduction

Flight software applications often have configuration parameters that can be changed during runtime.  Groups of parameters are called tables. The core Flight System (cFS) uses binary data for table files and the cFS framework provides a table service for loading and dumping application tables. Initial table values are populated during the flight software build process. New tables can be created using the build process or with a custom editor that translates human readable data (i.e. text) into binary data. Viewing tables that have been dumped and transferred to the ground requires a tool that translates the binary data into text.

JSON Motivation

JSON helps support the following Basecamp goals:

  1. Minimize the complexities of the cFS flight and ground system environments so educators can focus on lesson material and not get bogged down with cumbersome workflows.
  2. Provide automated application integration so educational projects can include groups of apps that teach system level concepts.

For goal #1 consider a lesson that requires modifying an app’s parameter table.  Using Basecamp’s File Browser students transfer flight table to the ground, edit the table in a built-in text editor, transfer the modified table to flight and issue a table load command to the app.  There are no extra steps due to binary-to-text translations and no need for customized tools.

To meet goal #2, command and telemetry message Identifiers are managed by the cFS build process because the message IDs are defined in JSON initialization parameter files.   This convention in conjunction with application JSON spec files allows Basecamp to automatically integrate apps into cFS targets.

Initialization Parameter Files

Basecamp’s initialization parameter files are JSON files that define application runtime configurations and are read by apps during their startup process.  If a configuration parameter impacts a data structure, then it must be defined in a C header file.  This delineation of build versus runtime initialization helps clarify a parameter’s role and scope. As a result, Basecamp app’s have very few parameters defined in C header files and runtime configurations can be changed without rebuilding an app.  In addition, an app’s configuration can be changed in a running system by changing an initialization parameter and restarting the app.

Application Parameter Tables

If an application has several parameters that can be configured during runtime they are typically grouped into a table as opposed to having multiple commands that can change parameters.  The cFS’ Table Service supports loading and dumping an app’s binary table image.  Basecamp apps do not use the cFS Table Service. Application tables are defined in JSON and apps manage tables using Basecamp’s application framework library Table Manager.  All table management ‘plumbing’ is performed by the library and apps provide callback functions that perform data-specific processing.

Related Articles

  1. cFS Basecamp App JSON Initialization Files
  2. cFS Basecamp App JSON Parameter Tables

Curated Links

  1. JSON Tutorial
    https://www.tutorialspoint.com/json/index.htm
  2. FreeRTOS core JSON
    https://www.freertos.org/Documentation/03-Libraries/03-FreeRTOS-core/07-coreJSON/01-coreJSON

Discover more from Space Steps

Subscribe now to keep reading and get access to the full archive.

Continue reading