Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
3b44eb0
added burnwire component (2)
ineskhou Sep 4, 2025
112d6b4
impl from sdd
ineskhou Sep 4, 2025
f5fbe3d
appease linter
ineskhou Sep 4, 2025
7c11e85
Readme with notes to the connecty stuff to be refined and edited and …
ineskhou Sep 5, 2025
488b01c
added rate group
ineskhou Sep 5, 2025
a96b548
feedback from deign review
ineskhou Sep 5, 2025
afefe1d
added input ports
ineskhou Sep 5, 2025
f83271a
appease linter, remove test files
ineskhou Sep 9, 2025
27b172f
finished the writeup and appeased the linter
ineskhou Sep 10, 2025
aefa120
cleared writeer
ineskhou Sep 10, 2025
29e3fe5
added open back in bc make was being sad
ineskhou Sep 10, 2025
35ea0db
tests folder gone fix
ineskhou Sep 11, 2025
2e45917
Merge branch 'main' of github.com:Open-Source-Space-Foundation/proves…
ineskhou Sep 23, 2025
6bce30c
appease linter
ineskhou Sep 23, 2025
24f2f7c
merge
ineskhou Sep 23, 2025
04267f1
appease linters
ineskhou Sep 24, 2025
9612639
port and command call same functions
ineskhou Sep 24, 2025
0f536f7
properlly parameters for REAL
ineskhou Sep 24, 2025
adbfd7c
ypdated dosc and edflt value
ineskhou Oct 2, 2025
094792b
appease linters
ineskhou Oct 2, 2025
9b36eab
Merge branch 'main' of github.com:Open-Source-Space-Foundation/proves…
ineskhou Oct 6, 2025
8a6c4ad
got the param propertlu, added tests
ineskhou Oct 6, 2025
38a228b
removed the old example guide
ineskhou Oct 6, 2025
cc87a1a
Update sdd.md
ineskhou Oct 6, 2025
48d4a55
Incorperated Feedback (1)
ineskhou Oct 8, 2025
ff93cc6
make clearnere
ineskhou Oct 8, 2025
8e11715
trying to pass int tests
ineskhou Oct 8, 2025
9d2b20c
change where we clear commit histroy:
ineskhou Oct 8, 2025
4396e59
remove 2 check
ineskhou Oct 8, 2025
b5604eb
checking which test
ineskhou Oct 8, 2025
c5d8396
added how long was it event
ineskhou Oct 8, 2025
63beefa
correct clean=r histroies order, stop in a function
ineskhou Oct 8, 2025
cb074c9
added sleep in case issue with events happening too late
ineskhou Oct 8, 2025
2318eeb
assert seperate line than event
ineskhou Oct 8, 2025
5429e54
correct burnwire command
ineskhou Oct 8, 2025
1b9c971
no reset
ineskhou Oct 8, 2025
0edf20e
coorect OIMPORTS
ineskhou Oct 8, 2025
bc05006
remove sleeps
ineskhou Oct 8, 2025
e3e7257
remove command box
ineskhou Oct 8, 2025
edbce4f
added back the reset start
ineskhou Oct 8, 2025
70f4265
making the command response happen first
ineskhou Oct 8, 2025
4a82847
actually the burnwire this time
ineskhou Oct 8, 2025
12f4a21
remove other []
ineskhou Oct 8, 2025
aedaed7
changed ordering, added checks for every event that should hapen
ineskhou Oct 8, 2025
c400d30
longer wait for more events after startup
ineskhou Oct 8, 2025
1812ab9
no stop
ineskhou Oct 8, 2025
493f729
event numbers
ineskhou Oct 8, 2025
0bba563
trying to gap stop event adn clean
ineskhou Oct 8, 2025
3dd9aa5
clear histories first
ineskhou Oct 8, 2025
be62bcb
send no asser command
ineskhou Oct 8, 2025
3ea2381
remove all params
ineskhou Oct 8, 2025
76df28f
see reacieved events
ineskhou Oct 8, 2025
b885ae7
linkt
ineskhou Oct 8, 2025
531c4b5
rename run last
ineskhou Oct 8, 2025
bef77a5
put parameter back
ineskhou Oct 8, 2025
c9d69ac
send and assert command
ineskhou Oct 8, 2025
55ebb06
made second
ineskhou Oct 8, 2025
4237bbc
imu at the end
ineskhou Oct 8, 2025
8593802
put it back
ineskhou Oct 8, 2025
d2a7c41
Merge branch 'main' of github.com:Open-Source-Space-Foundation/proves…
ineskhou Oct 8, 2025
3dadcf0
added start gds
ineskhou Oct 8, 2025
a717117
remover reset
ineskhou Oct 8, 2025
32848f2
reset gds
ineskhou Oct 8, 2025
ee7e868
resert burnwire
ineskhou Oct 8, 2025
0a2973c
burnwerie
ineskhou Oct 8, 2025
9a0e869
formatting
hrfarmer Oct 9, 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
84 changes: 84 additions & 0 deletions FprimeZephyrReference/Components/Burnwire/Burnwire.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
// ======================================================================
// \title Burnwire.cpp
// \brief cpp file for Burnwire component implementation class
// ======================================================================

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

