Skip to content
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
36fe485
updated fprime zephyr version
ineskhou Oct 3, 2025
15d6d7a
Initial radio addition
LeStarch Oct 3, 2025
daa9740
Add LoRa transmit
LeStarch Oct 3, 2025
868fc66
Add com delay component
LeStarch Oct 4, 2025
30fe619
Create custom_space_data_link.py
ineskhou Oct 5, 2025
e677465
Allows Makefile with F Prime version and run GDS with camera
ineskhou Oct 5, 2025
b21abcf
Add circuit pass-through
LeStarch Oct 4, 2025
221c9e1
Update to use aggregation
LeStarch Oct 6, 2025
925ea7e
Update to use aggregation
LeStarch Oct 6, 2025
3369a2e
Appease Linter
Mikefly123 Oct 6, 2025
5ecb939
Ran Linter
Mikefly123 Oct 6, 2025
4b868ad
Merge pull request #42 from Open-Source-Space-Foundation/run-make-fmt…
Mikefly123 Oct 6, 2025
b2deade
Fix Submodules
Mikefly123 Oct 7, 2025
a67e02b
Merge branch 'main' into radio
Mikefly123 Oct 7, 2025
f3d422a
Merge branch 'main' into radio
Mikefly123 Oct 8, 2025
690b31c
try
nateinaction Oct 8, 2025
4469434
Apply suggestion from @nateinaction
nateinaction Oct 8, 2025
6c8d5ee
changed the aggregator
ineskhou Oct 8, 2025
bdbc8e5
Merge branch 'radio' of github.com:Open-Source-Space-Foundation/prove…
ineskhou Oct 8, 2025
1b8c4f7
Merge branch 'main' of github.com:open-source-space-foundation/proves…
nateinaction Oct 10, 2025
ceb570f
Revert bootloadertrigger change
nateinaction Oct 10, 2025
2810ace
Merge branch 'main' of github.com:open-source-space-foundation/proves…
nateinaction Oct 11, 2025
72beeda
spacing
nateinaction Oct 11, 2025
60881fa
Merged
LeStarch Oct 12, 2025
6017947
updated instrcutions and flow to run the circuitpython radio example
ineskhou Oct 12, 2025
e9b81b2
Add in com splitter and UART com
LeStarch Oct 12, 2025
e591397
Merge remote-tracking branch 'origin/radio' into radio
LeStarch Oct 12, 2025
caac355
Fix format errors
LeStarch Oct 12, 2025
cd4dcce
letting ComIn be valid
ineskhou Oct 13, 2025
1b34f98
Update to correct miss-aggregations
LeStarch Oct 17, 2025
ce40252
Fix LoRa beaconing
LeStarch Oct 17, 2025
d3dc80f
Update code.py
ineskhou Oct 17, 2025
d918459
Merge branch 'main' into radio
ineskhou Oct 17, 2025
b2a3f3c
Lint
LeStarch Oct 17, 2025
bfa55e5
change back to do bc broncospace is out of cs and need to run integra…
ineskhou Oct 17, 2025
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
2 changes: 2 additions & 0 deletions FprimeZephyrReference/Components/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Include project-wide components here

add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Drv/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ComDelay/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/FatalHandler")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ImuManager/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/NullPrmDb/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Watchdog")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/BootloaderTrigger/")
36 changes: 36 additions & 0 deletions FprimeZephyrReference/Components/ComDelay/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
####
# F Prime CMakeLists.txt:
#
# SOURCES: list of source files (to be compiled)
# AUTOCODER_INPUTS: list of files to be passed to the autocoders
# DEPENDS: list of libraries that this module depends on
#
# More information in the F´ CMake API documentation:
# https://fprime.jpl.nasa.gov/latest/docs/reference/api/cmake/API/
#
####

# Module names are derived from the path from the nearest project/library/framework
# root when not specifically overridden by the developer. i.e. The module defined by
# `Ref/SignalGen/CMakeLists.txt` will be named `Ref_SignalGen`.

