Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
05fe3d8
Refactor LoRa: Move async FSM to lora_async.c
ETSells Jun 22, 2026
277aa0f
Update tests
ETSells Jun 22, 2026
d77c0bc
Merge branch 'ES/lora-refactor' into integration/state-estims-telemetry
ETSells Jun 22, 2026
5fe54d1
Merge branch 'main' into integration/state-estims-telemetry
ETSells Jun 22, 2026
e8e2644
Pull up submoduiles (for CI)
ETSells Jun 22, 2026
ddb13e6
Remap Z axis to vertical
NArmistead Jun 10, 2026
5b0bac0
Move new sensor init to sensor_calibrate
NArmistead Jun 19, 2026
5511e7d
Remove IMU_DATA
NArmistead Jun 22, 2026
f2accae
Minor incomplete test mock changes
NArmistead Jun 22, 2026
dac52e5
Remove baro velo
NArmistead Jun 22, 2026
21efa37
Pull up submodules
NArmistead Jun 22, 2026
99fe196
Update integration tests
ETSells Jun 22, 2026
41e34d8
Pull up mod
ETSells Jun 22, 2026
29c9f5f
Fix tests
ETSells Jun 22, 2026
b0dd24f
Initialize LoRa before entering flight state
ETSells Jun 22, 2026
8059231
Pull up driver
ETSells Jun 22, 2026
79686aa
Rename mount orientation enum
NArmistead Jun 24, 2026
8483f40
Correct sensor calib with axis remap
NArmistead Jun 29, 2026
c069020
oops -Werror (fix CI)
NArmistead Jun 29, 2026
12a74d0
Pull up mod
NArmistead Jul 1, 2026
c52b410
Resolve bug where the flight computer would crash on startup if LoRa …
ETSells Jul 5, 2026
f6fa5f0
Pull up emulator
ETSells Jul 5, 2026
2458909
fix: Unit tests
ETSells Jul 5, 2026
8a9886c
Add ground station emulator
ETSells Jul 6, 2026
f000f42
Pull up emulator
ETSells Jul 6, 2026
e13c984
Pull up submodules
ETSells Jul 6, 2026
4fdb507
Add LoRa/telem verification to flight_int test
ETSells Jul 6, 2026
e58c355
Add CodeQL to try to track down the memory bug
ETSells Jul 6, 2026
5f2e54d
Pull up emulator to fix OBO
ETSells Jul 6, 2026
ff61f41
Pull up mod
ETSells Jul 6, 2026
67643a2
Pull up driver and add driver tests to project-level CI
ETSells Jul 6, 2026
7511d07
Pull up driver/test_framework
ETSells Jul 6, 2026
5c2b45f
Pull up emulator
ETSells Jul 7, 2026
880b211
coast detect z to x one liner, pull up mod
NArmistead Jul 9, 2026
6e11f3e
Pull up mod
ETSells Jul 11, 2026
d9dcfea
Test updates + submodule pullup
ETSells Jul 11, 2026
d79aef7
Pull up mod
ETSells Jul 14, 2026
f331337
Corrections to mount orientation
NArmistead Jul 20, 2026
4a547e0
test stub for mount orientation, pull up driver
NArmistead Jul 20, 2026
45209a8
Hopefully better way to do orientation
NArmistead Jul 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 102 additions & 33 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
# supported CodeQL languages.
#
name: "CodeQL Advanced"

on:
push:
branches: [ "main" ]
branches: [ "main", "integration/**" ]
pull_request:
branches: [ "main" ]
branches: [ "main", "integration/**" ]
schedule:
- cron: '41 0 * * 1'

jobs:
analyze:
name: Analyze (${{ matrix.language }})
Expand All @@ -27,18 +27,18 @@ jobs:
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
runs-on: ubuntu-latest
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
Expand All @@ -60,15 +60,26 @@ jobs:
uses: actions/checkout@v6
with:
submodules: 'recursive'

# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
# or others). This is typically only required for manual builds.
# - name: Setup runtime (example)
# uses: actions/setup-example@v1

# Initializes the CodeQL tools for scanning.
- name: Check out firmware compiler
if: matrix.language == 'c-cpp'
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: '13.3.Rel1' # <-- The compiler release to use
- name: Check out X11 tools for emulator build
if: matrix.language == 'c-cpp'
run: |
sudo apt-get update
sudo apt-get install -y libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxcb-xinput-dev libxi-dev

# ------------------------------------------------------------------
# Non-c-cpp languages (e.g. 'actions'): single init / build / analyze
# ------------------------------------------------------------------
- name: Initialize CodeQL
if: matrix.language != 'c-cpp'
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
Expand All @@ -79,33 +90,91 @@ jobs:
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
- name: Check out firmware compiler
uses: carlosperate/arm-none-eabi-gcc-action@v1

- name: Perform CodeQL Analysis
if: matrix.language != 'c-cpp'
uses: github/codeql-action/analyze@v4
with:
release: '13.3.Rel1' # <-- The compiler release to use

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- name: Run manual build steps
if: matrix.build-mode == 'manual'
category: "/language:${{matrix.language}}"