namespace Components {

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

Burnwire ::Burnwire(const char* const compName) : BurnwireComponentBase(compName) {
this->m_safetyCounter = 0;
this->m_state = Fw::On::OFF;
}

Burnwire ::~Burnwire() {}

// ----------------------------------------------------------------------
// Handler implementations for typed input ports
// ----------------------------------------------------------------------
void Burnwire ::burnStart_handler(FwIndexType portNum) {
this->startBurn();
}

void Burnwire ::burnStop_handler(FwIndexType portNum) {
this->stopBurn();
}

void Burnwire::startBurn() {
this->log_ACTIVITY_HI_SetBurnwireState(Fw::On::ON);
this->m_safetyCounter = 0;
this->m_state = Fw::On::ON;

Fw::ParamValid valid;
U32 timeout = this->paramGet_SAFETY_TIMER(valid);
this->log_ACTIVITY_HI_SafetyTimerState(timeout);
}

void Burnwire::stopBurn() {
this->log_ACTIVITY_HI_SetBurnwireState(Fw::On::OFF);
this->gpioSet_out(0, Fw::Logic::LOW);
this->gpioSet_out(1, Fw::Logic::LOW);

this->m_state = Fw::On::OFF;
this->log_ACTIVITY_LO_BurnwireEndCount(m_safetyCounter);
}

void Burnwire ::schedIn_handler(FwIndexType portNum, U32 context) {
Fw::ParamValid valid;
U32 timeout = this->paramGet_SAFETY_TIMER(valid);

if (this->m_state == Fw::On::ON) {
this->m_safetyCounter++;
if (this->m_safetyCounter == 1) {
this->gpioSet_out(0, Fw::Logic::HIGH);
this->gpioSet_out(1, Fw::Logic::HIGH);
this->log_ACTIVITY_HI_SafetyTimerStatus(Fw::On::ON);
}

if (this->m_safetyCounter >= timeout) {
stopBurn();
this->log_ACTIVITY_HI_SafetyTimerStatus(Fw::On::OFF);
}
}
}

// ----------------------------------------------------------------------
// Handler implementations for commands
// ----------------------------------------------------------------------

void Burnwire ::START_BURNWIRE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) {
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
this->startBurn();
}

void Burnwire ::STOP_BURNWIRE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) {
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
this->stopBurn();
}

} // namespace Components
75 changes: 75 additions & 0 deletions FprimeZephyrReference/Components/Burnwire/Burnwire.fpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
module Components {
@ Turns Burnwire on and off
passive component Burnwire {

@ START_BURNWIRE turns on the burnwire
sync command START_BURNWIRE(
)

@ STOP_BURNWIRE turns on the burnwire
sync command STOP_BURNWIRE(
)

event SetBurnwireState(burnwire_state: Fw.On) \
severity activity high \
format "Burnwire State: {}"

event SafetyTimerStatus(burnwire_state: Fw.On) \
severity activity high\
format "Safety Timer State: {} "

event SafetyTimerState(burnwire_status: U32) \
severity activity high\
format "Safety Timer Will Burn For: {} Seconds"

event BurnwireEndCount(end_count: U32) \
severity activity low \
format "Burnwire Burned for {} Seconds"

@ Port getting start signal
sync input port burnStart: Fw.Signal

@ Port getting stop signal
sync input port burnStop: Fw.Signal

@ Input Port to get the rate group
sync input port schedIn: Svc.Sched

@ Port sending calls to the GPIO driver to stop and start the burnwire
output port gpioSet: [2] Drv.GpioWrite

# @ SAFETY_TIMER parameter is the maximum time that the burn component will run
param SAFETY_TIMER: U32 default 10

###############################################################################
# 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 for sending telemetry channels to downlink
telemetry port tlmOut

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

@Port to set the value of a parameter
param set port prmSetOut

}
}
70 changes: 70 additions & 0 deletions FprimeZephyrReference/Components/Burnwire/Burnwire.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// ======================================================================
// \title Burnwire.hpp
// \brief hpp file for Burnwire component implementation class
// ======================================================================