register_fprime_library(
AUTOCODER_INPUTS
"${CMAKE_CURRENT_LIST_DIR}/ComDelay.fpp"
SOURCES
"${CMAKE_CURRENT_LIST_DIR}/ComDelay.cpp"
# DEPENDS
# MyPackage_MyOtherModule
)

### Unit Tests ###
# register_fprime_ut(
# AUTOCODER_INPUTS
# "${CMAKE_CURRENT_LIST_DIR}/ComDelay.fpp"
# SOURCES
# "${CMAKE_CURRENT_LIST_DIR}/test/ut/ComDelayTestMain.cpp"
# "${CMAKE_CURRENT_LIST_DIR}/test/ut/ComDelayTester.cpp"
# DEPENDS
# STest # For rules-based testing
# UT_AUTO_HELPERS
# )
71 changes: 71 additions & 0 deletions FprimeZephyrReference/Components/ComDelay/ComDelay.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// ======================================================================
// \title ComDelay.cpp
// \author starchmd
// \brief cpp file for ComDelay component implementation class
// ======================================================================

#include "FprimeZephyrReference/Components/ComDelay/ComDelay.hpp"
#include "FprimeZephyrReference/Components/ComDelay/FppConstantsAc.hpp"

namespace Components {

// ----------------------------------------------------------------------
// Component construction and destruction
// ----------------------------------------------------------------------

ComDelay ::ComDelay(const char* const compName)
: ComDelayComponentBase(compName), m_last_status_valid(false), m_last_status(Fw::Success::FAILURE) {}

ComDelay ::~ComDelay() {}

void ComDelay ::parameterUpdated(FwPrmIdType id) {
switch (id) {
case ComDelay::PARAMID_DIVIDER: {
Fw::ParamValid is_valid;
U8 new_divider = this->paramGet_DIVIDER(is_valid);
if ((is_valid != Fw::ParamValid::INVALID) && (is_valid != Fw::ParamValid::UNINIT)) {
this->log_ACTIVITY_HI_DividerSet(new_divider);
}
} break;
default:
FW_ASSERT(0);
break; // Fallthrough from assert (static analysis)
}
}

// ----------------------------------------------------------------------
// Handler implementations for typed input ports
// ----------------------------------------------------------------------

void ComDelay ::comStatusIn_handler(FwIndexType portNum, Fw::Success& condition) {
this->m_last_status = condition;
this->m_last_status_valid = true;
}

void ComDelay ::run_handler(FwIndexType portNum, U32 context) {
// On the cycle after the tick count is reset, attempt to output any current com status
if (this->m_tick_count == 0) {
bool expected = true;
// Receive the current "last status" validity flag and atomically exchange it with false. This effectively
// "consumes" a valid status. When valid, the last status is sent out.
bool valid = this->m_last_status_valid.compare_exchange_strong(expected, false);
if (valid) {
this->comStatusOut_out(0, this->m_last_status);
this->timeout_out(0, 0);
}
}

// Unless there is corruption, the parameter should always be valid via its default value; however, in the interest
// of failing-safe and continuing some sort of communication we default the current_divisor to the default value.
Fw::ParamValid is_valid;
U8 current_divisor = this->paramGet_DIVIDER(is_valid);

// Increment and module the tick count by the divisor
if ((is_valid == Fw::ParamValid::INVALID) || (is_valid == Fw::ParamValid::UNINIT)) {
current_divisor = Components::DEFAULT_DIVIDER;
}
// Count this new tick, resetting whenever the current count is at or higher than the current divider.
this->m_tick_count = (this->m_tick_count >= current_divisor) ? 0 : this->m_tick_count + 1;
}

} // namespace Components
51 changes: 51 additions & 0 deletions FprimeZephyrReference/Components/ComDelay/ComDelay.fpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
module Components {
constant DEFAULT_DIVIDER = 30
@ A component to delay com status until some further point
passive component ComDelay {
@ Rate schedule port used to trigger radio transmission
sync input port run: Svc.Sched

@ Rate schedule port used to trigger aggregation timeout
output port timeout: Svc.Sched

@ Input comStatus from radio component
sync input port comStatusIn: Fw.SuccessCondition

@ Output comStatus to be called on rate group
output port comStatusOut: Fw.SuccessCondition

@ Divider of the incoming rate tick
param DIVIDER: U8 default DEFAULT_DIVIDER # Start slow i.e. on a 1S tick, transmit every 30S

@ Divider set event
event DividerSet(divider: U8) severity activity high \
format "Set divider to: {}"

###############################################################################
# Standard AC Ports: Required for Channels, Events, Commands, and Parameters #
###############################################################################
@ Port for requesting the current time
time get port timeCaller

@ Port for sending command registrations
command reg port cmdRegOut

@ Port for receiving commands
command recv port cmdIn

@ Port for sending command responses
command resp port cmdResponseOut

@ Port for sending textual representation of events
text event port logTextOut

@ Port for sending events to downlink
event port logOut

@ Port to return the value of a parameter
param get port prmGetOut

@Port to set the value of a parameter
param set port prmSetOut
}
}
61 changes: 61 additions & 0 deletions FprimeZephyrReference/Components/ComDelay/ComDelay.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// ======================================================================
// \title ComDelay.hpp
// \author starchmd
// \brief hpp file for ComDelay component implementation class
// ======================================================================