# ------------------------------------------------------------------
# c-cpp: split into three databases/categories so rev2, rev3, and the
# emulator build show up as separate results in code scanning instead
# of being merged into a single combined database.
# ------------------------------------------------------------------

# --- rev2 release build ---
- name: Initialize CodeQL (rev2 release)
if: matrix.language == 'c-cpp'
uses: github/codeql-action/init@v4
with:
languages: c-cpp
build-mode: manual
config: |
paths-ignore:
- auto

- name: Build rev2 release
if: matrix.language == 'c-cpp'
shell: bash
run: |
# Release Build
cd app/rev2
make DEBUG=0

# Rev 3 Test App (drivers)
cd ../rev3

- name: Analyze rev2 release
if: matrix.language == 'c-cpp'
uses: github/codeql-action/analyze@v4
with:
category: "/language:c-cpp/rev2"

# --- rev3 test app (drivers) ---
- name: Initialize CodeQL (rev3)
if: matrix.language == 'c-cpp'
uses: github/codeql-action/init@v4
with:
languages: c-cpp
build-mode: manual
config: |
paths-ignore:
- auto

- name: Build rev3 test app
if: matrix.language == 'c-cpp'
shell: bash
run: |
cd app/rev3
make

- name: Perform CodeQL Analysis

- name: Analyze rev3
if: matrix.language == 'c-cpp'
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{matrix.language}}"
category: "/language:c-cpp/rev3"

# --- emulator build ---
- name: Initialize CodeQL (emulator)
if: matrix.language == 'c-cpp'
uses: github/codeql-action/init@v4
with:
languages: c-cpp
build-mode: manual
config: |
paths-ignore:
- auto

- name: Build emulator
if: matrix.language == 'c-cpp'
shell: bash
run: |
cd app/rev2
make clean
make emulator

- name: Analyze emulator
if: matrix.language == 'c-cpp'
uses: github/codeql-action/analyze@v4
with:
category: "/language:c-cpp/emulator"
49 changes: 47 additions & 2 deletions .github/workflows/test-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
permissions:
contents: read
jobs:
unit-tests:
app-unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -63,6 +63,51 @@ jobs:
run: echo 'Artifact ID is ${{ steps.promote-results.outputs.artifact-id }}'
- run: echo "🍏 This job's status is ${{ job.status }}."

driver-unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
tests: [gps, servo]
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }}."
- name: Install test environment
run: |
python -m pip install --upgrade pip
pip install gcovr
- name: Check out FCF repository code
uses: actions/checkout@v6
with:
ref: ${{ github.event.inputs.fw-branch || github.ref }}
submodules: 'recursive'
- run: echo "💡 The repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ github.workspace }}

- name: Build and run the appa/${{ matrix.tests }} tests
run: |
cd ${{ github.workspace }}/driver/_test/driver/${{ matrix.tests }}
make test
- name: Check for fails.
run: |
cd ${{ github.workspace }}/driver/_test/driver/${{ matrix.tests }}
tail -3 results.txt | grep "Result: PASS"
- name: Consolidate ${{ matrix.tests }} artifacts
run: mv ${{ github.workspace }}/driver/_test/driver/${{ matrix.tests }}/results.txt ${{ github.workspace }}/driver/_test/driver/${{ matrix.tests }}/coverage/results.txt
- name: "Promote Artifacts"
uses: actions/upload-artifact@v6
id: promote-results
with:
name: ${{ matrix.tests }}-artifacts
path: ${{ github.workspace }}/driver/_test/driver/${{ matrix.tests }}/coverage/
include-hidden-files: true
- name: Output artifact ID
run: echo 'Artifact ID is ${{ steps.promote-results.outputs.artifact-id }}'
- run: echo "🍏 This job's status is ${{ job.status }}."