#ifndef Components_Burnwire_HPP
#define Components_Burnwire_HPP

#include <atomic>
#include "FprimeZephyrReference/Components/Burnwire/BurnwireComponentAc.hpp"

namespace Components {

class Burnwire final : public BurnwireComponentBase {
public:
// ----------------------------------------------------------------------
// Component construction and destruction
// ----------------------------------------------------------------------

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

//! Destroy Burnwire object
~Burnwire();

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

//! Handler implementation for burnStart
//!
//! Port getting start signal
void burnStart_handler(FwIndexType portNum //!< The port number
) override;

//! Handler implementation for burnStop
//!
//! Port getting stop signal
void burnStop_handler(FwIndexType portNum //!< The port number
) override;

void schedIn_handler(FwIndexType portNum, //!< The port number
U32 context //!< The call order
) override;

void startBurn();

void stopBurn();

private:
// ----------------------------------------------------------------------
// Handler implementations for commands
// ----------------------------------------------------------------------

//! Handler implementation for command START_BURNWIRE
void START_BURNWIRE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) override;

//! Handler implementation for command STOP_BURNWIRE
void STOP_BURNWIRE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) override;

Fw::On m_state = Fw::On::OFF; // keeps track if burnwire is on or off
std::atomic<U32> m_safetyCounter; // makes this an atomic variable (so its set only in one command),
// you read and write half the value bc a corrupted read could be dangerouts
};

} // namespace Components

#endif
36 changes: 36 additions & 0 deletions FprimeZephyrReference/Components/Burnwire/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}/Burnwire.fpp"
SOURCES
"${CMAKE_CURRENT_LIST_DIR}/Burnwire.cpp"
# DEPENDS
# MyPackage_MyOtherModule
)

### Unit Tests ###
# register_fprime_ut(
# AUTOCODER_INPUTS
# "${CMAKE_CURRENT_LIST_DIR}/Burnwire.fpp"
# SOURCES
# "${CMAKE_CURRENT_LIST_DIR}/test/ut/BurnwireTestMain.cpp"
# "${CMAKE_CURRENT_LIST_DIR}/test/ut/BurnwireTester.cpp"
# DEPENDS
# STest # For rules-based testing
# UT_AUTO_HELPERS
# )
62 changes: 62 additions & 0 deletions FprimeZephyrReference/Components/Burnwire/docs/sdd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Components::Burnwire

Driving the Burnwire on and off. This component activates the two pins that are required to heat the burnwire resisitor. The burnwire deployment will be handled by the Antenna Deployment, that will call the ports in the burnwire deployment. For testing, the commands to directly call the burnwire have been left in.

Burnwire is agnostic to the ideal safety count, it simply sets it to be whatever the port or command passes onto

## Sequence Diagrams
Add sequence diagrams here

## Requirements
Add requirements in the chart below
| Name | Description | Validation |
| ---- | ----------- | ------ |
|BW-001|The burnwire shall turn on and off in response to a port calls (TBR for antenna deployer component) |Hardware Test|
|BW-002|The burnwire shall turn on and off in response to commands (TBR for testing for now) |Hardware Test|
|BW-003|The burnwire component shall provide an event when it is turned on and off |Integration Test|
|BW-004|The burnwire component shall activate by turning both the GPIO pins that activate the burnwire | Hardware Test|
|BW-005|The burnwire component shall be controlled by a safety timeout attached to a 1Hz rate group |Integration Test|
|BW-006|The safety timeout shall emit an event when it is changes | Integration test|
|BW-007|The burnwire safety time shall emit an event when it starts and stops |Integration Test|

