F Prime Getting Started
Getting Started with F´
3 min readAug 2, 2022
Enviroment
Linux: Ubuntu LTS 20.04
FPrime: latest / branch: devel
Python: 3.9.11
CMake: 3.24.0
OpenSSL: 1.1.1f
Steps
- Generate a native build
- Implement component
- Implement unit test
- Build component
- Build deployment
- Perform unit test
- Run the deployment
Generate components
cd fprime/Ref/SignalGen
fprime-util generate
Implement and build components
fprime-util impl
fprime-util impl --ut
fprime-util build
Build Deployment
cd fprime/Ref
fprime-util build
Perform Unit Test
cd fprime/Ref
fprime-util generate --utcd fprime/Ref/SignalGen
fprime-util build --ut
fprime-util check
Running the deployment
./build-artifacts/Linux/bin/Ref
# ctrl-C to exit the application
It should be like this, before showing errors.
Description
Terminology
- Port
- A connection between Components
- Act as a defined interface to a component - Component
- The location of program behavior
- May define Commands, Event, Channels, and Parameters - Topology
- A set of Components and connections
- Represents the full F’ system - Event
- AKA EVR
- A history of the system
- Defined pre-component - Channel
- Represents current system state
- Defined pre-component - Command
- Consist of opcode, mnemonic, and arguments
- Defined pre-component - Deployment
- A single instance of F’, represents one build/executable - Build Directory/Build Cache
- Created byFprime-util
- Required to build CMake projects - Ground System
- A computer system to collect data from F’ deployment - Toolchain
- A set of build tools to build for a specific architecture
Deployment process
- Design any unique ports for the Components
- The port can be built and compiled to make sure it is correct
- The port will be entirely auto-generated
- Usually perform unit test until component level - Design Components
- Specifying Ports, Commands, Events, Channels
- The design is already in-place in the user guide
- the design is inRef
directory - Implement the code
- Runs the F’ tool suite to generate template stubs
- Unit test tubs generate in the same way
- Test tubs could be generated and implemented before Component’s code
Finally, the Component is integrated into the deployment and the entire deployment may be built and installed.
Working the F´ Development Process with fprime-util
- Build Cache Generation
- It’s a setup step, not development process
- Typically done once for each platfom
- Usegenerate
subcommand to run the tool
- It takes the toolchain file used in CMake as an optional argument
- Thenative
toolchain will be used and F´ will be setup to run on the current platform - To generate a native build
cd fprime/Ref
fprime-util generate
This will create 2 standard builds
- standard build
- unit test build
User won’t need to generate their own CMake build caches
Generate Cross-Compile of the Ref Application for Raspberry PI Platform
- Provide the CMake toolchain argument “raspberrypi”
- Raspberry PI setup steps
cd fprime/Ref
fprime-util generate raspberrypi
Creating Implementation Stubs
- Using
impl
to generate the stubbed implementations of a Component’s C++ file - No need to passing a toolchain in this step as the templates are platform independent
cd fprime/Ref/SignalGen
fprime-util impl
- This will creat
<Component>Impl.cpp-template
and<Component>Impl.hpp-template
- The file is ready for C++ developement
- The command assume a default build has been generated
Creating Unit Test Implementations
- Using
Impl --ut
generate the stubbed implementations for creating unit test for Component - This step is also platform independent
Generating Unit Test Stubs of SignalGen
- This step will create some
.cpp
and.hpp
files in a sub folder /test/ut - The command assume a default build has been generated
cd fprime/Ref/SignalGen
fprime-util impl --ut
Building Components and Deployments
- After implemented, we need to build the component and test it.
- This command will build to “current directory”
cd fprime/Ref/SignalGen
fprime-util build
Build Ref Deployment
- cd to the deployment directory and run the
build
command
cd fprime/Ref
fprime-util build
Building and Running Unit Tests
generate
the unit test cachebuild
the unit test and run withcheck
cd fprime/Ref
fprime-util generate --utcd fprime/Ref/SignalGen
fprime-util build --ut
fprime-util check