emulator-tests:
runs-on: ubuntu-latest
timeout-minutes: 7
Expand Down Expand Up @@ -162,7 +207,7 @@ jobs:
# Take coverage reports and merge them
consolidate-coverage:
runs-on: ubuntu-latest
needs: [unit-tests, emulator-tests]
needs: [app-unit-tests, driver-unit-tests, emulator-tests]
steps:
- name: Install gcovr
run: |
Expand Down
4 changes: 4 additions & 0 deletions app/rev2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ $(DRIVER_DIR)/ignition/ignition.c \
$(DRIVER_DIR)/imu/imu.c \
$(DRIVER_DIR)/led/led.c \
$(DRIVER_DIR)/lora/lora.c \
$(DRIVER_DIR)/lora/lora_async.c \
$(MOD_DIR)/sensor/sensor.c \
$(DRIVER_DIR)/usb/usb.c \
$(DRIVER_DIR)/gps/gps.c \
Expand Down Expand Up @@ -131,8 +132,11 @@ $(BASE_DIR)/emulator/src/emulator_timer.c \
$(BASE_DIR)/emulator/src/emulator_error.c \
$(BASE_DIR)/emulator/src/emulator_init.c \
$(BASE_DIR)/emulator/src/emulator_gpio.c \
$(BASE_DIR)/emulator/src/emulator_ground_station.c \
$(BASE_DIR)/emulator/src/emulator_uart.c \
$(BASE_DIR)/emulator/src/emulator_spi.c \
$(BASE_DIR)/emulator/src/emulator_lora.c \
$(BASE_DIR)/emulator/src/emulator_serial.c \
$(BASE_DIR)/emulator/src/emulator_i2c.c \
$(BASE_DIR)/emulator/src/emulator_gui.c \
$(BASE_DIR)/emulator/src/shaders/shaders.c \
Expand Down
8 changes: 3 additions & 5 deletions app/rev2/flash_appa.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ idx = 6;
if ( preset_data.config_settings.enabled_data & STORE_CONV )
{
memcpy( &buffer[idx],
&sensor_data.imu_data.imu_converted,
&sensor_data.imu_converted,
sizeof( IMU_CONVERTED ));
idx += sizeof( IMU_CONVERTED );
memcpy( &buffer[idx], &sensor_data.baro_pressure, sizeof(float));
Expand All @@ -321,13 +321,11 @@ if ( preset_data.config_settings.enabled_data & STORE_CONV )
if ( preset_data.config_settings.enabled_data & STORE_STATE_ESTIM )
{
memcpy( &buffer[idx],
&sensor_data.imu_data.state_estimate,
&sensor_data.state_estimate,
sizeof( STATE_ESTIMATION ));
idx += sizeof( STATE_ESTIMATION );
memcpy( &buffer[idx], &sensor_data.baro_alt, sizeof(float));
idx += 4;
memcpy( &buffer[idx], &sensor_data.baro_velo, sizeof(float));
idx += 4;
}

if ( preset_data.config_settings.enabled_data & STORE_GPS )
Expand Down Expand Up @@ -400,7 +398,7 @@ if ( preset_data.config_settings.enabled_data & STORE_CONV )
if ( preset_data.config_settings.enabled_data & STORE_STATE_ESTIM )
{
size += sizeof( STATE_ESTIMATION );
size += 2 * sizeof( float ); /* baro alt/velo */
size += sizeof( float ); /* baro alt */
}

if ( preset_data.config_settings.enabled_data & STORE_GPS )
Expand Down
34 changes: 30 additions & 4 deletions app/rev2/flight.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ Includes
#include <math.h>
#include "main.h"
#include "led.h"
#include "lora.h"
#include "usb.h"
#include "math.h"
#include "sensor.h"
#include "buzzer.h"
#include "debug_sdr.h"
#include "error_sdr.h"
#include "ignition.h"
#include "telemetry.h"
Expand Down Expand Up @@ -137,6 +139,8 @@ void flight_calib
uint32_t* flash_address
)
{
LORA_STATUS lora_status = LORA_OK;

led_set_color( LED_YELLOW );
buzzer_multi_beeps(50, 50, 4);

Expand All @@ -150,6 +154,28 @@ sensorCalibrationSWCON();
write_preset( flash_handle, flash_address );
flash_erase_preserve_preset( flash_handle, flash_address );

if ( preset_data.config_settings.enabled_features & WIRELESS_TRANSMISSION_ENABLED )
{
if( !lora_is_lora_initialized() )
{
lora_status = lora_configure( &preset_data.lora_preset );
debug_assert( lora_status == LORA_OK, ERROR_LORA_INIT_ERROR );
}

/* If the modem fails to configure, disable TX in RAM (but do not write back to flash) */
if( lora_status != LORA_OK )
{
preset_data.config_settings.enabled_features &= ~WIRELESS_TRANSMISSION_ENABLED;

/* Give an indication */
led_set_color(LED_RED);
buzzer_multi_beeps(400, 200, 3);
led_set_color(LED_YELLOW);
}

lora_fsm_set_mode( LORA_ASYNC_TX );
}

fc_state_update( FC_STATE_LAUNCH_DETECT );

} /* flight_calib */
Expand Down Expand Up @@ -202,11 +228,11 @@ if ( ( fc_state == FC_STATE_ASCENT )
update_state();

/*------------------------------------------------------------------------------
Update Telemetry FSM
Update LoRa FSM
------------------------------------------------------------------------------*/
if ( preset_data.config_settings.enabled_features & WIRELESS_TRANSMISSION_ENABLED )
{
telemetry_update( TELEMETRY_EVENT_SYNCHRONOUS_UPDATE );
lora_fsm_update( LORA_FSM_EVENT_SYNCHRONOUS_UPDATE );
}

/*------------------------------------------------------------------------------
Expand Down Expand Up @@ -357,8 +383,8 @@ uint8_t max_range_4 = preset_data.servo_preset.rp_servo4 + preset_data.config_se
uint8_t min_range_4 = preset_data.servo_preset.rp_servo4 - preset_data.config_settings.control_max_deflection_angle;

/* Read velocity and body state from sensor */
float velocity = sensor_data.imu_data.state_estimate.velocity;
float roll_rate = sensor_data.imu_data.imu_converted.gyro_x;
float velocity = sensor_data.state_estimate.velocity;
float roll_rate = sensor_data.imu_converted.gyro_x;

/* Get timing */
pid_delta = HAL_GetTick() - pid_previous;
Expand Down
Loading
Loading