#ifndef Components_ComDelay_HPP
#define Components_ComDelay_HPP

#include <atomic>
#include "FprimeZephyrReference/Components/ComDelay/ComDelayComponentAc.hpp"

namespace Components {

class ComDelay final : public ComDelayComponentBase {
public:
// ----------------------------------------------------------------------
// Component construction and destruction
// ----------------------------------------------------------------------

//! Construct ComDelay object
ComDelay(const char* const compName //!< The component name
);

//! Destroy ComDelay object
~ComDelay();

private:
void parameterUpdated(FwPrmIdType id //!< The parameter ID
) override;

// ----------------------------------------------------------------------
// Handler implementations for typed input ports
// ----------------------------------------------------------------------

//! Handler implementation for comStatusIn
//!
//! Input comStatus from radio component
void comStatusIn_handler(FwIndexType portNum, //!< The port number
Fw::Success& condition //!< Condition success/failure
) override;

//! Handler implementation for run
//!
//! Rate schedule port used to trigger radio transmission
void run_handler(FwIndexType portNum, //!< The port number
U32 context //!< The call order
) override;

private:
//! Count of incoming run ticks
U8 m_tick_count;
//! Stores if the last status is currently valid
std::atomic<bool> m_last_status_valid;
//! Stores the last status
Fw::Success m_last_status;
};

} // namespace Components

#endif
17 changes: 17 additions & 0 deletions FprimeZephyrReference/Components/ComDelay/docs/sdd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Components::ComDelay

`Components::ComDelay` is a parameterized rate group schedule divider. On the initial run invocation and on each multiple of the divider thereafter any received com status is sent out. This effectively delays the com status until the next (divided) run call.

# 1 Requirements

| Requirement ID | Description | Validation |
|----------------|----------------------------------------------------------------------|------------|
| COM_DELAY_001 | The `Svc::ComDelay` component shall accept com status in. | Unit-Test |
| COM_DELAY_002 | The `Svc::ComDelay` component shall emit com status once for each DIVIDER number of rate group ticks. | Unit-Test |
| COM_DELAY_003 | The `Svc::ComDelay` component shall set the DIVIDER via a parameter. | Unit-Test |

# 2 Parameters

| Name | Description |
|---------|-----------------------------------------------------------|
| DIVIDER | Number of rate group ticks received before sending status |
36 changes: 36 additions & 0 deletions FprimeZephyrReference/Components/NullPrmDb/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
####
# F Prime CMakeLists.txt:
#
# SOURCES: list of source files (to be compiled)
# AUTOCODER_INPUTS: list of files to be passed to the autocoders
# DEPENDS: list of libraries that this module depends on
#
# More information in the F´ CMake API documentation:
# https://fprime.jpl.nasa.gov/latest/docs/reference/api/cmake/API/
#
####

