From 6876952bbdd057338afa69ee77d5bedb8bba6921 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Sun, 24 Apr 2022 12:34:08 +0200 Subject: [PATCH 01/11] regenerated events --- bsp_q7s/core/CoreController.h | 2 +- bsp_q7s/core/InitMission.cpp | 8 +- bsp_te0720_1cfa/ObjectFactory.cpp | 38 ++---- generators/bsp_q7s_events.csv | 4 + generators/bsp_q7s_returnvalues.csv | 113 ------------------ generators/events/translateEvents.cpp | 16 ++- generators/objects/translateObjects.cpp | 2 +- .../PlocSupervisorDefinitions.h | 2 +- linux/devices/ploc/PlocSupvHelper.cpp | 4 +- linux/fsfwconfig/events/subsystemIdRanges.h | 2 +- linux/fsfwconfig/events/translateEvents.cpp | 16 ++- linux/fsfwconfig/objects/translateObjects.cpp | 2 +- 12 files changed, 58 insertions(+), 151 deletions(-) diff --git a/bsp_q7s/core/CoreController.h b/bsp_q7s/core/CoreController.h index dee06530..fb4f02b0 100644 --- a/bsp_q7s/core/CoreController.h +++ b/bsp_q7s/core/CoreController.h @@ -73,7 +73,7 @@ class CoreController : public ExtendedControllerBase { static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::CORE; static constexpr Event ALLOC_FAILURE = event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM); - //! [EXPORT] : [COMMENT] Software reboot occured. Can also be a systemd reboot. + //! [EXPORT] : [COMMENT] Software reboot occurred. Can also be a systemd reboot. //! P1: Current Chip, P2: Current Copy static constexpr Event REBOOT_SW = event::makeEvent(SUBSYSTEM_ID, 1, severity::MEDIUM); //! [EXPORT] : [COMMENT] The reboot mechanism was triggered. diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index 7164b8c9..b2817899 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -121,24 +121,26 @@ void initmission::initTasks() { initmission::printAddObjectError("GPS_CTRL", objects::GPS_CONTROLLER); } -#endif /* OBSW_ADD_ACS_HANDLERS */ - PeriodicTaskIF* sysTask = factory->createPeriodicTask( "SYS_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); result = sysTask->addComponent(objects::ACS_BOARD_ASS); if (result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("ACS_BOARD_ASS", objects::ACS_BOARD_ASS); } +#endif /* OBSW_ADD_ACS_HANDLERS */ + #if OBSW_ADD_SUS_BOARD_ASS == 1 result = sysTask->addComponent(objects::SUS_BOARD_ASS); if (result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("SUS_BOARD_ASS", objects::SUS_BOARD_ASS); } #endif +#if OBSW_ADD_RTD_DEVICES == 1 result = sysTask->addComponent(objects::TCS_BOARD_ASS); if (result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("TCS_BOARD_ASS", objects::TCS_BOARD_ASS); } +#endif /* OBSW_ADD_RTD_DEVICES == 1 */ // FS task, task interval does not matter because it runs in permanent loop, priority low // because it is a non-essential background task @@ -238,7 +240,9 @@ void initmission::initTasks() { #if OBSW_ADD_ACS_HANDLERS == 1 acsTask->startTask(); #endif +#if OBSW_ADD_RTD_DEVICES == 1 || OBSW_ADD_RTD_DEVICES == 1 sysTask->startTask(); +#endif #if OBSW_ADD_PLOC_SUPERVISOR == 1 supvHelperTask->startTask(); #endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */ diff --git a/bsp_te0720_1cfa/ObjectFactory.cpp b/bsp_te0720_1cfa/ObjectFactory.cpp index 611036b4..8d5c3ee4 100644 --- a/bsp_te0720_1cfa/ObjectFactory.cpp +++ b/bsp_te0720_1cfa/ObjectFactory.cpp @@ -60,6 +60,19 @@ new UartComIF(objects::UART_COM_IF); plocMPSoCHandler->setStartUpImmediately(); #endif /* OBSW_ADD_PLOC_MPSOC == 1 */ +#if OBSW_ADD_PLOC_SUPERVISOR == 1 + UartCookie* supervisorCookie = + new UartCookie(objects::PLOC_SUPERVISOR_HANDLER, std::string("/dev/ttyPS1"), + uart::PLOC_SUPV_BAUD, supv::MAX_PACKET_SIZE * 20); + supervisorCookie->setNoFixedSizeReply(); + auto supvGpioIF = new DummyGpioIF(); + auto supvHelper = new PlocSupvHelper(objects::PLOC_SUPERVISOR_HELPER); + auto plocSupervisor = new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF, + supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, supvGpioIF), + pcdu::PDU1_CH6_PLOC_12V, supvHelper); + plocSupervisor->setStartUpImmediately(); +#endif + #if OBSW_TEST_LIBGPIOD == 1 #if OBSW_TEST_GPIO_OPEN_BYLABEL == 1 /* Configure MIO0 as input */ @@ -131,31 +144,6 @@ new UartComIF(objects::UART_COM_IF); pcdu::TCS_BOARD_8V_HEATER_IN); #endif -#if OBSW_ADD_PLOC_MPSOC == 1 - UartCookie* mpsocUartCookie = new UartCookie(objects::PLOC_MPSOC_HANDLER, te0720_1cfa::MPSOC_UART, - uart::PLOC_MPSOC_BAUD, mpsoc::MAX_REPLY_SIZE); - mpsocUartCookie->setNoFixedSizeReply(); - PlocMPSoCHelper* plocMpsocHelper = new PlocMPSoCHelper(objects::PLOC_MPSOC_HELPER); - auto mpsocGpioIF = new DummyGpioIF(); - PlocMPSoCHandler* plocMPSoCHandler = new PlocMPSoCHandler( - objects::PLOC_MPSOC_HANDLER, objects::UART_COM_IF, mpsocUartCookie, plocMpsocHelper, - Gpio(gpioIds::ENABLE_MPSOC_UART, mpsocGpioIF), objects::PLOC_SUPERVISOR_HANDLER); - plocMPSoCHandler->setStartUpImmediately(); -#endif /* OBSW_ADD_PLOC_MPSOC == 1 */ - -#if OBSW_ADD_PLOC_SUPERVISOR == 1 - UartCookie* supervisorCookie = - new UartCookie(objects::PLOC_SUPERVISOR_HANDLER, std::string("/dev/ttyPS1"), - uart::PLOC_SUPV_BAUD, supv::MAX_PACKET_SIZE * 20); - supervisorCookie->setNoFixedSizeReply(); - auto supvGpioIF = new DummyGpioIF(); - auto supvHelper = new PlocSupvHelper(objects::PLOC_SUPERVISOR_HELPER); - auto plocSupervisor = new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF, - supervisorCookie, Gpio(gpioIds::ENABLE_SUPV_UART, supvGpioIF), - pcdu::PDU1_CH6_PLOC_12V, supvHelper); - plocSupervisor->setStartUpImmediately(); -#endif - new I2cComIF(objects::I2C_COM_IF); I2cCookie* i2cCookieTmp1075tcs1 = diff --git a/generators/bsp_q7s_events.csv b/generators/bsp_q7s_events.csv index 5e97bab8..c32eaa69 100644 --- a/generators/bsp_q7s_events.csv +++ b/generators/bsp_q7s_events.csv @@ -192,3 +192,7 @@ 13614;0x352e;SUPV_EXE_INVALID_APID;LOW;Supervisor helper expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of supervisor helper;linux\devices\ploc\PlocSupvHelper.h 13615;0x352f;ACK_RECEPTION_FAILURE;LOW;Failed to receive acknowledgment report P1: Return value P2: Apid of command for which the reception of the acknowledgment report failed;linux\devices\ploc\PlocSupvHelper.h 13616;0x3530;EXE_RECEPTION_FAILURE;LOW;Failed to receive execution report P1: Return value P2: Apid of command for which the reception of the execution report failed;linux\devices\ploc\PlocSupvHelper.h +13700;0x3584;ALLOC_FAILURE;MEDIUM;;bsp_q7s\core\CoreController.h +13701;0x3585;REBOOT_SW;MEDIUM; Software reboot occurred. Can also be a systemd reboot. P1: Current Chip, P2: Current Copy;bsp_q7s\core\CoreController.h +13702;0x3586;REBOOT_MECHANISM_TRIGGERED;MEDIUM;The reboot mechanism was triggered. P1: First 16 bits: Last Chip, Last 16 bits: Last Copy, P2: Each byte is the respective reboot count for the slots;bsp_q7s\core\CoreController.h +13703;0x3587;REBOOT_HW;MEDIUM;;bsp_q7s\core\CoreController.h diff --git a/generators/bsp_q7s_returnvalues.csv b/generators/bsp_q7s_returnvalues.csv index c623b3f8..104795ca 100644 --- a/generators/bsp_q7s_returnvalues.csv +++ b/generators/bsp_q7s_returnvalues.csv @@ -1,20 +1,11 @@ 0x0;OK;System-wide code for ok.;RETURN_OK;HasReturnvaluesIF.h;HasReturnvaluesIF 0x1;Failed;Unspecified system-wide code for failed.;RETURN_FAILED;HasReturnvaluesIF.h;HasReturnvaluesIF -<<<<<<< HEAD 0x6000;GOMS_PacketTooLong;;0;mission\devices\GomspaceDeviceHandler.h;GOM_SPACE_HANDLER 0x6001;GOMS_InvalidTableId;;1;mission\devices\GomspaceDeviceHandler.h;GOM_SPACE_HANDLER 0x6002;GOMS_InvalidAddress;;2;mission\devices\GomspaceDeviceHandler.h;GOM_SPACE_HANDLER 0x6003;GOMS_InvalidParamSize;;3;mission\devices\GomspaceDeviceHandler.h;GOM_SPACE_HANDLER 0x6004;GOMS_InvalidPayloadSize;;4;mission\devices\GomspaceDeviceHandler.h;GOM_SPACE_HANDLER 0x6005;GOMS_UnknownReplyId;;5;mission\devices\GomspaceDeviceHandler.h;GOM_SPACE_HANDLER -======= -0x5f00;GOMS_PacketTooLong;;0;mission\devices\GomspaceDeviceHandler.h;GOM_SPACE_HANDLER -0x5f01;GOMS_InvalidTableId;;1;mission\devices\GomspaceDeviceHandler.h;GOM_SPACE_HANDLER -0x5f02;GOMS_InvalidAddress;;2;mission\devices\GomspaceDeviceHandler.h;GOM_SPACE_HANDLER -0x5f03;GOMS_InvalidParamSize;;3;mission\devices\GomspaceDeviceHandler.h;GOM_SPACE_HANDLER -0x5f04;GOMS_InvalidPayloadSize;;4;mission\devices\GomspaceDeviceHandler.h;GOM_SPACE_HANDLER -0x5f05;GOMS_UnknownReplyId;;5;mission\devices\GomspaceDeviceHandler.h;GOM_SPACE_HANDLER ->>>>>>> develop 0x52a1;HEATER_CommandNotSupported;;0xA1;mission\devices\HeaterHandler.h;HEATER_HANDLER 0x52a2;HEATER_InitFailed;;0xA2;mission\devices\HeaterHandler.h;HEATER_HANDLER 0x52a3;HEATER_InvalidSwitchNr;;0xA3;mission\devices\HeaterHandler.h;HEATER_HANDLER @@ -40,7 +31,6 @@ 0x55a2;RWHA_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;0xA2;mission\devices\RwHandler.h;RW_HANDLER 0x55a3;RWHA_ExecutionFailed;Command execution failed;0xA3;mission\devices\RwHandler.h;RW_HANDLER 0x55a4;RWHA_CrcError;Reaction wheel reply has invalid crc;0xA4;mission\devices\RwHandler.h;RW_HANDLER -<<<<<<< HEAD 0x69a0;SADPL_CommandNotSupported;;0xA0;mission\devices\SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER 0x69a1;SADPL_DeploymentAlreadyExecuting;;0xA1;mission\devices\SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER 0x69a2;SADPL_MainSwitchTimeoutFailure;;0xA2;mission\devices\SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER @@ -48,15 +38,6 @@ 0x69a4;SADPL_SwitchingDeplSa2Failed;;0xA4;mission\devices\SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER 0x5ba0;SUSS_ErrorUnlockMutex;;0xA0;mission\devices\SusHandler.h;SUS_HANDLER 0x5ba1;SUSS_ErrorLockMutex;;0xA1;mission\devices\SusHandler.h;SUS_HANDLER -======= -0x68a0;SADPL_CommandNotSupported;;0xA0;mission\devices\SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER -0x68a1;SADPL_DeploymentAlreadyExecuting;;0xA1;mission\devices\SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER -0x68a2;SADPL_MainSwitchTimeoutFailure;;0xA2;mission\devices\SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER -0x68a3;SADPL_SwitchingDeplSa1Failed;;0xA3;mission\devices\SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER -0x68a4;SADPL_SwitchingDeplSa2Failed;;0xA4;mission\devices\SolarArrayDeploymentHandler.h;SA_DEPL_HANDLER -0x5aa0;SUSS_ErrorUnlockMutex;;0xA0;mission\devices\SusHandler.h;SUS_HANDLER -0x5aa1;SUSS_ErrorLockMutex;;0xA1;mission\devices\SusHandler.h;SUS_HANDLER ->>>>>>> develop 0x53a0;SYRLINKS_CrcFailure;;0xA0;mission\devices\SyrlinksHkHandler.h;SYRLINKS_HANDLER 0x53a1;SYRLINKS_UartFraminOrParityErrorAck;;0xA1;mission\devices\SyrlinksHkHandler.h;SYRLINKS_HANDLER 0x53a2;SYRLINKS_BadCharacterAck;;0xA2;mission\devices\SyrlinksHkHandler.h;SYRLINKS_HANDLER @@ -66,13 +47,8 @@ 0x53a6;SYRLINKS_BadCrcAck;;0xA6;mission\devices\SyrlinksHkHandler.h;SYRLINKS_HANDLER 0x53a7;SYRLINKS_ReplyWrongSize;;0xA7;mission\devices\SyrlinksHkHandler.h;SYRLINKS_HANDLER 0x53a8;SYRLINKS_MissingStartFrameCharacter;;0xA8;mission\devices\SyrlinksHkHandler.h;SYRLINKS_HANDLER -<<<<<<< HEAD 0x66a0;NVMB_KeyNotExists;Specified key does not exist in json file;0xA0;mission\memory\NVMParameterBase.h;NVM_PARAM_BASE 0x63a0;CCSDS_CommandNotImplemented;Received action message with unknown action id;0xA0;mission\tmtc\CCSDSHandler.h;CCSDS_HANDLER -======= -0x65a0;NVMB_KeyNotExists;Specified key does not exist in json file;0xA0;mission\memory\NVMParameterBase.h;NVM_PARAM_BASE -0x62a0;CCSDS_CommandNotImplemented;Received action message with unknown action id;0xA0;mission\tmtc\CCSDSHandler.h;CCSDS_HANDLER ->>>>>>> develop 0x4601; HGIO_UnknownGpioId;;1;fsfw\hal\src\fsfw_hal\linux\gpio\LinuxLibgpioIF.h;HAL_GPIO 0x4602; HGIO_DriveGpioFailure;;2;fsfw\hal\src\fsfw_hal\linux\gpio\LinuxLibgpioIF.h;HAL_GPIO 0x4603; HGIO_GpioTypeFailure;;3;fsfw\hal\src\fsfw_hal\linux\gpio\LinuxLibgpioIF.h;HAL_GPIO @@ -468,7 +444,6 @@ 0x1f07; CSB_InvalidReply;;7;fsfw\src\fsfw\tmtcservices\CommandingServiceBase.h;COMMAND_SERVICE_BASE 0x4a00; SPPA_NoPacketFound;;0x00;fsfw\src\fsfw\tmtcservices\SpacePacketParser.h;SPACE_PACKET_PARSER 0x4a01; SPPA_SplitPacket;;0x01;fsfw\src\fsfw\tmtcservices\SpacePacketParser.h;SPACE_PACKET_PARSER -<<<<<<< HEAD 0x67a0;FSHLP_SdNotMounted;SD card specified with path string not mounted;0xA0;bsp_q7s\memory\FilesystemHelper.h;FILE_SYSTEM_HELPER 0x67a1;FSHLP_FileNotExists;Specified file does not exist on filesystem;0xA1;bsp_q7s\memory\FilesystemHelper.h;FILE_SYSTEM_HELPER 0x7300; SCBU_KeyNotFound;;0;bsp_q7s\memory\scratchApi.h;SCRATCH_BUFFER @@ -527,61 +502,6 @@ 0x6501;JSONBASE_JsonFileNotExists;Specified json file does not exist;1;linux\devices\startracker\ArcsecJsonParamBase.h;ARCSEC_JSON_BASE 0x6502;JSONBASE_SetNotExists;Requested set does not exist in json file;2;linux\devices\startracker\ArcsecJsonParamBase.h;ARCSEC_JSON_BASE 0x6503;JSONBASE_ParamNotExists;Requested parameter does not exist in json file;3;linux\devices\startracker\ArcsecJsonParamBase.h;ARCSEC_JSON_BASE -======= -0x66a0;FSHLP_SdNotMounted;SD card specified with path string not mounted;0xA0;bsp_q7s\memory\FilesystemHelper.h;FILE_SYSTEM_HELPER -0x66a1;FSHLP_FileNotExists;Specified file does not exist on filesystem;0xA1;bsp_q7s\memory\FilesystemHelper.h;FILE_SYSTEM_HELPER -0x7100; SCBU_KeyNotFound;;0;bsp_q7s\memory\scratchApi.h;SCRATCH_BUFFER -0x7000; SDMA_OpOngoing;;0;bsp_q7s\memory\SdCardManager.h;SD_CARD_MANAGER -0x7001; SDMA_AlreadyOn;;1;bsp_q7s\memory\SdCardManager.h;SD_CARD_MANAGER -0x7002; SDMA_AlreadyMounted;;2;bsp_q7s\memory\SdCardManager.h;SD_CARD_MANAGER -0x7003; SDMA_AlreadyOff;;3;bsp_q7s\memory\SdCardManager.h;SD_CARD_MANAGER -0x700a; SDMA_StatusFileNexists;;10;bsp_q7s\memory\SdCardManager.h;SD_CARD_MANAGER -0x700b; SDMA_StatusFileFormatInvalid;;11;bsp_q7s\memory\SdCardManager.h;SD_CARD_MANAGER -0x700c; SDMA_MountError;;12;bsp_q7s\memory\SdCardManager.h;SD_CARD_MANAGER -0x700d; SDMA_UnmountError;;13;bsp_q7s\memory\SdCardManager.h;SD_CARD_MANAGER -0x700e; SDMA_SystemCallError;;14;bsp_q7s\memory\SdCardManager.h;SD_CARD_MANAGER -0x700f; SDMA_PopenCallError;;15;bsp_q7s\memory\SdCardManager.h;SD_CARD_MANAGER -0x69a0;MPSOCRTVIF_CrcFailure;Space Packet received from PLOC has invalid CRC;0xA0;linux\devices\devicedefinitions\MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a1;MPSOCRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC;0xA1;linux\devices\devicedefinitions\MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a2;MPSOCRTVIF_ReceivedExeFailure;Received execution failure reply from PLOC;0xA2;linux\devices\devicedefinitions\MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a3;MPSOCRTVIF_InvalidApid;Received space packet with invalid APID from PLOC;0xA3;linux\devices\devicedefinitions\MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a4;MPSOCRTVIF_InvalidLength;Received command with invalid length;0xA4;linux\devices\devicedefinitions\MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a5;MPSOCRTVIF_FilenameTooLong;Filename of file in OBC filesystem is too long;0xA5;linux\devices\devicedefinitions\MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a6;MPSOCRTVIF_MpsocHelperExecuting;MPSoC helper is currently executing a command;0xA6;linux\devices\devicedefinitions\MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a7;MPSOCRTVIF_MpsocFilenameTooLong;Filename of MPSoC file is to long (max. 256 bytes);0xA7;linux\devices\devicedefinitions\MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a8;MPSOCRTVIF_InvalidParameter;Command has invalid parameter;0xA8;linux\devices\devicedefinitions\MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x69a9;MPSOCRTVIF_NameTooLong;Received command has file string with invalid length;0xA9;linux\devices\devicedefinitions\MPSoCReturnValuesIF.h;MPSOC_RETURN_VALUES_IF -0x57e0;DWLPWRON_InvalidMode;Received command has invalid JESD mode (valid modes are 0 - 5);0xE0;linux\devices\devicedefinitions\PlocMPSoCDefinitions.h;DWLPWRON_CMD -0x57e1;DWLPWRON_InvalidLaneRate;Received command has invalid lane rate (valid lane rate are 0 - 9);0xE1;linux\devices\devicedefinitions\PlocMPSoCDefinitions.h;DWLPWRON_CMD -0x60a0;PLMEMDUMP_MramAddressTooHigh;The capacity of the MRAM amounts to 512 kB. Thus the maximum address must not be higher than 0x7d000.;0xA0;linux\devices\ploc\PlocMemoryDumper.h;PLOC_MEMORY_DUMPER -0x60a1;PLMEMDUMP_MramInvalidAddressCombination;The specified end address is lower than the start address;0xA1;linux\devices\ploc\PlocMemoryDumper.h;PLOC_MEMORY_DUMPER -0x67a0; PLMPHLP_FileClosedAccidentally;File accidentally close;0xA0;linux\devices\ploc\PlocMPSoCHelper.h;PLOC_MPSOC_HELPER -0x59a0;PLSV_CrcFailure;Space Packet received from PLOC supervisor has invalid CRC;0xA0;linux\devices\ploc\PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER -0x59a1;PLSV_ReceivedAckFailure;Received ACK failure reply from PLOC supervisor;0xA1;linux\devices\ploc\PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER -0x59a2;PLSV_ReceivedExeFailure;Received execution failure reply from PLOC supervisor;0xA2;linux\devices\ploc\PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER -0x59a3;PLSV_InvalidApid;Received space packet with invalid APID from PLOC supervisor;0xA3;linux\devices\ploc\PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER -0x59a4;PLSV_GetTimeFailure;Failed to read current system time;0xA4;linux\devices\ploc\PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER -0x59a5;PLSV_InvalidWatchdog;Received command with invalid watchdog parameter. Valid watchdogs are 0 for PS, 1 for PL and 2 for INT;0xA5;linux\devices\ploc\PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER -0x59a6;PLSV_InvalidWatchdogTimeout;Received watchdog timeout config command with invalid timeout. Valid timeouts must be in the range between 1000 and 360000 ms.;0xA6;linux\devices\ploc\PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER -0x59a7;PLSV_InvalidLatchupId;Received latchup config command with invalid latchup ID;0xA7;linux\devices\ploc\PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER -0x59a8;PLSV_SweepPeriodTooSmall;Received set adc sweep period command with invalid sweep period. Must be larger than 21.;0xA8;linux\devices\ploc\PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER -0x59a9;PLSV_InvalidTestParam;Receive auto EM test command with invalid test param. Valid params are 1 and 2.;0xA9;linux\devices\ploc\PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER -0x59aa;PLSV_MramPacketParsingFailure;Returned when scanning for MRAM dump packets failed.;0xAA;linux\devices\ploc\PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER -0x59ab;PLSV_InvalidMramAddresses;Returned when the start and stop addresses of the MRAM dump or MRAM wipe commands are invalid (e.g. start address bigger than stop address);0xAB;linux\devices\ploc\PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER -0x59ac;PLSV_NoMramPacket;Expect reception of an MRAM dump packet but received space packet with other apid.;0xAC;linux\devices\ploc\PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER -0x59ad;PLSV_PathDoesNotExist;Path to PLOC directory on SD card does not exist;0xAD;linux\devices\ploc\PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER -0x59ae;PLSV_MramFileNotExists;MRAM dump file does not exists. The file should actually already have been created with the reception of the first dump packet.;0xAE;linux\devices\ploc\PlocSupervisorHandler.h;PLOC_SUPERVISOR_HANDLER -0x5da0;PLUD_UpdaterBusy;Updater is already performing an update;0xA0;linux\devices\ploc\PlocUpdater.h;PLOC_UPDATER -0x5da1;PLUD_NameTooLong;Received update command with invalid path string (too long).;0xA1;linux\devices\ploc\PlocUpdater.h;PLOC_UPDATER -0x5da2;PLUD_SdNotMounted;Received command to initiate update but SD card with update image not mounted.;0xA2;linux\devices\ploc\PlocUpdater.h;PLOC_UPDATER -0x5da3;PLUD_FileNotExists;Update file received with update command does not exist.;0xA3;linux\devices\ploc\PlocUpdater.h;PLOC_UPDATER -0x56a0;STRH_TemperatureReqFailed;Status in temperature reply signals error;0xA0;linux\devices\startracker\StarTrackerHandler.h;STR_HANDLER -0x56a1;STRH_PingFailed;Ping command failed;0xA1;linux\devices\startracker\StarTrackerHandler.h;STR_HANDLER -0x56a2;STRH_VersionReqFailed;Status in version reply signals error;0xA2;linux\devices\startracker\StarTrackerHandler.h;STR_HANDLER -0x6401;JSONBASE_JsonFileNotExists;Specified json file does not exist;1;linux\devices\startracker\ArcsecJsonParamBase.h;ARCSEC_JSON_BASE -0x6402;JSONBASE_SetNotExists;Requested set does not exist in json file;2;linux\devices\startracker\ArcsecJsonParamBase.h;ARCSEC_JSON_BASE -0x6403;JSONBASE_ParamNotExists;Requested parameter does not exist in json file;3;linux\devices\startracker\ArcsecJsonParamBase.h;ARCSEC_JSON_BASE ->>>>>>> develop 0x56a3;STRH_InterfaceReqFailed;Status in interface reply signals error;0xA3;linux\devices\startracker\StarTrackerHandler.h;STR_HANDLER 0x56a4;STRH_PowerReqFailed;Status in power reply signals error;0xA4;linux\devices\startracker\StarTrackerHandler.h;STR_HANDLER 0x56a5;STRH_SetParamFailed;Status of reply to parameter set command signals error;0xA5;linux\devices\startracker\StarTrackerHandler.h;STR_HANDLER @@ -604,7 +524,6 @@ 0x56b6;STRH_StartrackerAlreadyBooted;Star tracker is already in firmware mode;0xB6;linux\devices\startracker\StarTrackerHandler.h;STR_HANDLER 0x56b7;STRH_StartrackerRunningFirmware;Star tracker is in firmware mode but must be in bootloader mode to execute this command;0xB7;linux\devices\startracker\StarTrackerHandler.h;STR_HANDLER 0x56b8;STRH_StartrackerRunningBootloader;Star tracker is in bootloader mode but must be in firmware mode to execute this command;0xB8;linux\devices\startracker\StarTrackerHandler.h;STR_HANDLER -<<<<<<< HEAD 0x5fa0;STRHLP_SdNotMounted;SD card specified in path string not mounted;0xA0;linux\devices\startracker\StrHelper.h;STR_HELPER 0x5fa1;STRHLP_FileNotExists;Specified file does not exist on filesystem;0xA1;linux\devices\startracker\StrHelper.h;STR_HELPER 0x5fa2;STRHLP_PathNotExists;Specified path does not exist;0xA2;linux\devices\startracker\StrHelper.h;STR_HELPER @@ -635,35 +554,3 @@ 0x64a1;RS_BadBitRate;Bad bitrate has been commanded (e.g. 0);0xA1;linux\obc\PtmeConfig.h;RATE_SETTER 0x64a2;RS_ClkInversionFailed;Failed to invert clock and thus change the time the data is updated with respect to the tx clock;0xA2;linux\obc\PtmeConfig.h;RATE_SETTER 0x64a3;RS_TxManipulatorConfigFailed;Failed to change configuration bit of tx clock manipulator;0xA3;linux\obc\PtmeConfig.h;RATE_SETTER -======= -0x5ea0;STRHLP_SdNotMounted;SD card specified in path string not mounted;0xA0;linux\devices\startracker\StrHelper.h;STR_HELPER -0x5ea1;STRHLP_FileNotExists;Specified file does not exist on filesystem;0xA1;linux\devices\startracker\StrHelper.h;STR_HELPER -0x5ea2;STRHLP_PathNotExists;Specified path does not exist;0xA2;linux\devices\startracker\StrHelper.h;STR_HELPER -0x5ea3;STRHLP_FileCreationFailed;Failed to create download image or read flash file;0xA3;linux\devices\startracker\StrHelper.h;STR_HELPER -0x5ea4;STRHLP_RegionMismatch;Region in flash write/read reply does not match expected region;0xA4;linux\devices\startracker\StrHelper.h;STR_HELPER -0x5ea5;STRHLP_AddressMismatch;Address in flash write/read reply does not match expected address;0xA5;linux\devices\startracker\StrHelper.h;STR_HELPER -0x5ea6;STRHLP_LengthMismatch;Length in flash write/read reply does not match expected length;0xA6;linux\devices\startracker\StrHelper.h;STR_HELPER -0x5ea7;STRHLP_StatusError;Status field in reply signals error;0xA7;linux\devices\startracker\StrHelper.h;STR_HELPER -0x5ea8;STRHLP_InvalidTypeId;Reply has invalid type ID (should be of action reply type);0xA8;linux\devices\startracker\StrHelper.h;STR_HELPER -0x5ba0;IPCI_PapbBusy;;0xA0;linux\obc\PapbVcInterface.h;CCSDS_IP_CORE_BRIDGE -0x61a0;PDEC_AbandonedCltu;;0xA0;linux\obc\PdecHandler.h;PDEC_HANDLER -0x61a1;PDEC_FrameDirty;;0xA1;linux\obc\PdecHandler.h;PDEC_HANDLER -0x61a2;PDEC_FrameIllegalMultipleReasons;;0xA2;linux\obc\PdecHandler.h;PDEC_HANDLER -0x61a3;PDEC_AdDiscardedLockout;;0xA3;linux\obc\PdecHandler.h;PDEC_HANDLER -0x61a4;PDEC_AdDiscardedWait;;0xA4;linux\obc\PdecHandler.h;PDEC_HANDLER -0x61a5;PDEC_AdDiscardedNsVs;;0xA5;linux\obc\PdecHandler.h;PDEC_HANDLER -0x61b0;PDEC_CommandNotImplemented;Received action message with unknown action id;0xB0;linux\obc\PdecHandler.h;PDEC_HANDLER -0x61a6;PDEC_NoReport;;0xA6;linux\obc\PdecHandler.h;PDEC_HANDLER -0x61a7;PDEC_ErrorVersionNumber;;0xA7;linux\obc\PdecHandler.h;PDEC_HANDLER -0x61a8;PDEC_IllegalCombination;;0xA8;linux\obc\PdecHandler.h;PDEC_HANDLER -0x61a9;PDEC_InvalidScId;;0xA9;linux\obc\PdecHandler.h;PDEC_HANDLER -0x61aa;PDEC_InvalidVcIdMsb;;0xAA;linux\obc\PdecHandler.h;PDEC_HANDLER -0x61ab;PDEC_InvalidVcIdLsb;;0xAB;linux\obc\PdecHandler.h;PDEC_HANDLER -0x61ac;PDEC_NsNotZero;;0xAC;linux\obc\PdecHandler.h;PDEC_HANDLER -0x61ae;PDEC_InvalidBcCc;;0xAE;linux\obc\PdecHandler.h;PDEC_HANDLER -0x5ca0;PTME_UnknownVcId;;0xA0;linux\obc\Ptme.h;PTME -0x63a0;RS_RateNotSupported;The commanded rate is not supported by the current FPGA design;0xA0;linux\obc\PtmeConfig.h;RATE_SETTER -0x63a1;RS_BadBitRate;Bad bitrate has been commanded (e.g. 0);0xA1;linux\obc\PtmeConfig.h;RATE_SETTER -0x63a2;RS_ClkInversionFailed;Failed to invert clock and thus change the time the data is updated with respect to the tx clock;0xA2;linux\obc\PtmeConfig.h;RATE_SETTER -0x63a3;RS_TxManipulatorConfigFailed;Failed to change configuration bit of tx clock manipulator;0xA3;linux\obc\PtmeConfig.h;RATE_SETTER ->>>>>>> develop diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 0eeb503a..a829cb26 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 194 translations. + * @brief Auto-generated event translation file. Contains 198 translations. * @details - * Generated on: 2022-04-18 16:58:03 + * Generated on: 2022-04-24 12:20:25 */ #include "translateEvents.h" @@ -195,6 +195,10 @@ const char *SUPV_ACK_INVALID_APID_STRING = "SUPV_ACK_INVALID_APID"; const char *SUPV_EXE_INVALID_APID_STRING = "SUPV_EXE_INVALID_APID"; const char *ACK_RECEPTION_FAILURE_STRING = "ACK_RECEPTION_FAILURE"; const char *EXE_RECEPTION_FAILURE_STRING = "EXE_RECEPTION_FAILURE"; +const char *ALLOC_FAILURE_STRING = "ALLOC_FAILURE"; +const char *REBOOT_SW_STRING = "REBOOT_SW"; +const char *REBOOT_MECHANISM_TRIGGERED_STRING = "REBOOT_MECHANISM_TRIGGERED"; +const char *REBOOT_HW_STRING = "REBOOT_HW"; const char *translateEvents(Event event) { switch ((event & 0xFFFF)) { @@ -578,6 +582,14 @@ const char *translateEvents(Event event) { return ACK_RECEPTION_FAILURE_STRING; case (13616): return EXE_RECEPTION_FAILURE_STRING; + case (13700): + return ALLOC_FAILURE_STRING; + case (13701): + return REBOOT_SW_STRING; + case (13702): + return REBOOT_MECHANISM_TRIGGERED_STRING; + case (13703): + return REBOOT_HW_STRING; default: return "UNKNOWN_EVENT"; } diff --git a/generators/objects/translateObjects.cpp b/generators/objects/translateObjects.cpp index dae25b92..7d46b9bc 100644 --- a/generators/objects/translateObjects.cpp +++ b/generators/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 116 translations. - * Generated on: 2022-04-18 16:58:07 + * Generated on: 2022-04-24 12:09:01 */ #include "translateObjects.h" diff --git a/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h b/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h index a37af14f..cf5fccc8 100644 --- a/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +++ b/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h @@ -1136,7 +1136,7 @@ class WriteMemory : public SupvTcSpacePacket { } // Although the space packet has space left for 1010 bytes of data to supervisor can only process - // update packets with maximum 512 bytes of update data. + // update packets with a maximum of 512 bytes. static const uint16_t CHUNK_MAX = 512; private: diff --git a/linux/devices/ploc/PlocSupvHelper.cpp b/linux/devices/ploc/PlocSupvHelper.cpp index d734569a..c1f66d08 100644 --- a/linux/devices/ploc/PlocSupvHelper.cpp +++ b/linux/devices/ploc/PlocSupvHelper.cpp @@ -452,8 +452,8 @@ ReturnValue_t PlocSupvHelper::handleCheckMemoryCommand() { } result = updateStatusReport.verifycrc(update.crc); if (result != RETURN_OK) { - sif::warning << "PlocSupvHelper::performUpdate: CRC failure. Expected CRC 0x" << std::hex - << update.crc << " but received CRC 0x" << updateStatusReport.getCrc() + sif::warning << "PlocSupvHelper::handleCheckMemoryCommand: CRC failure. Expected CRC 0x" + << std::hex << update.crc << " but received CRC 0x" << updateStatusReport.getCrc() << std::endl; return result; } diff --git a/linux/fsfwconfig/events/subsystemIdRanges.h b/linux/fsfwconfig/events/subsystemIdRanges.h index 768797b5..f0a0316c 100644 --- a/linux/fsfwconfig/events/subsystemIdRanges.h +++ b/linux/fsfwconfig/events/subsystemIdRanges.h @@ -13,7 +13,7 @@ namespace SUBSYSTEM_ID { enum : uint8_t { SUBSYSTEM_ID_START = COMMON_SUBSYSTEM_ID_END, - CORE = 136, + CORE = 137, }; } diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 0eeb503a..a829cb26 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** - * @brief Auto-generated event translation file. Contains 194 translations. + * @brief Auto-generated event translation file. Contains 198 translations. * @details - * Generated on: 2022-04-18 16:58:03 + * Generated on: 2022-04-24 12:20:25 */ #include "translateEvents.h" @@ -195,6 +195,10 @@ const char *SUPV_ACK_INVALID_APID_STRING = "SUPV_ACK_INVALID_APID"; const char *SUPV_EXE_INVALID_APID_STRING = "SUPV_EXE_INVALID_APID"; const char *ACK_RECEPTION_FAILURE_STRING = "ACK_RECEPTION_FAILURE"; const char *EXE_RECEPTION_FAILURE_STRING = "EXE_RECEPTION_FAILURE"; +const char *ALLOC_FAILURE_STRING = "ALLOC_FAILURE"; +const char *REBOOT_SW_STRING = "REBOOT_SW"; +const char *REBOOT_MECHANISM_TRIGGERED_STRING = "REBOOT_MECHANISM_TRIGGERED"; +const char *REBOOT_HW_STRING = "REBOOT_HW"; const char *translateEvents(Event event) { switch ((event & 0xFFFF)) { @@ -578,6 +582,14 @@ const char *translateEvents(Event event) { return ACK_RECEPTION_FAILURE_STRING; case (13616): return EXE_RECEPTION_FAILURE_STRING; + case (13700): + return ALLOC_FAILURE_STRING; + case (13701): + return REBOOT_SW_STRING; + case (13702): + return REBOOT_MECHANISM_TRIGGERED_STRING; + case (13703): + return REBOOT_HW_STRING; default: return "UNKNOWN_EVENT"; } diff --git a/linux/fsfwconfig/objects/translateObjects.cpp b/linux/fsfwconfig/objects/translateObjects.cpp index dae25b92..7d46b9bc 100644 --- a/linux/fsfwconfig/objects/translateObjects.cpp +++ b/linux/fsfwconfig/objects/translateObjects.cpp @@ -2,7 +2,7 @@ * @brief Auto-generated object translation file. * @details * Contains 116 translations. - * Generated on: 2022-04-18 16:58:07 + * Generated on: 2022-04-24 12:09:01 */ #include "translateObjects.h" From 311ec7b194c5701de8618460625465031a3da01a Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Mon, 25 Apr 2022 11:03:02 +0200 Subject: [PATCH 02/11] mpsoc shutdown after running update procedure --- bsp_q7s/core/InitMission.cpp | 4 +- bsp_q7s/core/ObjectFactory.cpp | 2 - linux/devices/GPSHyperionLinuxController.cpp | 2 +- .../PlocSupervisorDefinitions.h | 303 ++++++++++++++++-- linux/devices/ploc/PlocSupervisorHandler.cpp | 14 + linux/devices/ploc/PlocSupervisorHandler.h | 2 + linux/devices/ploc/PlocSupvHelper.cpp | 68 ++-- linux/devices/ploc/PlocSupvHelper.h | 7 +- linux/fsfwconfig/OBSWConfig.h.in | 5 +- mission/utility/ProgressPrinter.cpp | 9 +- mission/utility/ProgressPrinter.h | 11 +- tmtc | 2 +- 12 files changed, 343 insertions(+), 86 deletions(-) diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index b2817899..919e9fbd 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -115,11 +115,13 @@ void initmission::initTasks() { #if OBSW_ADD_ACS_HANDLERS == 1 PeriodicTaskIF* acsTask = factory->createPeriodicTask( - "ACS_CTRL", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); + "ACS_CTRL", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.4, missedDeadlineFunc); +#if OBSW_ADD_GPS == 1 result = acsTask->addComponent(objects::GPS_CONTROLLER); if (result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("GPS_CTRL", objects::GPS_CONTROLLER); } +#endif /* OBSW_ADD_GPS == 1 */ PeriodicTaskIF* sysTask = factory->createPeriodicTask( "SYS_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 47574f6e..ec964659 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -531,7 +531,6 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI #if OBSW_DEBUG_ACS == 1 gyroL3gHandler->enablePeriodicPrintouts(true, 10); #endif - bool debugGps = false; #if OBSW_DEBUG_GPS == 1 debugGps = true; @@ -545,7 +544,6 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI auto gpsHandler0 = new GPSHyperionLinuxController(objects::GPS_CONTROLLER, objects::NO_OBJECT, debugGps); gpsHandler0->setResetPinTriggerFunction(gps::triggerGpioResetPin, &resetArgsGnss0); - AcsBoardHelper acsBoardHelper = AcsBoardHelper( objects::MGM_0_LIS3_HANDLER, objects::MGM_1_RM3100_HANDLER, objects::MGM_2_LIS3_HANDLER, objects::MGM_3_RM3100_HANDLER, objects::GYRO_0_ADIS_HANDLER, objects::GYRO_1_L3G_HANDLER, diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index 42bc43a6..c8cf398f 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -26,7 +26,7 @@ GPSHyperionLinuxController::~GPSHyperionLinuxController() {} void GPSHyperionLinuxController::performControlOperation() { #ifdef FSFW_OSAL_LINUX - readGpsDataFromGpsd(); +// readGpsDataFromGpsd(); #endif } diff --git a/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h b/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h index cf5fccc8..11af022b 100644 --- a/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +++ b/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h @@ -266,10 +266,10 @@ static const uint32_t LOGGING_RPT_ID = LOGGING_REQUEST_COUNTERS; static const uint32_t ADC_REPORT_SET_ID = REQUEST_ADC_REPORT; namespace recv_timeout { - // Erase memory can require up to 60 seconds for execution - static const uint32_t ERASE_MEMORY = 60000; - static const uint32_t UPDATE_STATUS_REPORT = 60000; -} +// Erase memory can require up to 60 seconds for execution +static const uint32_t ERASE_MEMORY = 60000; +static const uint32_t UPDATE_STATUS_REPORT = 60000; +} // namespace recv_timeout /** * @brief This class creates a space packet containing only the header data and the CRC. @@ -1245,7 +1245,6 @@ class DisableAutoTm : public SupvTcSpacePacket { */ class RequestLoggingData : public SupvTcSpacePacket { public: - enum class Sa : uint8_t { REQUEST_COUNTERS = 1, REQUEST_EVENT_BUFFERS = 2, @@ -1278,9 +1277,7 @@ class TmPacket : public SpacePacket { /** * @brief Returns the payload data length (data field length without CRC) */ - uint16_t getPayloadDataLength() { - return this->getPacketDataLength() - 1; - } + uint16_t getPayloadDataLength() { return this->getPacketDataLength() - 1; } ReturnValue_t checkCrc() { uint8_t* crcPtr = this->getPacketData() + this->getPayloadDataLength(); @@ -1294,6 +1291,257 @@ class TmPacket : public SpacePacket { } }; +class VerificationReport : public TmPacket { + public: + VerificationReport() : TmPacket() {} + + /** + * @brief Gets the APID of command which caused the transmission of this verification report. + */ + uint16_t getRefApid() { + uint16_t refApid = 0; + size_t size = 0; + uint8_t* refApidPtr = this->getPacketData(); + ReturnValue_t result = SerializeAdapter::deSerialize(&refApid, refApidPtr, &size, + SerializeIF::Endianness::BIG); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::debug << "ExecutionReport: Failed to deserialize reference APID field" << std::endl; + return result; + } + return refApid; + } + + uint16_t getStatusCode() { + uint16_t statusCode = 0; + size_t size = 0; + uint8_t* statusCodePtr = this->getPacketData() + OFFSET_STATUS_CODE; + ReturnValue_t result = SerializeAdapter::deSerialize(&statusCode, statusCodePtr, &size, + SerializeIF::Endianness::BIG); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::debug << "ExecutionReport: Failed to deserialize status code field" << std::endl; + return result; + } + return statusCode; + } + + virtual ReturnValue_t checkApid() { return HasReturnvaluesIF::RETURN_FAILED; } + + private: + static const uint8_t OFFSET_STATUS_CODE = 4; +}; + +class AcknowledgmentReport : public VerificationReport { + public: + AcknowledgmentReport() : VerificationReport() {} + + ReturnValue_t checkApid() { + uint16_t apid = this->getAPID(); + if (apid == APID_ACK_SUCCESS) { + return HasReturnvaluesIF::RETURN_OK; + } else if (apid == APID_ACK_FAILURE) { + printStatusInformation(); + return SupvReturnValuesIF::RECEIVED_ACK_FAILURE; + } else { + sif::warning << "AcknowledgmentReport::checkApid: Invalid apid: 0x" << std::hex << apid + << std::endl; + return SupvReturnValuesIF::INVALID_APID; + } + } + + void printStatusInformation() { + StatusCode statusCode = static_cast(getStatusCode()); + switch (statusCode) { + case StatusCode::OK: { + sif::warning << "Supervisor acknowledgment report status: Ok" << std::endl; + break; + } + case StatusCode::BAD_PARAM: { + sif::warning << "Supervisor acknowledgment report status: Bad param" << std::endl; + break; + } + case StatusCode::TIMEOUT: { + sif::warning << "Supervisor acknowledgment report status: Timeout" << std::endl; + break; + } + case StatusCode::RX_ERROR: { + sif::warning << "Supervisor acknowledgment report status: RX error" << std::endl; + break; + } + case StatusCode::TX_ERROR: { + sif::warning << "Supervisor acknowledgment report status: TX error" << std::endl; + break; + } + case StatusCode::HEADER_EMPTY: { + sif::warning << "Supervisor acknowledgment report status: Header empty" << std::endl; + break; + } + case StatusCode::DEFAULT_NAK: { + sif::warning << "Supervisor acknowledgment report status: Default code for nak" << + std::endl; + break; + } + case StatusCode::ROUTE_PACKET: { + sif::warning << "Supervisor acknowledgment report status: Route packet error" << std::endl; + break; + } + default: + sif::warning << "AcknowledgmentReport::printStatusInformation: Invalid status code: 0x" + << std::hex << static_cast(statusCode) << std::endl; + break; + } + } + + private: + enum class StatusCode : uint16_t { + OK = 0x0, + BAD_PARAM = 0x1, + TIMEOUT = 0x2, + RX_ERROR = 0x3, + TX_ERROR = 0x4, + HEADER_EMPTY = 0x5, + DEFAULT_NAK = 0x6, + ROUTE_PACKET = 0x7 + }; +}; + +class ExecutionReport : public VerificationReport { + public: + ExecutionReport() : VerificationReport() {} + + ReturnValue_t checkApid() { + uint16_t apid = this->getAPID(); + if (apid == APID_EXE_SUCCESS) { + return HasReturnvaluesIF::RETURN_OK; + } else if (apid == APID_EXE_FAILURE) { + printStatusInformation(); + return SupvReturnValuesIF::RECEIVED_EXE_FAILURE; + } else { + sif::warning << "ExecutionReport::checkApid: Invalid apid: 0x" << std::hex << apid + << std::endl; + return SupvReturnValuesIF::INVALID_APID; + } + } + + private: + enum class StatusCode : uint16_t { + OK = 0x0, + INIT_ERROR = 0x1, + BAD_PARAM = 0x2, + NOT_INITIALIZED = 0x3, + BAD_PERIPH_ID = 0x4, + TIMEOUT = 0x5, + RX_ERROR = 0x6, + TX_ERROR = 0x7, + BUF_EMPTY = 0x8, + BUF_FULL = 0x9, + NAK = 0xA, + ARB_LOST = 0xB, + BUSY = 0xC, + NOT_IMPLEMENTED = 0xD, + ALIGNEMENT_ERROR = 0xE, + PERIPH_ERR = 0xF, + FAILED_LATCH = 0x10, + GPIO_HIGH = 0x11, + GPIO_LOW = 0x12, + TEST_PASSED = 0x13, + TEST_FAILED = 0x14 + }; + + void printStatusInformation() { + StatusCode statusCode = static_cast(getStatusCode()); + switch (statusCode) { + case StatusCode::OK: { + sif::warning << "Supervisor execution report status: Ok" << std::endl; + break; + } + case StatusCode::INIT_ERROR: { + sif::warning << "Supervisor execution report status: Init error" << std::endl; + break; + } + case StatusCode::BAD_PARAM: { + sif::warning << "Supervisor execution report status: Bad param" << std::endl; + break; + } + case StatusCode::NOT_INITIALIZED: { + sif::warning << "Supervisor execution report status: Not initialized" << std::endl; + break; + } + case StatusCode::BAD_PERIPH_ID: { + sif::warning << "Supervisor execution report status: Bad periph ID" << std::endl; + break; + } + case StatusCode::TIMEOUT: { + sif::warning << "Supervisor execution report status: Timeout" << std::endl; + break; + } + case StatusCode::RX_ERROR: { + sif::warning << "Supervisor execution report status: RX error" << std::endl; + break; + } + case StatusCode::TX_ERROR: { + sif::warning << "Supervisor execution report status: TX error" << std::endl; + break; + } + case StatusCode::BUF_EMPTY: { + sif::warning << "Supervisor execution report status: Buf empty" << std::endl; + break; + } + case StatusCode::BUF_FULL: { + sif::warning << "Supervisor execution report status: Buf full" << std::endl; + break; + } + case StatusCode::NAK: { + sif::warning << "Supervisor execution report status: Nak, default error code" << std::endl; + break; + } + case StatusCode::ARB_LOST: { + sif::warning << "Supervisor execution report status: Arb lost" << std::endl; + break; + } + case StatusCode::BUSY: { + sif::warning << "Supervisor execution report status: Busy" << std::endl; + break; + } + case StatusCode::NOT_IMPLEMENTED: { + sif::warning << "Supervisor execution report status: Not implemented" << std::endl; + break; + } + case StatusCode::ALIGNEMENT_ERROR: { + sif::warning << "Supervisor execution report status: Alignment error" << std::endl; + break; + } + case StatusCode::PERIPH_ERR: { + sif::warning << "Supervisor execution report status: Periph error" << std::endl; + break; + } + case StatusCode::FAILED_LATCH: { + sif::warning << "Supervisor execution report status: Failed latch" << std::endl; + break; + } + case StatusCode::GPIO_HIGH: { + sif::warning << "Supervisor execution report status: GPIO high" << std::endl; + break; + } + case StatusCode::GPIO_LOW: { + sif::warning << "Supervisor execution report status: GPIO low" << std::endl; + break; + } + case StatusCode::TEST_PASSED: { + sif::warning << "Supervisor execution report status: Test passed" << std::endl; + break; + } + case StatusCode::TEST_FAILED: { + sif::warning << "Supervisor execution report status: Test failed" << std::endl; + break; + } + default: + sif::warning << "ExecutionReport::printStatusInformation: Invalid status code: 0x" + << std::hex << static_cast(statusCode) << std::endl; + break; + } + } +}; + /** * @brief This dataset stores the boot status report of the supervisor. */ @@ -1409,31 +1657,36 @@ class LoggingReport : public StaticLocalDataSet { lp_var_t(sid.objectId, PoolIds::TM_AVAILABLE_CNT, this); lp_var_t supervisorBoots = lp_var_t(sid.objectId, PoolIds::SUPERVISOR_BOOTS, this); - lp_var_t mpsocBoots = - lp_var_t(sid.objectId, PoolIds::MPSOC_BOOTS, this); + lp_var_t mpsocBoots = lp_var_t(sid.objectId, PoolIds::MPSOC_BOOTS, this); lp_var_t mpsocBootFailedAttempts = lp_var_t(sid.objectId, PoolIds::MPSOC_BOOT_FAILED_ATTEMPTS, this); - lp_var_t mpsocPowerup = - lp_var_t(sid.objectId, PoolIds::MPSOC_POWER_UP, this); - lp_var_t mpsocUpdates = - lp_var_t(sid.objectId, PoolIds::MPSOC_UPDATES, this); - lp_var_t lastRecvdTc = - lp_var_t(sid.objectId, PoolIds::LAST_RECVD_TC, this); + lp_var_t mpsocPowerup = lp_var_t(sid.objectId, PoolIds::MPSOC_POWER_UP, this); + lp_var_t mpsocUpdates = lp_var_t(sid.objectId, PoolIds::MPSOC_UPDATES, this); + lp_var_t lastRecvdTc = lp_var_t(sid.objectId, PoolIds::LAST_RECVD_TC, this); void printSet() { - sif::info << "LoggingReport: Latchup happened count 0: " << this->latchupHappenCnt0 << std::endl; - sif::info << "LoggingReport: Latchup happened count 1: " << this->latchupHappenCnt0 << std::endl; - sif::info << "LoggingReport: Latchup happened count 2: " << this->latchupHappenCnt0 << std::endl; - sif::info << "LoggingReport: Latchup happened count 3: " << this->latchupHappenCnt0 << std::endl; - sif::info << "LoggingReport: Latchup happened count 4: " << this->latchupHappenCnt0 << std::endl; - sif::info << "LoggingReport: Latchup happened count 5: " << this->latchupHappenCnt0 << std::endl; - sif::info << "LoggingReport: Latchup happened count 6: " << this->latchupHappenCnt0 << std::endl; - sif::info << "LoggingReport: ADC deviation triggers count: " << this->latchupHappenCnt0 << std::endl; + sif::info << "LoggingReport: Latchup happened count 0: " << this->latchupHappenCnt0 + << std::endl; + sif::info << "LoggingReport: Latchup happened count 1: " << this->latchupHappenCnt0 + << std::endl; + sif::info << "LoggingReport: Latchup happened count 2: " << this->latchupHappenCnt0 + << std::endl; + sif::info << "LoggingReport: Latchup happened count 3: " << this->latchupHappenCnt0 + << std::endl; + sif::info << "LoggingReport: Latchup happened count 4: " << this->latchupHappenCnt0 + << std::endl; + sif::info << "LoggingReport: Latchup happened count 5: " << this->latchupHappenCnt0 + << std::endl; + sif::info << "LoggingReport: Latchup happened count 6: " << this->latchupHappenCnt0 + << std::endl; + sif::info << "LoggingReport: ADC deviation triggers count: " << this->latchupHappenCnt0 + << std::endl; sif::info << "LoggingReport: TC received count: " << this->tcReceivedCnt << std::endl; sif::info << "LoggingReport: TM available count: " << this->tmAvailableCnt << std::endl; sif::info << "LoggingReport: Supervisor boots: " << this->supervisorBoots << std::endl; sif::info << "LoggingReport: MPSoC boots: " << this->mpsocBoots << std::endl; - sif::info << "LoggingReport: MPSoC boot failed attempts: " << this->mpsocBootFailedAttempts << std::endl; + sif::info << "LoggingReport: MPSoC boot failed attempts: " << this->mpsocBootFailedAttempts + << std::endl; sif::info << "LoggingReport: MPSoC power up: " << this->mpsocPowerup << std::endl; sif::info << "LoggingReport: MPSoC updates: " << this->mpsocUpdates << std::endl; sif::info << "LoggingReport: Last received TC: " << this->lastRecvdTc << std::endl; diff --git a/linux/devices/ploc/PlocSupervisorHandler.cpp b/linux/devices/ploc/PlocSupervisorHandler.cpp index d131b63b..3668a6cd 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.cpp +++ b/linux/devices/ploc/PlocSupervisorHandler.cpp @@ -769,10 +769,24 @@ ReturnValue_t PlocSupervisorHandler::initializeLocalDataPool(localpool::DataPool } void PlocSupervisorHandler::handleEvent(EventMessage* eventMessage) { + ReturnValue_t result = RETURN_OK; object_id_t objectId = eventMessage->getReporter(); + Event event = eventMessage->getEvent(); switch (objectId) { case objects::PLOC_SUPERVISOR_HELPER: { plocSupvHelperExecuting = false; + // After execution of update procedure, PLOC is in a state where it draws approx. 700 mA of + // current. To leave this state the shutdown MPSoC command must be sent here. + if (event == PlocSupvHelper::SUPV_UPDATE_FAILED || + event == PlocSupvHelper::SUPV_UPDATE_SUCCESSFUL) { + result = this->executeAction(supv::SHUTDOWN_MPSOC, NO_COMMANDER, nullptr, 0); + if (result != RETURN_OK) { + triggerEvent(SUPV_MPSOC_SHUWDOWN_BUILD_FAILED); + sif::warning << "PlocSupervisorHandler::handleEvent: Failed to build MPSoC shutdown " + "command" << std::endl; + return; + } + } break; } default: diff --git a/linux/devices/ploc/PlocSupervisorHandler.h b/linux/devices/ploc/PlocSupervisorHandler.h index cc9c6217..b2d0352a 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.h +++ b/linux/devices/ploc/PlocSupervisorHandler.h @@ -71,6 +71,8 @@ class PlocSupervisorHandler : public DeviceHandlerBase { static const Event SUPV_CRC_FAILURE_EVENT = MAKE_EVENT(4, severity::LOW); //! [EXPORT] : [COMMENT] Supervisor helper currently executing a command static const Event SUPV_HELPER_EXECUTING = MAKE_EVENT(5, severity::LOW); + //! [EXPORT] : [COMMENT] Failed to build the command to shutdown the MPSoC + static const Event SUPV_MPSOC_SHUWDOWN_BUILD_FAILED = MAKE_EVENT(5, severity::LOW); static const uint16_t APID_MASK = 0x7FF; static const uint16_t PACKET_SEQUENCE_COUNT_MASK = 0x3FFF; diff --git a/linux/devices/ploc/PlocSupvHelper.cpp b/linux/devices/ploc/PlocSupvHelper.cpp index c1f66d08..67f158a6 100644 --- a/linux/devices/ploc/PlocSupvHelper.cpp +++ b/linux/devices/ploc/PlocSupvHelper.cpp @@ -149,7 +149,8 @@ ReturnValue_t PlocSupvHelper::performUpdate() { return result; } #if OBSW_DEBUG_PLOC_SUPERVISOR == 1 - ProgressPrinter progressPrinter("Supervisor update", update.length, ProgressPrinter::ONE_PERCENT); + ProgressPrinter progressPrinter("Supervisor update", update.length, + ProgressPrinter::HALF_PERCENT); #endif /* OBSW_DEBUG_PLOC_SUPERVISOR == 1 */ uint8_t tempData[supv::WriteMemory::CHUNK_MAX]; std::ifstream file(update.file, std::ifstream::binary); @@ -172,9 +173,9 @@ ReturnValue_t PlocSupvHelper::performUpdate() { file.read(reinterpret_cast(tempData), dataLength); if (!file) { sif::warning << "PlocSupvHelper::performUpdate: Read only " << file.gcount() << " of " - << dataLength << " bytes" << std::endl; + << dataLength << " bytes" << std::endl; sif::info << "PlocSupvHelper::performUpdate: Failed when trying to read byte " - << bytesWritten << std::endl; + << bytesWritten << std::endl; } remainingSize -= dataLength; } else { @@ -280,64 +281,48 @@ ReturnValue_t PlocSupvHelper::sendCommand(SpacePacket& packet) { ReturnValue_t PlocSupvHelper::handleAck() { ReturnValue_t result = RETURN_OK; - supv::TmPacket tmPacket; - result = handleTmReception(&tmPacket, supv::SIZE_ACK_REPORT); + supv::AcknowledgmentReport ackReport; + result = handleTmReception(&ackReport, supv::SIZE_ACK_REPORT); if (result != RETURN_OK) { triggerEvent(ACK_RECEPTION_FAILURE, result, static_cast(rememberApid)); sif::warning << "PlocSupvHelper::handleAck: Error in reception of acknowledgment report" << std::endl; return result; } - uint16_t apid = tmPacket.getAPID(); - if (apid != supv::APID_ACK_SUCCESS) { - handleAckApidFailure(apid); - return RETURN_FAILED; + result = ackReport.checkApid(); + if (result != RETURN_OK) { + if (result == SupvReturnValuesIF::RECEIVED_ACK_FAILURE) { + triggerEvent(SUPV_ACK_FAILURE_REPORT, static_cast(ackReport.getRefApid())); + } else if (result == SupvReturnValuesIF::INVALID_APID) { + triggerEvent(SUPV_ACK_INVALID_APID, static_cast(rememberApid)); + } + return result; } return RETURN_OK; } -void PlocSupvHelper::handleAckApidFailure(uint16_t apid) { - if (apid == supv::APID_ACK_FAILURE) { - triggerEvent(SUPV_ACK_FAILURE_REPORT, static_cast(internalState)); - sif::warning << "PlocSupvHelper::handleAckApidFailure: Received acknowledgement failure " - << "report" << std::endl; - } else { - triggerEvent(SUPV_ACK_INVALID_APID, apid, static_cast(internalState)); - sif::warning << "PlocSupvHelper::handleAckApidFailure: Expected acknowledgement report " - << "but received space packet with apid " << std::hex << apid << std::endl; - } -} - ReturnValue_t PlocSupvHelper::handleExe(uint32_t timeout) { ReturnValue_t result = RETURN_OK; - supv::TmPacket tmPacket; - result = handleTmReception(&tmPacket, supv::SIZE_EXE_REPORT, timeout); + supv::ExecutionReport exeReport; + result = handleTmReception(&exeReport, supv::SIZE_EXE_REPORT, timeout); if (result != RETURN_OK) { triggerEvent(EXE_RECEPTION_FAILURE, result, static_cast(rememberApid)); sif::warning << "PlocSupvHelper::handleExe: Error in reception of execution report" << std::endl; return result; } - uint16_t apid = tmPacket.getAPID(); - if (apid != supv::APID_EXE_SUCCESS) { - handleExeApidFailure(apid); - return RETURN_FAILED; + result = exeReport.checkApid(); + if (result != RETURN_OK) { + if (result == SupvReturnValuesIF::RECEIVED_EXE_FAILURE) { + triggerEvent(SUPV_EXE_FAILURE_REPORT, static_cast(exeReport.getRefApid())); + } else if (result == SupvReturnValuesIF::INVALID_APID) { + triggerEvent(SUPV_EXE_INVALID_APID, static_cast(rememberApid)); + } + return result; } return RETURN_OK; } -void PlocSupvHelper::handleExeApidFailure(uint16_t apid) { - if (apid == supv::APID_EXE_FAILURE) { - triggerEvent(SUPV_EXE_FAILURE_REPORT, static_cast(internalState)); - sif::warning << "PlocSupvHelper::handleExeApidFailure: Received execution failure " - << "report" << std::endl; - } else { - triggerEvent(SUPV_EXE_INVALID_APID, apid, static_cast(internalState)); - sif::warning << "PlocSupvHelper::handleExeApidFailure: Expected execution report " - << "but received space packet with apid " << std::hex << apid << std::endl; - } -} - ReturnValue_t PlocSupvHelper::handleTmReception(supv::TmPacket* tmPacket, size_t remainingBytes, uint32_t timeout) { ReturnValue_t result = RETURN_OK; @@ -404,7 +389,8 @@ ReturnValue_t PlocSupvHelper::calcImageCrc() { uint16_t remainder = CRC16_INIT; uint8_t input; #if OBSW_DEBUG_PLOC_SUPERVISOR == 1 - ProgressPrinter progress("Supervisor update crc calculation", update.length); + ProgressPrinter progress("Supervisor update crc calculation", update.length, + ProgressPrinter::ONE_PERCENT); #endif /* OBSW_DEBUG_PLOC_SUPERVISOR == 1 */ uint32_t byteCount = 0; for (byteCount = 0; byteCount < update.length; byteCount++) { @@ -442,7 +428,7 @@ ReturnValue_t PlocSupvHelper::handleCheckMemoryCommand() { if (result != RETURN_OK) { return result; } - result = handleExe(); + result = handleExe(CRC_EXECUTION_TIMEOUT); if (result != RETURN_OK) { return result; } diff --git a/linux/devices/ploc/PlocSupvHelper.h b/linux/devices/ploc/PlocSupvHelper.h index 6529e8ad..f8002baf 100644 --- a/linux/devices/ploc/PlocSupvHelper.h +++ b/linux/devices/ploc/PlocSupvHelper.h @@ -61,8 +61,8 @@ class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public Ha //! [EXPORT] : [COMMENT] Supervisor received acknowledgment failure report //! P1: Internal state of supervisor helper static const Event SUPV_ACK_FAILURE_REPORT = MAKE_EVENT(11, severity::LOW); - //! [EXPORT] : [COMMENT] Supervisor received execution failure report - //! P1: Internal state of supervisor + //! [EXPORT] : [COMMENT] Execution report failure + //! P1: static const Event SUPV_EXE_FAILURE_REPORT = MAKE_EVENT(12, severity::LOW); //! [EXPORT] : [COMMENT] Supervisor expected acknowledgment report but received space packet with other apid //! P1: Apid of received space packet @@ -129,6 +129,7 @@ class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public Ha static const uint8_t NUM_EVENT_BUFFER_PACKETS = 25; static const size_t SIZE_EVENT_BUFFER_FULL_PACKET = 1024; static const size_t SIZE_EVENT_BUFFER_LAST_PACKET = 200; + static const uint32_t CRC_EXECUTION_TIMEOUT = 60000; struct Update { uint8_t memoryId; @@ -190,8 +191,6 @@ class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public Ha ReturnValue_t receive(uint8_t* data, size_t* readBytes, size_t requestBytes); ReturnValue_t handleAck(); ReturnValue_t handleExe(uint32_t timeout = 1000); - void handleAckApidFailure(uint16_t apid); - void handleExeApidFailure(uint16_t apid); /** * @brief Handles reading of TM packets from the communication interface * diff --git a/linux/fsfwconfig/OBSWConfig.h.in b/linux/fsfwconfig/OBSWConfig.h.in index 23980eac..0903169b 100644 --- a/linux/fsfwconfig/OBSWConfig.h.in +++ b/linux/fsfwconfig/OBSWConfig.h.in @@ -41,8 +41,8 @@ debugging. */ #define OBSW_ADD_MGT 1 #define OBSW_ADD_BPX_BATTERY_HANDLER 1 #define OBSW_ADD_STAR_TRACKER @OBSW_ADD_STAR_TRACKER@ -#define OBSW_ADD_PLOC_SUPERVISOR 0 -#define OBSW_ADD_PLOC_MPSOC 0 +#define OBSW_ADD_PLOC_SUPERVISOR 1 +#define OBSW_ADD_PLOC_MPSOC 1 #define OBSW_ADD_SUN_SENSORS 1 #define OBSW_ADD_SUS_BOARD_ASS 1 #define OBSW_ADD_ACS_BOARD 1 @@ -53,6 +53,7 @@ debugging. */ #define OBSW_ADD_RAD_SENSORS 1 #define OBSW_ADD_PL_PCDU 1 #define OBSW_ADD_SYRLINKS 0 +#define OBSW_ADD_GPS 1 #define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0 #define OBSW_STAR_TRACKER_GROUND_CONFIG 1 diff --git a/mission/utility/ProgressPrinter.cpp b/mission/utility/ProgressPrinter.cpp index 3a7de549..9505d7b1 100644 --- a/mission/utility/ProgressPrinter.cpp +++ b/mission/utility/ProgressPrinter.cpp @@ -1,16 +1,17 @@ +#include #include "ProgressPrinter.h" - #include "fsfw/serviceinterface/ServiceInterfaceStream.h" -ProgressPrinter::ProgressPrinter(std::string name, uint32_t numSteps, uint32_t percentageResolution) +ProgressPrinter::ProgressPrinter(std::string name, uint32_t numSteps, float percentageResolution) : name(name), numSteps(numSteps), percentageResolution(percentageResolution) {} ProgressPrinter::~ProgressPrinter() {} void ProgressPrinter::print(uint32_t currentStep) { float progressInPercent = static_cast(currentStep) / static_cast(numSteps) * 100; - if (static_cast(progressInPercent) >= nextProgressPrint) { - sif::info << name << " progress: " << progressInPercent << " %" << std::endl; + if (progressInPercent >= nextProgressPrint) { + sif::info << name << " progress: " << std::setprecision(4) << progressInPercent << " %" + << std::endl; nextProgressPrint += percentageResolution; } } diff --git a/mission/utility/ProgressPrinter.h b/mission/utility/ProgressPrinter.h index 7185a655..302aaa28 100644 --- a/mission/utility/ProgressPrinter.h +++ b/mission/utility/ProgressPrinter.h @@ -11,7 +11,9 @@ class ProgressPrinter { public: - static const uint32_t ONE_PERCENT = 1; + static constexpr float HALF_PERCENT = 0.5; + static constexpr float ONE_PERCENT = 1; + static constexpr float FIVE_PERCENT = 5; /** * @brief Constructor @@ -21,7 +23,7 @@ class ProgressPrinter { * @param percentageResolution Distance between printed percentage steps. E.g. 5 means that * a printout will be generated after 0%, 5%, 10% etc. */ - ProgressPrinter(std::string name, uint32_t numSteps, uint32_t percentageResolution = FIVE_PERCENT); + ProgressPrinter(std::string name, uint32_t numSteps, float percentageResolution = FIVE_PERCENT); virtual ~ProgressPrinter(); /** @@ -32,12 +34,11 @@ class ProgressPrinter { void print(uint32_t step); private: - static constexpr uint32_t FIVE_PERCENT = 5; std::string name = ""; uint32_t numSteps = 0; - uint32_t nextProgressPrint = 0; - uint32_t percentageResolution = 0; + float nextProgressPrint = 0; + float percentageResolution = 0; }; #endif /* MISSION_UTILITY_PROGRESSPRINTER_H_ */ diff --git a/tmtc b/tmtc index ad53f3e9..af4e3ea5 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit ad53f3e9bb526bf030905d24781af57ae6ac5b01 +Subproject commit af4e3ea5747e381ac2dfc164223dbaa361257acd From 3e8429b34b5a72dcb61109a8067ef2d27a503f8f Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Mon, 25 Apr 2022 13:36:06 +0200 Subject: [PATCH 03/11] warning print when memory check command fails --- linux/devices/ploc/PlocSupvHelper.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux/devices/ploc/PlocSupvHelper.cpp b/linux/devices/ploc/PlocSupvHelper.cpp index 67f158a6..ff0d5d5e 100644 --- a/linux/devices/ploc/PlocSupvHelper.cpp +++ b/linux/devices/ploc/PlocSupvHelper.cpp @@ -426,6 +426,9 @@ ReturnValue_t PlocSupvHelper::handleCheckMemoryCommand() { static_cast(updateStatusReport.getNominalSize()), supv::recv_timeout::UPDATE_STATUS_REPORT); if (result != RETURN_OK) { + sif::warning + << "PlocSupvHelper::handleCheckMemoryCommand: Failed to receive update status report" + << std::endl; return result; } result = handleExe(CRC_EXECUTION_TIMEOUT); From 42194abb4a402ced6a6948f72716bfe53a375f60 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Mon, 25 Apr 2022 13:36:30 +0200 Subject: [PATCH 04/11] commented in read function again --- linux/devices/GPSHyperionLinuxController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index c8cf398f..42bc43a6 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -26,7 +26,7 @@ GPSHyperionLinuxController::~GPSHyperionLinuxController() {} void GPSHyperionLinuxController::performControlOperation() { #ifdef FSFW_OSAL_LINUX -// readGpsDataFromGpsd(); + readGpsDataFromGpsd(); #endif } From 8610e48b1922d6f62d2a2c03b5dd81b760e8f1b5 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Wed, 27 Apr 2022 16:08:17 +0200 Subject: [PATCH 05/11] countdown based timeout --- README.md | 10 +++++++++- bsp_q7s/core/InitMission.cpp | 2 +- fsfw | 2 +- .../PlocSupervisorDefinitions.h | 4 ++-- linux/devices/ploc/PlocSupervisorHandler.cpp | 20 +++++++++++++++++-- linux/devices/ploc/PlocSupervisorHandler.h | 12 +++++++++++ mission/tmtc/CCSDSHandler.cpp | 4 ++-- mission/tmtc/CCSDSHandler.h | 6 +++--- 8 files changed, 48 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 7f9e9d72..3200dab1 100644 --- a/README.md +++ b/README.md @@ -1197,7 +1197,7 @@ in the same way. # Coding Style * the formatting is based on the clang-format tools -## Setting up eclipse auto-fromatter with clang-format +## Setting auto-fromatter with clang-format in Xilinx SDK 1. Help → Install New Software → Add 2. In location insert the link http://www.cppstyle.com/luna 3. The software package CppStyle should now be available for installation @@ -1206,3 +1206,11 @@ in the same way. 6. Insert the path to the clang-format executable 7. Under C/C++ → Code Style → Formatter, change the formatter to CppStyle (clang-format) 8. Code can now be formatted with the clang tool by using the key combination Ctrl + Shift + f + +## Setting up auto-fromatter with clang-format in eclipse +1. Help → Eclipse market place → Search for "Cppstyle" and install +2. On windows download the clang-formatting tools from https://llvm.org/builds/. On linux clang-format can be installed with the package manager. +3. Navigate to Preferences → C/C++ → CppStyle +4. Insert the path to the clang-format executable +5. Under C/C++ → Code Style → Formatter, change the formatter to CppStyle (clang-format) +6. Code can now be formatted with the clang tool by using the key combination Ctrl + Shift + f diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index 919e9fbd..2cd6486e 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -173,7 +173,7 @@ void initmission::initTasks() { #if OBSW_ADD_PLOC_SUPERVISOR == 1 PeriodicTaskIF* supvHelperTask = factory->createPeriodicTask( - "PLOC_SUPV_HELPER", 10, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 1.0, missedDeadlineFunc); + "PLOC_SUPV_HELPER", 10, PeriodicTaskIF::MINIMUM_STACK_SIZE * 8, 1.0, missedDeadlineFunc); result = supvHelperTask->addComponent(objects::PLOC_SUPERVISOR_HELPER); if (result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("PLOC_SUPV_HELPER", objects::PLOC_SUPERVISOR_HELPER); diff --git a/fsfw b/fsfw index 9f7b9be8..900ef5b9 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 9f7b9be800402215e97759eb35d4c40a484d1f68 +Subproject commit 900ef5b9124063b5eec88de19d851006b2e1e601 diff --git a/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h b/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h index 11af022b..a0592ce3 100644 --- a/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +++ b/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h @@ -268,7 +268,7 @@ static const uint32_t ADC_REPORT_SET_ID = REQUEST_ADC_REPORT; namespace recv_timeout { // Erase memory can require up to 60 seconds for execution static const uint32_t ERASE_MEMORY = 60000; -static const uint32_t UPDATE_STATUS_REPORT = 60000; +static const uint32_t UPDATE_STATUS_REPORT = 70000; } // namespace recv_timeout /** @@ -1163,7 +1163,7 @@ class WriteMemory : public SupvTcSpacePacket { SerializeIF::Endianness::BIG); std::memcpy(dataFieldPtr, updateData, length); if (length % 2 != 0) { - this->setPacketDataLength(this->getFullSize() + 1); + this->setPacketDataLength(length + sizeof(CCSDSPrimaryHeader) + CRC_SIZE - 1); // The data field must be two bytes aligned. Thus, in case the number of bytes to write is odd // a value of zero is added here *(dataFieldPtr + length + 1) = 0; diff --git a/linux/devices/ploc/PlocSupervisorHandler.cpp b/linux/devices/ploc/PlocSupervisorHandler.cpp index 3668a6cd..35a11124 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.cpp +++ b/linux/devices/ploc/PlocSupervisorHandler.cpp @@ -402,7 +402,7 @@ void PlocSupervisorHandler::fillCommandAndReplyMap() { this->insertInCommandAndReplyMap(FIRST_MRAM_DUMP, 3); this->insertInCommandAndReplyMap(CONSECUTIVE_MRAM_DUMP, 3); this->insertInReplyMap(ACK_REPORT, 3, nullptr, SIZE_ACK_REPORT); - this->insertInReplyMap(EXE_REPORT, 50, nullptr, SIZE_EXE_REPORT); + this->insertInReplyMap(EXE_REPORT, 0, nullptr, SIZE_EXE_REPORT, false, &executionTimeout); this->insertInReplyMap(HK_REPORT, 3, &hkset, SIZE_HK_REPORT); this->insertInReplyMap(BOOT_STATUS_REPORT, 3, &bootStatusReport, SIZE_BOOT_STATUS_REPORT); this->insertInReplyMap(LATCHUP_REPORT, 3, &latchupStatusReport, SIZE_LATCHUP_STATUS_REPORT); @@ -546,6 +546,8 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite << " not in replyMap" << std::endl; } + setExecutionTimeout(command->first); + return RETURN_OK; } @@ -795,6 +797,19 @@ void PlocSupervisorHandler::handleEvent(EventMessage* eventMessage) { } } +void PlocSupervisorHandler::setExecutionTimeout(DeviceCommandId_t command) { + using namespace supv; + switch(command) { + case FIRST_MRAM_DUMP: + case CONSECUTIVE_MRAM_DUMP: + executionTimeout.setTimeout(MRAM_DUMP_EXECUTION_TIMEOUT); + break; + default: + executionTimeout.setTimeout(EXECUTION_DEFAULT_TIMEOUT); + break; + } +} + ReturnValue_t PlocSupervisorHandler::verifyPacket(const uint8_t* start, size_t foundLen) { uint16_t receivedCrc = *(start + foundLen - 2) << 8 | *(start + foundLen - 1); uint16_t recalculatedCrc = CRC::crc16ccitt(start, foundLen - 2); @@ -1237,7 +1252,8 @@ size_t PlocSupervisorHandler::getNextReplyLength(DeviceCommandId_t commandId) { DeviceReplyIter iter = deviceReplyMap.find(nextReplyId); if (iter != deviceReplyMap.end()) { - if (iter->second.delayCycles == 0) { + if ((iter->second.delayCycles == 0 && iter->second.countdown == nullptr) || + (not iter->second.active && iter->second.countdown != nullptr)) { /* Reply inactive */ return replyLen; } diff --git a/linux/devices/ploc/PlocSupervisorHandler.h b/linux/devices/ploc/PlocSupervisorHandler.h index b2d0352a..19ccfa63 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.h +++ b/linux/devices/ploc/PlocSupervisorHandler.h @@ -8,6 +8,7 @@ #include "fsfw_hal/linux/gpio/Gpio.h" #include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h" #include "fsfw_hal/linux/uart/UartComIF.h" +#include "fsfw/timemanager/Countdown.h" #include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h" #include "linux/devices/devicedefinitions/SupvReturnValuesIF.h" #include "PlocSupvHelper.h" @@ -78,6 +79,10 @@ class PlocSupervisorHandler : public DeviceHandlerBase { static const uint16_t PACKET_SEQUENCE_COUNT_MASK = 0x3FFF; static const uint8_t EXE_STATUS_OFFSET = 10; static const uint8_t SIZE_NULL_TERMINATOR = 1; + // 5 s + static const uint32_t EXECUTION_DEFAULT_TIMEOUT = 5000; + // 30 s + static const uint32_t MRAM_DUMP_EXECUTION_TIMEOUT = 30000; uint8_t commandBuffer[supv::MAX_COMMAND_SIZE]; @@ -128,6 +133,13 @@ class PlocSupervisorHandler : public DeviceHandlerBase { // Supervisor helper class currently executing a command bool plocSupvHelperExecuting = false; + Countdown executionTimeout = Countdown(EXECUTION_DEFAULT_TIMEOUT, false); + + /** + * @brief Adjusts the timeout of the execution report dependent on command + */ + void setExecutionTimeout(DeviceCommandId_t command); + /** * @brief Handles event messages received from the supervisor helper */ diff --git a/mission/tmtc/CCSDSHandler.cpp b/mission/tmtc/CCSDSHandler.cpp index a42a798a..0c49f6af 100644 --- a/mission/tmtc/CCSDSHandler.cpp +++ b/mission/tmtc/CCSDSHandler.cpp @@ -22,7 +22,7 @@ CCSDSHandler::CCSDSHandler(object_id_t objectId, object_id_t ptmeId, object_id_t gpioIF(gpioIF), enTxClock(enTxClock), enTxData(enTxData), - TRANSMITTER_TIMEOUT(transmitterTimeout) { + transmitterTimeout(transmitterTimeout) { commandQueue = QueueFactory::instance()->createMessageQueue(QUEUE_SIZE); auto mqArgs = MqArgs(objectId, static_cast(this)); eventQueue = @@ -312,7 +312,7 @@ void CCSDSHandler::enableTransmit() { // Transmitter already enabled return; } - transmitterCountdown.setTimeout(TRANSMITTER_TIMEOUT); + transmitterCountdown.setTimeout(transmitterTimeout); #ifndef TE0720_1CFA gpioIF->pullHigh(enTxClock); gpioIF->pullHigh(enTxData); diff --git a/mission/tmtc/CCSDSHandler.h b/mission/tmtc/CCSDSHandler.h index 1c4fde09..d4cf1da4 100644 --- a/mission/tmtc/CCSDSHandler.h +++ b/mission/tmtc/CCSDSHandler.h @@ -133,9 +133,9 @@ class CCSDSHandler : public SystemObject, gpioId_t enTxClock = gpio::NO_GPIO; gpioId_t enTxData = gpio::NO_GPIO; - // syrlinks must not be transmitting more than 15 minutes (according to datasheet) - // Value can be configured via CTOR argument to allow test setups - const uint32_t TRANSMITTER_TIMEOUT = 900000; // 900000 ms = 15 min + // Syrlinks must not be transmitting more than 15 minutes (according to datasheet) + // Value initialized by constructor argument + const uint32_t transmitterTimeout = 0; // Countdown to disable transmitter after 15 minutes Countdown transmitterCountdown; From 20a2aa73ae02e2e73ec657670f620ae11be0ebb5 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Wed, 27 Apr 2022 16:09:07 +0200 Subject: [PATCH 06/11] tmtc update --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index af4e3ea5..5de92a36 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit af4e3ea5747e381ac2dfc164223dbaa361257acd +Subproject commit 5de92a366a7e7b63c80b536ec345faa8c3a58e2f From a1c3b1786f073e20e65ce177d47b2aad6c807c61 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 28 Apr 2022 10:07:42 +0200 Subject: [PATCH 07/11] bump submodules --- fsfw | 2 +- tmtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fsfw b/fsfw index 24ef96d1..d61fe7db 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 24ef96d1b802e768d395f94b69f9f81a3c6d1e66 +Subproject commit d61fe7db93b37dd6652dbfee5b7c93f400ac5a11 diff --git a/tmtc b/tmtc index 28983d38..76da8042 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 28983d387b82578a73fbfe052cb53dec1910d021 +Subproject commit 76da8042a4601087e99fa856af241afe9e43695d From 584700a2ba089224ddd08a5f025ba544b936c293 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 28 Apr 2022 10:21:04 +0200 Subject: [PATCH 08/11] do not add ETL lib --- CMakeLists.txt | 6 ------ linux/devices/GPSHyperionLinuxController.cpp | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9291e0db..79017dda 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -301,12 +301,6 @@ target_include_directories(${WATCHDOG_NAME} PUBLIC #unittests add_executable(${UNITTEST_NAME} EXCLUDE_FROM_ALL) - - -if(EIVE_ADD_ETL_LIB) - add_subdirectory(${LIB_ETL_PATH}) -endif() - if(EIVE_ADD_JSON_LIB) add_subdirectory(${LIB_JSON_PATH}) endif() diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index 9c762842..669438b9 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -106,7 +106,7 @@ ReturnValue_t GPSHyperionLinuxController::handleCommandMessage(CommandMessage *m #ifdef FSFW_OSAL_LINUX void GPSHyperionLinuxController::readGpsDataFromGpsd() { - gpsmm myGpsmm(GPSD_SHARED_MEMORY, nullptr); + gpsmm myGpsmm("localhost", DEFAULT_GPSD_PORT); // The data from the device will generally be read all at once. Therefore, we // can set all field here if (not myGpsmm.is_open()) { From 234a6b7ac351de2beed25f18124604315fdb91d3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 28 Apr 2022 10:50:39 +0200 Subject: [PATCH 09/11] switch gps ctrl to socket API --- linux/devices/GPSHyperionLinuxController.cpp | 45 ++++++++++++++++---- linux/devices/GPSHyperionLinuxController.h | 1 + 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index 669438b9..5a7d9808 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -1,5 +1,7 @@ #include "GPSHyperionLinuxController.h" +#include + #include "OBSWConfig.h" #include "fsfw/FSFW.h" #include "fsfw/datapool/PoolReadGuard.h" @@ -106,10 +108,10 @@ ReturnValue_t GPSHyperionLinuxController::handleCommandMessage(CommandMessage *m #ifdef FSFW_OSAL_LINUX void GPSHyperionLinuxController::readGpsDataFromGpsd() { - gpsmm myGpsmm("localhost", DEFAULT_GPSD_PORT); + gpsmm gpsmm("localhost", DEFAULT_GPSD_PORT); // The data from the device will generally be read all at once. Therefore, we // can set all field here - if (not myGpsmm.is_open()) { + if (not gpsmm.is_open()) { if (gpsNotOpenSwitch) { // Opening failed #if FSFW_VERBOSE_LEVEL >= 1 @@ -121,16 +123,41 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() { } return; } + // Stopwatch watch; gps_data_t *gps = nullptr; - gps = myGpsmm.read(); + gps = gpsmm.stream(WATCH_ENABLE | WATCH_JSON); if (gps == nullptr) { - if (gpsReadFailedSwitch) { - gpsReadFailedSwitch = false; - sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd: Reading GPS data failed" - << std::endl; - } - return; + sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd:: Setting GPSD watch " + "policy failed" + << std::endl; } + while (gpsmm.waiting(2000)) { + gps = gpsmm.read(); + if (gps == nullptr) { + if (gpsReadFailedSwitch) { + gpsReadFailedSwitch = false; + sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd: Reading GPS data failed" + << std::endl; + } + return; + } + if (MODE_SET != (MODE_SET & gps->set)) { + if (noModeSetCntr >= 0) { + noModeSetCntr++; + } + if (noModeSetCntr == 10) { + // TODO: Trigger event here + sif::warning << "GPSHyperionHandler::readGpsDataFromGpsd: No mode could be " + "read for 10 consecutive reads" + << std::endl; + noModeSetCntr = -1; + } + return; + } else { + noModeSetCntr = 0; + } + } + gps = gpsmm.stream(WATCH_DISABLE); PoolReadGuard pg(&gpsSet); if (pg.getReadResult() != HasReturnvaluesIF::RETURN_OK) { #if FSFW_VERBOSE_LEVEL >= 1 diff --git a/linux/devices/GPSHyperionLinuxController.h b/linux/devices/GPSHyperionLinuxController.h index 42e9741b..8d0ec0cd 100644 --- a/linux/devices/GPSHyperionLinuxController.h +++ b/linux/devices/GPSHyperionLinuxController.h @@ -55,6 +55,7 @@ class GPSHyperionLinuxController : public ExtendedControllerBase { bool gpsNotOpenSwitch = true; bool gpsReadFailedSwitch = true; bool debugHyperionGps = false; + int32_t noModeSetCntr = 0; uint32_t timeIsConstantCounter = 0; Countdown timeUpdateCd = Countdown(60); From 898753f6e3f51194b208c56a006dd71213fe55cd Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Thu, 28 Apr 2022 11:27:28 +0200 Subject: [PATCH 10/11] supervisor reset pl command --- .../devices/devicedefinitions/PlocSupervisorDefinitions.h | 2 ++ linux/devices/ploc/PlocSupervisorHandler.cpp | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h b/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h index a0592ce3..f77fad3b 100644 --- a/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +++ b/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h @@ -55,6 +55,7 @@ static const DeviceCommandId_t LOGGING_REQUEST_EVENT_BUFFERS = 54; static const DeviceCommandId_t LOGGING_CLEAR_COUNTERS = 55; static const DeviceCommandId_t LOGGING_SET_TOPIC = 56; static const DeviceCommandId_t REQUEST_ADC_REPORT = 57; +static const DeviceCommandId_t RESET_PL = 58; /** Reply IDs */ static const DeviceCommandId_t ACK_REPORT = 50; @@ -101,6 +102,7 @@ static const uint16_t APID_SEL_MPSOC_BOOT_IMAGE = 0xA3; static const uint16_t APID_SET_BOOT_TIMEOUT = 0xA4; static const uint16_t APID_SET_MAX_RESTART_TRIES = 0xA5; static const uint16_t APID_RESET_MPSOC = 0xA6; +static const uint16_t APID_RESET_PL = 0xA7; static const uint16_t APID_GET_BOOT_STATUS_RPT = 0xA8; static const uint16_t APID_PREPARE_UPDATE = 0xA9; static const uint16_t APID_START_MPSOC_QUIET = 0xAA; diff --git a/linux/devices/ploc/PlocSupervisorHandler.cpp b/linux/devices/ploc/PlocSupervisorHandler.cpp index 35a11124..fd7406cf 100644 --- a/linux/devices/ploc/PlocSupervisorHandler.cpp +++ b/linux/devices/ploc/PlocSupervisorHandler.cpp @@ -344,6 +344,11 @@ ReturnValue_t PlocSupervisorHandler::buildCommandFromCommand(DeviceCommandId_t d result = RETURN_OK; break; } + case RESET_PL: { + prepareEmptyCmd(APID_RESET_PL); + result = RETURN_OK; + break; + } default: sif::debug << "PlocSupervisorHandler::buildCommandFromCommand: Command not implemented" << std::endl; @@ -399,6 +404,7 @@ void PlocSupervisorHandler::fillCommandAndReplyMap() { this->insertInCommandMap(LOGGING_REQUEST_COUNTERS); this->insertInCommandMap(LOGGING_CLEAR_COUNTERS); this->insertInCommandMap(LOGGING_SET_TOPIC); + this->insertInCommandMap(RESET_PL); this->insertInCommandAndReplyMap(FIRST_MRAM_DUMP, 3); this->insertInCommandAndReplyMap(CONSECUTIVE_MRAM_DUMP, 3); this->insertInReplyMap(ACK_REPORT, 3, nullptr, SIZE_ACK_REPORT); @@ -521,6 +527,7 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite case DISABLE_AUTO_TM: case LOGGING_CLEAR_COUNTERS: case LOGGING_SET_TOPIC: + case RESET_PL: enabledReplies = 2; break; default: From e18661bb59b5d685c4750fd1f920a5b557c353c3 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Thu, 28 Apr 2022 14:30:35 +0200 Subject: [PATCH 11/11] update fsfw --- fsfw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fsfw b/fsfw index 41682aab..0aee8644 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 41682aab3fe5893184c2eb3dcc748c08d7a7bf0c +Subproject commit 0aee86442eafa6d8827435e2c2e22074ba733e34