diff --git a/PROVESFlightControllerReference/Components/DetumbleManager/DetumbleManager.cpp b/PROVESFlightControllerReference/Components/DetumbleManager/DetumbleManager.cpp index bdc7a72d..9881e73c 100644 --- a/PROVESFlightControllerReference/Components/DetumbleManager/DetumbleManager.cpp +++ b/PROVESFlightControllerReference/Components/DetumbleManager/DetumbleManager.cpp @@ -104,7 +104,7 @@ void DetumbleManager ::systemModeChanged_handler(FwIndexType portNum, const Comp // Handler implementations for commands // ---------------------------------------------------------------------- -void DetumbleManager ::SET_MODE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, Components::DetumbleMode mode) { +void DetumbleManager ::SET_MODE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Components::DetumbleMode& mode) { this->setMode_handler(0, mode); this->cmdResponse_out(opCode, cmdSeq, Fw::CmdResponse::OK); } diff --git a/PROVESFlightControllerReference/Components/DetumbleManager/DetumbleManager.hpp b/PROVESFlightControllerReference/Components/DetumbleManager/DetumbleManager.hpp index 7fc6db31..6a36efc6 100644 --- a/PROVESFlightControllerReference/Components/DetumbleManager/DetumbleManager.hpp +++ b/PROVESFlightControllerReference/Components/DetumbleManager/DetumbleManager.hpp @@ -60,7 +60,7 @@ class DetumbleManager final : public DetumbleManagerComponentBase { //! Command to set the operating mode void SET_MODE_cmdHandler(FwOpcodeType opCode, //!< The opcode U32 cmdSeq, //!< The command sequence number - Components::DetumbleMode mode) override; + const Components::DetumbleMode& mode) override; public: // ---------------------------------------------------------------------- diff --git a/PROVESFlightControllerReference/Components/Drv/RtcManager/RtcManager.cpp b/PROVESFlightControllerReference/Components/Drv/RtcManager/RtcManager.cpp index 0f1ec5d0..b4b945f8 100644 --- a/PROVESFlightControllerReference/Components/Drv/RtcManager/RtcManager.cpp +++ b/PROVESFlightControllerReference/Components/Drv/RtcManager/RtcManager.cpp @@ -102,7 +102,7 @@ void RtcManager ::timeGetPort_handler(FwIndexType portNum, Fw::Time& time) { // Handler implementations for commands // ---------------------------------------------------------------------- -void RtcManager ::TIME_SET_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, Drv::TimeData t) { +void RtcManager ::TIME_SET_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Drv::TimeData& t) { // Check device readiness if (!device_is_ready(this->m_dev)) { // Emit device not ready event @@ -188,7 +188,7 @@ void RtcManager ::parameterUpdated(FwPrmIdType id) { this->log_ACTIVITY_HI_TimeBaseChanged(timeBase); } -void RtcManager ::ALARM_SET_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, Drv::TimeData t) { +void RtcManager ::ALARM_SET_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Drv::TimeData& t) { // retrieve info about current alarm uint16_t mask = this->m_curr_mask; diff --git a/PROVESFlightControllerReference/Components/Drv/RtcManager/RtcManager.hpp b/PROVESFlightControllerReference/Components/Drv/RtcManager/RtcManager.hpp index 2af3e9cc..686728e2 100644 --- a/PROVESFlightControllerReference/Components/Drv/RtcManager/RtcManager.hpp +++ b/PROVESFlightControllerReference/Components/Drv/RtcManager/RtcManager.hpp @@ -65,17 +65,17 @@ class RtcManager final : public RtcManagerComponentBase { //! Handler implementation for command TIME_SET //! //! TIME_SET command to set the time on the RTC - void TIME_SET_cmdHandler(FwOpcodeType opCode, //!< The opcode - U32 cmdSeq, //!< The command sequence number - Drv::TimeData t //!< Set the time + void TIME_SET_cmdHandler(FwOpcodeType opCode, //!< The opcode + U32 cmdSeq, //!< The command sequence number + const Drv::TimeData& t //!< Set the time ) override; //! Handler implementation for command ALARM_SET //! //! ALARM_SET command to set an alarm on the RTC - void ALARM_SET_cmdHandler(FwOpcodeType opCode, //!< The opcode - U32 cmdSeq, //!< The command sequence number - Drv::TimeData t //!< Time to set the alarm for + void ALARM_SET_cmdHandler(FwOpcodeType opCode, //!< The opcode + U32 cmdSeq, //!< The command sequence number + const Drv::TimeData& t //!< Time to set the alarm for ) override; //! Handler implementation for command ALARM_CANCEL diff --git a/PROVESFlightControllerReference/Components/ModeManager/ModeManager.cpp b/PROVESFlightControllerReference/Components/ModeManager/ModeManager.cpp index d5581ee3..38ddef70 100644 --- a/PROVESFlightControllerReference/Components/ModeManager/ModeManager.cpp +++ b/PROVESFlightControllerReference/Components/ModeManager/ModeManager.cpp @@ -38,8 +38,7 @@ ModeManager ::ModeManager(const char* const compName) ModeManager ::~ModeManager() {} -void ModeManager ::init(FwSizeType queueDepth, FwEnumStoreType instance) { - ModeManagerComponentBase::init(queueDepth, instance); +void ModeManager ::restorePersistentState() { this->loadState(); } @@ -150,7 +149,8 @@ void ModeManager ::runSafeModeSequence() { Fw::ParamValid is_valid; Fw::ParamString safe_mode_sequence = this->paramGet_SAFEMODE_SEQUENCE_FILE(is_valid); FW_ASSERT(is_valid == Fw::ParamValid::VALID || is_valid == Fw::ParamValid::DEFAULT); - this->runSequence_out(0, safe_mode_sequence); + const Svc::SeqArgs no_args; + this->runSequence_out(0, safe_mode_sequence, no_args); } void ModeManager ::completeSequence_handler(FwIndexType portNum, diff --git a/PROVESFlightControllerReference/Components/ModeManager/ModeManager.hpp b/PROVESFlightControllerReference/Components/ModeManager/ModeManager.hpp index 8da80d43..722aa24b 100644 --- a/PROVESFlightControllerReference/Components/ModeManager/ModeManager.hpp +++ b/PROVESFlightControllerReference/Components/ModeManager/ModeManager.hpp @@ -29,10 +29,13 @@ class ModeManager : public ModeManagerComponentBase { //! Destroy ModeManager object ~ModeManager(); - //! Initialize the component - void init(FwSizeType queueDepth, //!< Queue depth for async ports - FwEnumStoreType instance = 0 //!< Instance ID - ); + //! Restore persisted mode and bring the hardware in line with it + //! + //! Must be called from the topology after ports are connected and the GPIO + //! drivers are open. This does real I/O -- it drives the load switches -- + //! so it cannot run from init(), which the topology calls before + //! connectComponents() and configureTopology(). + void restorePersistentState(); private: // ---------------------------------------------------------------------- diff --git a/PROVESFlightControllerReference/Components/SBand/SBand.cpp b/PROVESFlightControllerReference/Components/SBand/SBand.cpp index dddca577..9423da53 100644 --- a/PROVESFlightControllerReference/Components/SBand/SBand.cpp +++ b/PROVESFlightControllerReference/Components/SBand/SBand.cpp @@ -308,7 +308,7 @@ SBand::Status SBand ::configureRadio() { // Handler implementations for commands // ---------------------------------------------------------------------- -void SBand ::TRANSMIT_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, SBandTransmitState enabled) { +void SBand ::TRANSMIT_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const SBandTransmitState& enabled) { // Invoke internal port to handle state change asynchronously // This prevents concurrent access issues with m_transmit_enabled this->deferredTransmitCmd_internalInterfaceInvoke(enabled); diff --git a/PROVESFlightControllerReference/Components/SBand/SBand.hpp b/PROVESFlightControllerReference/Components/SBand/SBand.hpp index a60c01fe..cbc2aa1d 100644 --- a/PROVESFlightControllerReference/Components/SBand/SBand.hpp +++ b/PROVESFlightControllerReference/Components/SBand/SBand.hpp @@ -81,7 +81,7 @@ class SBand final : public SBandComponentBase { //! Handler implementation for command TRANSMIT //! //! Start/stop transmission on the S-Band module - void TRANSMIT_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, SBandTransmitState enabled) override; + void TRANSMIT_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const SBandTransmitState& enabled) override; private: //! Enable receive mode diff --git a/PROVESFlightControllerReference/Components/StartupManager/StartupManager.cpp b/PROVESFlightControllerReference/Components/StartupManager/StartupManager.cpp index 128f92bd..c81e42a6 100644 --- a/PROVESFlightControllerReference/Components/StartupManager/StartupManager.cpp +++ b/PROVESFlightControllerReference/Components/StartupManager/StartupManager.cpp @@ -189,17 +189,23 @@ Fw::Time StartupManager ::get_uptime() { return time; } -void StartupManager ::startupsequenceStarted_handler(FwIndexType portNum, const Fw::StringBase& fileName) { +void StartupManager ::startupsequenceStarted_handler(FwIndexType portNum, + const Fw::StringBase& fileName, + const Svc::SeqArgs& args) { (void)portNum; this->onSequenceStarted(fileName); } -void StartupManager ::safeModeSequenceStarted_handler(FwIndexType portNum, const Fw::StringBase& fileName) { +void StartupManager ::safeModeSequenceStarted_handler(FwIndexType portNum, + const Fw::StringBase& fileName, + const Svc::SeqArgs& args) { (void)portNum; this->onSequenceStarted(fileName); } -void StartupManager ::payloadSequenceStarted_handler(FwIndexType portNum, const Fw::StringBase& fileName) { +void StartupManager ::payloadSequenceStarted_handler(FwIndexType portNum, + const Fw::StringBase& fileName, + const Svc::SeqArgs& args) { (void)portNum; this->onSequenceStarted(fileName); } @@ -291,7 +297,8 @@ void StartupManager ::run_handler(FwIndexType portNum, U32 context) { Fw::ParamString first_sequence = this->paramGet_STARTUP_SEQUENCE_FILE(is_valid); FW_ASSERT(is_valid == Fw::ParamValid::VALID || is_valid == Fw::ParamValid::DEFAULT); - this->runSequence_out(0, first_sequence); + const Svc::SeqArgs no_args; + this->runSequence_out(0, first_sequence, no_args); this->m_transmit_enable_ticks = this->paramGet_TRANSMIT_ENABLE_TICKS(is_valid); FW_ASSERT(is_valid == Fw::ParamValid::VALID || is_valid == Fw::ParamValid::DEFAULT); } else if (!this->m_boot_count_persisted) { diff --git a/PROVESFlightControllerReference/Components/StartupManager/StartupManager.hpp b/PROVESFlightControllerReference/Components/StartupManager/StartupManager.hpp index e0185cbc..dca7a7cd 100644 --- a/PROVESFlightControllerReference/Components/StartupManager/StartupManager.hpp +++ b/PROVESFlightControllerReference/Components/StartupManager/StartupManager.hpp @@ -78,8 +78,9 @@ class StartupManager final : public StartupManagerComponentBase { ) override; //! Handler implementation for startupsequenceStarted - void startupsequenceStarted_handler(FwIndexType portNum, //!< The port number - const Fw::StringBase& fileName //!< The file path for start-up sequence + void startupsequenceStarted_handler(FwIndexType portNum, //!< The port number + const Fw::StringBase& fileName, //!< The file path for start-up sequence + const Svc::SeqArgs& args //!< Sequence arguments ) override; //! Handler implementation for safeModeCompleteSequence @@ -90,8 +91,9 @@ class StartupManager final : public StartupManagerComponentBase { ) override; //! Handler implementation for safeModeSequenceStarted - void safeModeSequenceStarted_handler(FwIndexType portNum, //!< The port number - const Fw::StringBase& fileName //!< The sequence file + void safeModeSequenceStarted_handler(FwIndexType portNum, //!< The port number + const Fw::StringBase& fileName, //!< The sequence file + const Svc::SeqArgs& args //!< Sequence arguments ) override; //! Handler implementation for payloadCompleteSequence @@ -102,8 +104,9 @@ class StartupManager final : public StartupManagerComponentBase { ) override; //! Handler implementation for payloadSequenceStarted - void payloadSequenceStarted_handler(FwIndexType portNum, //!< The port number - const Fw::StringBase& fileName //!< The sequence file + void payloadSequenceStarted_handler(FwIndexType portNum, //!< The port number + const Fw::StringBase& fileName, //!< The sequence file + const Svc::SeqArgs& args //!< Sequence arguments ) override; //! Handler implementation for loraFirstStart diff --git a/PROVESFlightControllerReference/Components/TcSecurityDeframer/TcSecurityDeframer.cpp b/PROVESFlightControllerReference/Components/TcSecurityDeframer/TcSecurityDeframer.cpp index 11a5a036..7734fd80 100644 --- a/PROVESFlightControllerReference/Components/TcSecurityDeframer/TcSecurityDeframer.cpp +++ b/PROVESFlightControllerReference/Components/TcSecurityDeframer/TcSecurityDeframer.cpp @@ -95,8 +95,10 @@ void TcSecurityDeframer ::dataIn_handler(FwIndexType portNum, Fw::Buffer& data, // end = last octet of the Transfer Frame Data Field (excluding Security Trailer) // Unverified frames are forwarded with authenticated=false; the router enforces // the reject-or-bypass policy. - data.setData(data.getData() + Ccsds355_0_B_2::kTCSecurityHeaderSize); - data.setSize(data.getSize() - Ccsds355_0_B_2::kTCSecurityHeaderSize - Ccsds355_0_B_2::kTCSecurityTrailer); + // advance() consumes the leading Security Header: it moves the offset forward and + // shrinks the size by the same amount, so only the trailer is left to trim. + data.advance(Ccsds355_0_B_2::kTCSecurityHeaderSize); + data.setSize(data.getSize() - Ccsds355_0_B_2::kTCSecurityTrailer); this->dataOut_out(0, data, contextOut); } @@ -106,8 +108,10 @@ void TcSecurityDeframer ::dataReturnIn_handler(FwIndexType portNum, const ComCfg::FrameContext& context) { // Restore the original buffer pointer and size stripped in dataIn_handler so the // upstream BufferManager deallocates the exact allocation it originally handed out. - data.setData(data.getData() - Ccsds355_0_B_2::kTCSecurityHeaderSize); - data.setSize(data.getSize() + Ccsds355_0_B_2::kTCSecurityHeaderSize + Ccsds355_0_B_2::kTCSecurityTrailer); + // Rewinding restores the header bytes to the represented data, so only the trailer + // needs adding back to recover the original allocation extents. + data.advance(-static_cast(Ccsds355_0_B_2::kTCSecurityHeaderSize)); + data.setSize(data.getSize() + Ccsds355_0_B_2::kTCSecurityTrailer); this->dataReturnOut_out(0, data, context); } diff --git a/PROVESFlightControllerReference/ReferenceDeployment/Top/CMakeLists.txt b/PROVESFlightControllerReference/ReferenceDeployment/Top/CMakeLists.txt index e0af332f..1c2a0b7c 100644 --- a/PROVESFlightControllerReference/ReferenceDeployment/Top/CMakeLists.txt +++ b/PROVESFlightControllerReference/ReferenceDeployment/Top/CMakeLists.txt @@ -13,6 +13,7 @@ register_fprime_module( AUTOCODER_INPUTS "${CMAKE_CURRENT_LIST_DIR}/instances.fpp" + "${CMAKE_CURRENT_LIST_DIR}/system.fpp" "${CMAKE_CURRENT_LIST_DIR}/topology.fpp" "${CMAKE_CURRENT_LIST_DIR}/ReferenceDeploymentPackets.fppi" SOURCES diff --git a/PROVESFlightControllerReference/ReferenceDeployment/Top/ReferenceDeploymentPackets.fppi b/PROVESFlightControllerReference/ReferenceDeployment/Top/ReferenceDeploymentPackets.fppi index 5ca221ec..bc25df67 100644 --- a/PROVESFlightControllerReference/ReferenceDeployment/Top/ReferenceDeploymentPackets.fppi +++ b/PROVESFlightControllerReference/ReferenceDeployment/Top/ReferenceDeploymentPackets.fppi @@ -267,17 +267,21 @@ telemetry packets ReferenceDeploymentPackets { cmdSeq.CS_CommandsExecuted cmdSeq.CS_SequencesCompleted cmdSeq.CS_Errors + cmdSeq.CS_CurrentSequence payloadSeq.CS_LoadCommands payloadSeq.CS_CancelCommands payloadSeq.CS_CommandsExecuted payloadSeq.CS_SequencesCompleted payloadSeq.CS_Errors + payloadSeq.CS_CurrentSequence safeModeSeq.CS_LoadCommands safeModeSeq.CS_CancelCommands safeModeSeq.CS_CommandsExecuted safeModeSeq.CS_SequencesCompleted safeModeSeq.CS_Errors + safeModeSeq.CS_CurrentSequence FileHandling.fileUplink.FilesReceived + FileHandling.fileUplink.FilesReceivedFailed FileHandling.fileUplink.PacketsReceived FileHandling.fileDownlink.FilesSent FileHandling.fileDownlink.PacketsSent @@ -313,4 +317,6 @@ telemetry packets ReferenceDeploymentPackets { watchdog.WatchdogTransitions + CdhCore.events.EventsDropped + } diff --git a/PROVESFlightControllerReference/ReferenceDeployment/Top/ReferenceDeploymentTopology.cpp b/PROVESFlightControllerReference/ReferenceDeployment/Top/ReferenceDeploymentTopology.cpp index e54eedff..61e7d94f 100644 --- a/PROVESFlightControllerReference/ReferenceDeployment/Top/ReferenceDeploymentTopology.cpp +++ b/PROVESFlightControllerReference/ReferenceDeployment/Top/ReferenceDeploymentTopology.cpp @@ -114,6 +114,9 @@ void setupTopology(const TopologyState& state) { configComponents(state); // Project-specific component configuration. Function provided above. May be inlined, if desired. configureTopology(); + // Restore the persisted mode now that the ports are wired and the GPIO drivers are open. + // This drives the load switches, so it must not run any earlier. + modeManager.restorePersistentState(); // Read parameters from persistent storage readParameters(); // Autocoded parameter loading. Function provided by autocoder. diff --git a/PROVESFlightControllerReference/ReferenceDeployment/Top/system.fpp b/PROVESFlightControllerReference/ReferenceDeployment/Top/system.fpp new file mode 100644 index 00000000..312f8fcc --- /dev/null +++ b/PROVESFlightControllerReference/ReferenceDeployment/Top/system.fpp @@ -0,0 +1,3 @@ +module ReferenceDeployment { + system ReferenceDeployment: ReferenceDeployment +} diff --git a/PROVESFlightControllerReference/ReferenceDeployment/Top/topology.fpp b/PROVESFlightControllerReference/ReferenceDeployment/Top/topology.fpp index 9063988a..781f810a 100644 --- a/PROVESFlightControllerReference/ReferenceDeployment/Top/topology.fpp +++ b/PROVESFlightControllerReference/ReferenceDeployment/Top/topology.fpp @@ -10,7 +10,7 @@ module ReferenceDeployment { rateGroup1Hz } - topology ReferenceDeployment { + deployment topology ReferenceDeployment { # ---------------------------------------------------------------------- # Subtopology imports diff --git a/PROVESFlightControllerReference/project/config/AcConstants.fpp b/PROVESFlightControllerReference/project/config/AcConstants.fpp index 203b1e4d..beddf233 100644 --- a/PROVESFlightControllerReference/project/config/AcConstants.fpp +++ b/PROVESFlightControllerReference/project/config/AcConstants.fpp @@ -60,6 +60,11 @@ constant FwAssertTextSize = 256 @ in FpConfig.h. constant AssertFatalAdapterEventFileSize = FileNameStringSize +@ The maximum size in bytes for passing sequence arguments through CmdSeqIn ports +@ Note: This must fit within FW_CMD_ARG_BUFFER_MAX_SIZE along with cmd arguments using Svc::SeqArgs +@ Total serialized size: string length prefix + fileName + BlockState + SeqArgs(size + buffer) +constant SequenceArgumentsMaxSize = FW_CMD_ARG_BUFFER_MAX_SIZE - sizeof(FwSizeStoreType) - FileNameStringSize - sizeof(U8) - sizeof(FwSizeType) + # ---------------------------------------------------------------------- # Hub connections. Connections on all deployments should mirror these settings. # ---------------------------------------------------------------------- diff --git a/PROVESFlightControllerReference/project/config/CdhCoreConfig.fpp b/PROVESFlightControllerReference/project/config/CdhCoreConfig.fpp index 0e77e5a8..09022045 100644 --- a/PROVESFlightControllerReference/project/config/CdhCoreConfig.fpp +++ b/PROVESFlightControllerReference/project/config/CdhCoreConfig.fpp @@ -23,4 +23,10 @@ module CdhCoreConfig { constant tlmSend = 6 } + + module CpuAffinities { + constant cmdDisp = Os.TASK_DEFAULT + constant events = Os.TASK_DEFAULT + constant tlmSend = Os.TASK_DEFAULT + } } diff --git a/PROVESFlightControllerReference/project/config/ComCcsdsConfig.fpp b/PROVESFlightControllerReference/project/config/ComCcsdsConfig.fpp index 412b2cd6..7419c038 100644 --- a/PROVESFlightControllerReference/project/config/ComCcsdsConfig.fpp +++ b/PROVESFlightControllerReference/project/config/ComCcsdsConfig.fpp @@ -20,6 +20,11 @@ module ComCcsdsConfig { constant comQueue = 8 # ComQueue has higher priority than data producers (e.g. events, telemetry) } + module CpuAffinities { + constant aggregator = Os.TASK_DEFAULT + constant comQueue = Os.TASK_DEFAULT + } + # Queue configuration constants module QueueDepths { constant events = 50 diff --git a/PROVESFlightControllerReference/project/config/ComCfg.fpp b/PROVESFlightControllerReference/project/config/ComCfg.fpp index 3f02d81c..2f53e5fe 100644 --- a/PROVESFlightControllerReference/project/config/ComCfg.fpp +++ b/PROVESFlightControllerReference/project/config/ComCfg.fpp @@ -22,6 +22,13 @@ module ComCfg { @ Aggregation buffer for ComAggregator component constant AggregationSize = TmFrameFixedSize - 6 - 6 - 1 - 2 # 2 header (6) + 1 idle byte + 2 trailer bytes + @ Packet Version Numbers are 3 bits with only 2 currently valid values + dictionary enum Pvn : U8 { + SPACE_PACKET_PROTOCOL = 0x0 @< Fully Featured CCSDS Space Packet Protocol + ENCAPSULATION_PACKET_PROTOCOL = 0x7 @< Bare-bones CCSDS Encapsulation Packet Protocol + INVALID_UNINITIALIZED = 0x8 @< Anything equal or higher value is invalid and should not be used + } default INVALID_UNINITIALIZED + @ APIDs are 11 bits in the Space Packet protocol, so we use U16. Max value 7FF dictionary enum Apid : FwPacketDescriptorType { # APIDs prefixed with FW are reserved for F Prime and need to be present @@ -39,20 +46,31 @@ module ComCfg { INVALID_UNINITIALIZED = 0x0800 @< Anything equal or higher value is invalid and should not be used } default INVALID_UNINITIALIZED + @ Reserved SA index sentinel meaning "unset"; SA index 0xFFFF cannot be selected via context + constant SaIndexUnset = 0xFFFF + @ Type used to pass context info between components during framing/deframing struct FrameContext { comQueueIndex: FwIndexType @< Queue Index used by the ComQueue, other components shall not modify apid: Apid @< 11 bits APID in CCSDS + hasSecHdr: bool @< Secondary header flag for SpacePacketFramer + sequenceFlags: U8 @< 2 bit Sequence flags (0b00=continuation, 0b01=first, 0b10=last, 0b11=unsegmented) sequenceCount: U16 @< 14 bit Sequence count - sequence count is incremented per APID - vcId: U8 @< 6 bit Virtual Channel ID - used for TC and TM + vcId: U8 @< 6 bit Virtual Channel ID - used for AOS, TC, and TM Protocols + pvn: Pvn @< Packet Version Number - used for AOS deframing to identify packet type sendNow: bool @< Flag to AOS Framer that the Frame this packet goes into should be sent ASAP + saIndex: U16 @< Security Association Index - set by SDLS deframers, read by SDLS framers authenticated: bool @< Whether the packet has been authenticated } default { comQueueIndex = 0 apid = Apid.FW_PACKET_UNKNOWN + hasSecHdr = false + sequenceFlags = 0x3 sequenceCount = 0 vcId = 1 + pvn = Pvn.INVALID_UNINITIALIZED sendNow = false + saIndex = SaIndexUnset } } diff --git a/PROVESFlightControllerReference/project/config/CommandDispatcherImplCfg.hpp b/PROVESFlightControllerReference/project/config/CommandDispatcherImplCfg.hpp index b28b21a5..018bf291 100644 --- a/PROVESFlightControllerReference/project/config/CommandDispatcherImplCfg.hpp +++ b/PROVESFlightControllerReference/project/config/CommandDispatcherImplCfg.hpp @@ -8,6 +8,8 @@ #ifndef CMDDISPATCHER_COMMANDDISPATCHERIMPLCFG_HPP_ #define CMDDISPATCHER_COMMANDDISPATCHERIMPLCFG_HPP_ +#include + // Define configuration values for dispatcher enum { @@ -15,4 +17,18 @@ enum { CMD_DISPATCHER_SEQUENCER_TABLE_SIZE = 10, // !< The size of the table holding commands in progress }; +namespace Svc { +namespace CmdDispatcherCfg { + +//! Include command opcodes in events when true. +//! When false, opcode fields are set to the maximum FwOpcodeType value. +constexpr bool IncludeCommandOpcodesInEvents = true; + +constexpr FwOpcodeType getEventOpcode(const FwOpcodeType opcode) { + return IncludeCommandOpcodesInEvents ? opcode : std::numeric_limits::max(); +} + +} // namespace CmdDispatcherCfg +} // namespace Svc + #endif /* CMDDISPATCHER_COMMANDDISPATCHERIMPLCFG_HPP_ */ diff --git a/PROVESFlightControllerReference/project/config/FileHandlingConfig.fpp b/PROVESFlightControllerReference/project/config/FileHandlingConfig.fpp index 3421010e..e9d205c8 100644 --- a/PROVESFlightControllerReference/project/config/FileHandlingConfig.fpp +++ b/PROVESFlightControllerReference/project/config/FileHandlingConfig.fpp @@ -23,6 +23,13 @@ module FileHandlingConfig { constant fileManager = 15 } + module CpuAffinities { + constant fileUplink = Os.TASK_DEFAULT + constant fileDownlink = Os.TASK_DEFAULT + constant fileManager = Os.TASK_DEFAULT + constant prmDb = Os.TASK_DEFAULT + } + # File downlink configuration constants module DownlinkConfig { constant timeout = 5000 # File downlink timeout in ms diff --git a/PROVESFlightControllerReference/project/config/FpConfig.h b/PROVESFlightControllerReference/project/config/FpConfig.h index f40c5e20..991044db 100644 --- a/PROVESFlightControllerReference/project/config/FpConfig.h +++ b/PROVESFlightControllerReference/project/config/FpConfig.h @@ -21,6 +21,20 @@ extern "C" { // Configuration switches // ---------------------------------------------------------------------- +// Enable strict assertions +#ifndef FW_STRICT_ASSERTIONS +#define FW_STRICT_ASSERTIONS (1) //!< Indicates whether strict assertions are used (more checking, more instructions) +#endif + +// Enable direct port calls +#ifndef FW_DIRECT_PORT_CALLS +#ifdef BUILD_UT +#define FW_DIRECT_PORT_CALLS (0) //!< Indirect port calls are required for unit tests +#else +#define FW_DIRECT_PORT_CALLS (1) //!< Indicates whether direct port calls are used (saves space and time) +#endif +#endif + // Allow objects to have names. Allocates storage for each instance #ifndef FW_OBJECT_NAMES #define FW_OBJECT_NAMES \ @@ -111,6 +125,14 @@ extern "C" { #define FW_ASSERT_LEVEL FW_FILENAME_ASSERT //!< Defines the type of assert used #endif +// Decide whether the framework should force assertions to always abort. +// If enabled, allows additional compiler optimizations and prevents code from running after an assertion trips. +// If disabled (default), allows the FATAL event handler to decide whether code should continue running after an +// assertion trips. +#ifndef FW_ASSERTIONS_ALWAYS_ABORT +#define FW_ASSERTIONS_ALWAYS_ABORT 0 +#endif + // Adjust various configuration parameters in the architecture. Some of the above enables may disable some of the values // The size of the object name stored in the object base class. Larger names will be truncated. @@ -148,6 +170,22 @@ extern "C" { #define FW_AMPCS_COMPATIBLE 0 //!< Whether or not JPL AMPCS ground system support is enabled. #endif +// Posix thread names are limited to 16 characters, this can lead to collisions. In the event of a +// collision, set this to 0. +#ifndef POSIX_THREADS_ENABLE_NAMES +#define POSIX_THREADS_ENABLE_NAMES (1) //!< Enable/Disable assigning names to threads +#endif + +// Hint to the compiler to always inline LinearBufferBase serialization & +// deserialization methods +#define FW_SERIALIZE_FORCE_INLINE_LBB +// NOTE: To encourage inlining, uncomment below +// #if defined(__GNUC__) || defined(__clang__) +// #define FW_SERIALIZE_FORCE_INLINE_LBB __attribute__((always_inline)) inline +// #else +// #define FW_SERIALIZE_FORCE_INLINE_LBB +// #endif + // *** NOTE configuration checks are in Fw/Cfg/ConfigCheck.cpp in order to have // the type definitions in Fw/Types/BasicTypes available. #ifdef __cplusplus diff --git a/PROVESFlightControllerReference/project/config/FpConstants.fpp b/PROVESFlightControllerReference/project/config/FpConstants.fpp index e9d86a09..2b333f15 100644 --- a/PROVESFlightControllerReference/project/config/FpConstants.fpp +++ b/PROVESFlightControllerReference/project/config/FpConstants.fpp @@ -82,7 +82,7 @@ constant FW_ASSERT_COUNT_MAX = 10 constant FW_CONTEXT_DONT_CARE = 0xFF @ Value encoded during serialization for boolean true -constant FW_SERIALIZE_TRUE_VALUE = 0xFF +dictionary constant FW_SERIALIZE_TRUE_VALUE = 0xFF @ Value encoded during serialization for boolean false -constant FW_SERIALIZE_FALSE_VALUE = 0x00 +dictionary constant FW_SERIALIZE_FALSE_VALUE = 0x00 diff --git a/PROVESFlightControllerReference/project/config/PlatformCfg.fpp b/PROVESFlightControllerReference/project/config/PlatformCfg.fpp index f06d82e4..1dbf7a59 100644 --- a/PROVESFlightControllerReference/project/config/PlatformCfg.fpp +++ b/PROVESFlightControllerReference/project/config/PlatformCfg.fpp @@ -29,6 +29,9 @@ constant FW_RAW_TIME_HANDLE_MAX_SIZE = 32 # modified from default @ Maximum allowed serialization size for Os::RawTime objects constant FW_RAW_TIME_SERIALIZATION_MAX_SIZE = 8 +@ Maximum size of a handle for Os::CountingSemaphore +constant FW_COUNTING_SEMAPHORE_HANDLE_MAX_SIZE = 48 + @ Maximum size of a handle for Os::ConditionVariable constant FW_CONDITION_VARIABLE_HANDLE_MAX_SIZE = 56 diff --git a/lib/fprime b/lib/fprime index 8a62e455..7d8f579f 160000 --- a/lib/fprime +++ b/lib/fprime @@ -1 +1 @@ -Subproject commit 8a62e455a90b6d4f498c332d45d65a2a819988d8 +Subproject commit 7d8f579f159d2f7c2d4984d92828575e37f87fa6 diff --git a/lib/fprime-extras b/lib/fprime-extras index f4d4924f..97fbeb62 160000 --- a/lib/fprime-extras +++ b/lib/fprime-extras @@ -1 +1 @@ -Subproject commit f4d4924f0b9bd472b52f310041516dd309f9b26f +Subproject commit 97fbeb62a2bdf7577f365ed4d7790c8f295b87ee diff --git a/lib/fprime-zephyr b/lib/fprime-zephyr index 60d395ed..eaa20541 160000 --- a/lib/fprime-zephyr +++ b/lib/fprime-zephyr @@ -1 +1 @@ -Subproject commit 60d395edfcca61843045962d1c262674e815008b +Subproject commit eaa20541c820a16a1ee8a2ba57f61d6d18e7cb36 diff --git a/prj.conf b/prj.conf index 946a59e3..d86151d3 100644 --- a/prj.conf +++ b/prj.conf @@ -2,6 +2,8 @@ #### F Prime C++ Dependencies #### CONFIG_CPP=y +# F Prime 4.3.0 requires C++14 (digit separators, etc.) +CONFIG_STD_CPP14=y CONFIG_REQUIRES_FULL_LIBCPP=y CONFIG_CPP_EXCEPTIONS=n CONFIG_CPP_RTTI=n