# Module names are derived from the path from the nearest project/library/framework
# root when not specifically overridden by the developer. i.e. The module defined by
# `Ref/SignalGen/CMakeLists.txt` will be named `Ref_SignalGen`.

register_fprime_library(
AUTOCODER_INPUTS
"${CMAKE_CURRENT_LIST_DIR}/NullPrmDb.fpp"
SOURCES
"${CMAKE_CURRENT_LIST_DIR}/NullPrmDb.cpp"
# DEPENDS
# MyPackage_MyOtherModule
)

### Unit Tests ###
# register_fprime_ut(
# AUTOCODER_INPUTS
# "${CMAKE_CURRENT_LIST_DIR}/NullPrmDb.fpp"
# SOURCES
# "${CMAKE_CURRENT_LIST_DIR}/test/ut/NullPrmDbTestMain.cpp"
# "${CMAKE_CURRENT_LIST_DIR}/test/ut/NullPrmDbTester.cpp"
# DEPENDS
# STest # For rules-based testing
# UT_AUTO_HELPERS
# )
29 changes: 29 additions & 0 deletions FprimeZephyrReference/Components/NullPrmDb/NullPrmDb.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// ======================================================================
// \title NullPrmDb.cpp
// \author starchmd
// \brief cpp file for NullPrmDb component implementation class
// ======================================================================

#include "FprimeZephyrReference/Components/NullPrmDb/NullPrmDb.hpp"

namespace Components {

// ----------------------------------------------------------------------
// Component construction and destruction
// ----------------------------------------------------------------------

NullPrmDb ::NullPrmDb(const char* const compName) : NullPrmDbComponentBase(compName) {}

NullPrmDb ::~NullPrmDb() {}

// ----------------------------------------------------------------------
// Handler implementations for typed input ports
// ----------------------------------------------------------------------

Fw::ParamValid NullPrmDb ::getPrm_handler(FwIndexType portNum, FwPrmIdType id, Fw::ParamBuffer& val) {
return Fw::ParamValid::INVALID;
}

void NullPrmDb ::setPrm_handler(FwIndexType portNum, FwPrmIdType id, Fw::ParamBuffer& val) {}

} // namespace Components
10 changes: 10 additions & 0 deletions FprimeZephyrReference/Components/NullPrmDb/NullPrmDb.fpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module Components {
@ Null parameter database
passive component NullPrmDb {
@ Port to get parameter values
sync input port getPrm: Fw.PrmGet

@ Port to update parameters
sync input port setPrm: Fw.PrmSet
}
}
52 changes: 52 additions & 0 deletions FprimeZephyrReference/Components/NullPrmDb/NullPrmDb.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// ======================================================================
// \title NullPrmDb.hpp
// \author starchmd
// \brief hpp file for NullPrmDb component implementation class
// ======================================================================

#ifndef Components_NullPrmDb_HPP
#define Components_NullPrmDb_HPP

#include "FprimeZephyrReference/Components/NullPrmDb/NullPrmDbComponentAc.hpp"

namespace Components {

class NullPrmDb final : public NullPrmDbComponentBase {
public:
// ----------------------------------------------------------------------
// Component construction and destruction
// ----------------------------------------------------------------------

//! Construct NullPrmDb object
NullPrmDb(const char* const compName //!< The component name
);

//! Destroy NullPrmDb object
~NullPrmDb();

private:
// ----------------------------------------------------------------------
// Handler implementations for typed input ports
// ----------------------------------------------------------------------

//! Handler implementation for getPrm
//!
//! Port to get parameter values
Fw::ParamValid getPrm_handler(FwIndexType portNum, //!< The port number
FwPrmIdType id, //!< Parameter ID
Fw::ParamBuffer& val //!< Buffer containing serialized parameter value.
//!< Unmodified if param not found.
) override;

//! Handler implementation for setPrm
//!
//! Port to update parameters
void setPrm_handler(FwIndexType portNum, //!< The port number
FwPrmIdType id, //!< Parameter ID
Fw::ParamBuffer& val //!< Buffer containing serialized parameter value
) override;
};

} // namespace Components

#endif
Loading