## Port Descriptions
Name | Type | Description |
|----|---|---|
|burnStop|`Fw::Signal`|Receive stop signal to stop the burnwire|
|burnStart|`Fw::Signal`|Receive start signal to start burnwire|
|gpioSet|`Drv::GpioWrite`|Control GPIO state to driver|
|schedIn|[`Svc::Sched`]| run | Input | Synchronous | Receive periodic calls from rate group|


## Commands
| Name | Description |
| ---- | ----------- |
|START_BURNWIRE|Starts the Burn|
|STOP_BURNWIRE|Stops the Burn|

## Events
| Name | Description |
|---|---|
|SetBurnwireState| Emits burnwire state when the burnwire turns on or off|
|SafetyTimerStatus| Emits safety timer state when the Safety Time has stopped or started|
|SafetyTimerState| Emits the amount of time the safety time will run for when it starts|
| BurnwireEndCount| How long the burnwire actually burned for |

## Component States
Add component states in the chart below
| Name | Description |
|----|---|
|m_state|Keeps track if the burnwire is on or off|

## Tests
Add unit test descriptions in the chart below
| Name | Description | Output | Coverage |
|------|-------------|--------|----------|
|TestSafety|Tests Burnwire turns off after SAFETY_TIMER seconds|Integration|---|
|TestSafety|Tests Burnwire emits correct events after start and stop|Integration|---|


## Parameter
| Name | Description |
| -----|-------------|
| SAFETY_TIMER | By Default set in fpp (currently 10) is the max time the burnwire should ever run|
1 change: 1 addition & 0 deletions FprimeZephyrReference/Components/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Drv/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/FatalHandler")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ImuManager/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Watchdog")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Burnwire/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/BootloaderTrigger/")
6 changes: 4 additions & 2 deletions FprimeZephyrReference/Components/Watchdog/Watchdog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,21 @@ void Watchdog ::stop_handler(FwIndexType portNum) {
// ----------------------------------------------------------------------

void Watchdog ::START_WATCHDOG_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) {
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);

// call start handler
this->start_handler(0);

// Provide command response
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
}

void Watchdog ::STOP_WATCHDOG_cmdHandler(FwOpcodeType opCode, U32 cmdSeq) {
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);

// call stop handler
this->stop_handler(0);

// Provide command response
this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK);
}

} // namespace Components
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include <zephyr/drivers/gpio.h>

static const struct gpio_dt_spec ledGpio = GPIO_DT_SPEC_GET(DT_NODELABEL(led0), gpios);
static const struct gpio_dt_spec burnwire0Gpio = GPIO_DT_SPEC_GET(DT_NODELABEL(burnwire0), gpios);
static const struct gpio_dt_spec burnwire1Gpio = GPIO_DT_SPEC_GET(DT_NODELABEL(burnwire1), gpios);

// Allows easy reference to objects in FPP/autocoder required namespaces
using namespace ReferenceDeployment;
Expand Down Expand Up @@ -55,6 +57,8 @@ void configureTopology() {
rateGroup1Hz.configure(rateGroup1HzContext, FW_NUM_ARRAY_ELEMENTS(rateGroup1HzContext));

gpioDriver.open(ledGpio, Zephyr::ZephyrGpioDriver::GpioConfiguration::OUT);
gpioBurnwire0.open(burnwire0Gpio, Zephyr::ZephyrGpioDriver::GpioConfiguration::OUT);
gpioBurnwire1.open(burnwire1Gpio, Zephyr::ZephyrGpioDriver::GpioConfiguration::OUT);
}

// Public functions for use in main program are namespaced with deployment name ReferenceDeployment
Expand Down
6 changes: 6 additions & 0 deletions FprimeZephyrReference/ReferenceDeployment/Top/instances.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,10 @@ module ReferenceDeployment {
instance lsm6dsoManager: Drv.Lsm6dsoManager base id 0x10019000

instance bootloaderTrigger: Components.BootloaderTrigger base id 0x10020000

instance burnwire: Components.Burnwire base id 0x10021000

instance gpioBurnwire0: Zephyr.ZephyrGpioDriver base id 0x10022000

instance gpioBurnwire1: Zephyr.ZephyrGpioDriver base id 0x10023000
}
Loading