works like a charm
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
Robin Müller 2023-03-22 02:20:14 +01:00
parent 2dc22a7d8f
commit 57f5a22b04
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
32 changed files with 406 additions and 301 deletions

View File

@ -1,7 +1,7 @@
/** /**
* @brief Auto-generated event translation file. Contains 279 translations. * @brief Auto-generated event translation file. Contains 279 translations.
* @details * @details
* Generated on: 2023-03-21 23:59:36 * Generated on: 2023-03-22 01:14:08
*/ */
#include "translateEvents.h" #include "translateEvents.h"
@ -172,7 +172,7 @@ const char *FIRMWARE_UPDATE_SUCCESSFUL_STRING = "FIRMWARE_UPDATE_SUCCESSFUL";
const char *FIRMWARE_UPDATE_FAILED_STRING = "FIRMWARE_UPDATE_FAILED"; const char *FIRMWARE_UPDATE_FAILED_STRING = "FIRMWARE_UPDATE_FAILED";
const char *STR_HELPER_READING_REPLY_FAILED_STRING = "STR_HELPER_READING_REPLY_FAILED"; const char *STR_HELPER_READING_REPLY_FAILED_STRING = "STR_HELPER_READING_REPLY_FAILED";
const char *STR_HELPER_COM_ERROR_STRING = "STR_HELPER_COM_ERROR"; const char *STR_HELPER_COM_ERROR_STRING = "STR_HELPER_COM_ERROR";
const char *STR_HELPER_NO_REPLY_STRING = "STR_HELPER_NO_REPLY"; const char *STR_HELPER_REPLY_TIMEOUT_STRING = "STR_HELPER_REPLY_TIMEOUT";
const char *STR_HELPER_DEC_ERROR_STRING = "STR_HELPER_DEC_ERROR"; const char *STR_HELPER_DEC_ERROR_STRING = "STR_HELPER_DEC_ERROR";
const char *POSITION_MISMATCH_STRING = "POSITION_MISMATCH"; const char *POSITION_MISMATCH_STRING = "POSITION_MISMATCH";
const char *STR_HELPER_FILE_NOT_EXISTS_STRING = "STR_HELPER_FILE_NOT_EXISTS"; const char *STR_HELPER_FILE_NOT_EXISTS_STRING = "STR_HELPER_FILE_NOT_EXISTS";
@ -617,16 +617,16 @@ const char *translateEvents(Event event) {
case (12510): case (12510):
return STR_HELPER_COM_ERROR_STRING; return STR_HELPER_COM_ERROR_STRING;
case (12511): case (12511):
return STR_HELPER_NO_REPLY_STRING; return STR_HELPER_REPLY_TIMEOUT_STRING;
case (12512):
return STR_HELPER_DEC_ERROR_STRING;
case (12513): case (12513):
return POSITION_MISMATCH_STRING; return STR_HELPER_DEC_ERROR_STRING;
case (12514): case (12514):
return STR_HELPER_FILE_NOT_EXISTS_STRING; return POSITION_MISMATCH_STRING;
case (12515): case (12515):
return STR_HELPER_SENDING_PACKET_FAILED_STRING; return STR_HELPER_FILE_NOT_EXISTS_STRING;
case (12516): case (12516):
return STR_HELPER_SENDING_PACKET_FAILED_STRING;
case (12517):
return STR_HELPER_REQUESTING_MSG_FAILED_STRING; return STR_HELPER_REQUESTING_MSG_FAILED_STRING;
case (12600): case (12600):
return MPSOC_FLASH_WRITE_FAILED_STRING; return MPSOC_FLASH_WRITE_FAILED_STRING;

View File

@ -2,7 +2,7 @@
* @brief Auto-generated object translation file. * @brief Auto-generated object translation file.
* @details * @details
* Contains 169 translations. * Contains 169 translations.
* Generated on: 2023-03-21 23:59:36 * Generated on: 2023-03-22 01:14:08
*/ */
#include "translateObjects.h" #include "translateObjects.h"
@ -50,7 +50,7 @@ const char *PLPCDU_HANDLER_STRING = "PLPCDU_HANDLER";
const char *RAD_SENSOR_STRING = "RAD_SENSOR"; const char *RAD_SENSOR_STRING = "RAD_SENSOR";
const char *PLOC_UPDATER_STRING = "PLOC_UPDATER"; const char *PLOC_UPDATER_STRING = "PLOC_UPDATER";
const char *PLOC_MEMORY_DUMPER_STRING = "PLOC_MEMORY_DUMPER"; const char *PLOC_MEMORY_DUMPER_STRING = "PLOC_MEMORY_DUMPER";
const char *STR_HELPER_STRING = "STR_HELPER"; const char *STR_COM_IF_STRING = "STR_COM_IF";
const char *PLOC_MPSOC_HELPER_STRING = "PLOC_MPSOC_HELPER"; const char *PLOC_MPSOC_HELPER_STRING = "PLOC_MPSOC_HELPER";
const char *AXI_PTME_CONFIG_STRING = "AXI_PTME_CONFIG"; const char *AXI_PTME_CONFIG_STRING = "AXI_PTME_CONFIG";
const char *PTME_CONFIG_STRING = "PTME_CONFIG"; const char *PTME_CONFIG_STRING = "PTME_CONFIG";
@ -267,7 +267,7 @@ const char *translateObject(object_id_t object) {
case 0x44330001: case 0x44330001:
return PLOC_MEMORY_DUMPER_STRING; return PLOC_MEMORY_DUMPER_STRING;
case 0x44330002: case 0x44330002:
return STR_HELPER_STRING; return STR_COM_IF_STRING;
case 0x44330003: case 0x44330003:
return PLOC_MPSOC_HELPER_STRING; return PLOC_MPSOC_HELPER_STRING;
case 0x44330004: case 0x44330004:

View File

@ -592,7 +592,7 @@ void ObjectFactory::createSolarArrayDeploymentComponents(PowerSwitchIF& pwrSwitc
void ObjectFactory::createSyrlinksComponents(PowerSwitchIF* pwrSwitcher) { void ObjectFactory::createSyrlinksComponents(PowerSwitchIF* pwrSwitcher) {
auto* syrlinksUartCookie = auto* syrlinksUartCookie =
new SerialCookie(objects::SYRLINKS_HANDLER, q7s::UART_SYRLINKS_DEV, uart::SYRLINKS_BAUD, new SerialCookie(objects::SYRLINKS_HANDLER, q7s::UART_SYRLINKS_DEV, serial::SYRLINKS_BAUD,
syrlinks::MAX_REPLY_SIZE, UartModes::NON_CANONICAL); syrlinks::MAX_REPLY_SIZE, UartModes::NON_CANONICAL);
syrlinksUartCookie->setParityEven(); syrlinksUartCookie->setParityEven();
@ -623,8 +623,8 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF, PowerSwit
mpsocGpioCookie->addGpio(gpioIds::ENABLE_MPSOC_UART, gpioConfigMPSoC); mpsocGpioCookie->addGpio(gpioIds::ENABLE_MPSOC_UART, gpioConfigMPSoC);
gpioChecker(gpioComIF->addGpios(mpsocGpioCookie), "PLOC MPSoC"); gpioChecker(gpioComIF->addGpios(mpsocGpioCookie), "PLOC MPSoC");
auto mpsocCookie = auto mpsocCookie =
new SerialCookie(objects::PLOC_MPSOC_HANDLER, q7s::UART_PLOC_MPSOC_DEV, uart::PLOC_MPSOC_BAUD, new SerialCookie(objects::PLOC_MPSOC_HANDLER, q7s::UART_PLOC_MPSOC_DEV,
mpsoc::MAX_REPLY_SIZE, UartModes::NON_CANONICAL); serial::PLOC_MPSOC_BAUD, mpsoc::MAX_REPLY_SIZE, UartModes::NON_CANONICAL);
mpsocCookie->setNoFixedSizeReply(); mpsocCookie->setNoFixedSizeReply();
auto plocMpsocHelper = new PlocMPSoCHelper(objects::PLOC_MPSOC_HELPER); auto plocMpsocHelper = new PlocMPSoCHelper(objects::PLOC_MPSOC_HELPER);
auto* mpsocHandler = new PlocMPSoCHandler( auto* mpsocHandler = new PlocMPSoCHandler(
@ -639,9 +639,9 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF, PowerSwit
auto supvGpioCookie = new GpioCookie; auto supvGpioCookie = new GpioCookie;
supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv); supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv);
gpioComIF->addGpios(supvGpioCookie); gpioComIF->addGpios(supvGpioCookie);
auto supervisorCookie = auto supervisorCookie = new SerialCookie(objects::PLOC_SUPERVISOR_HANDLER,
new SerialCookie(objects::PLOC_SUPERVISOR_HANDLER, q7s::UART_PLOC_SUPERVSIOR_DEV, q7s::UART_PLOC_SUPERVSIOR_DEV, serial::PLOC_SUPV_BAUD,
uart::PLOC_SUPV_BAUD, supv::MAX_PACKET_SIZE * 20, UartModes::NON_CANONICAL); supv::MAX_PACKET_SIZE * 20, UartModes::NON_CANONICAL);
supervisorCookie->setNoFixedSizeReply(); supervisorCookie->setNoFixedSizeReply();
auto supvHelper = new PlocSupvUartManager(objects::PLOC_SUPERVISOR_HELPER); auto supvHelper = new PlocSupvUartManager(objects::PLOC_SUPERVISOR_HELPER);
auto* supvHandler = new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, supervisorCookie, auto* supvHandler = new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, supervisorCookie,
@ -931,10 +931,10 @@ void ObjectFactory::createStrComponents(PowerSwitchIF* pwrSwitcher) {
auto* strAssy = new StrAssembly(objects::STR_ASSY); auto* strAssy = new StrAssembly(objects::STR_ASSY);
strAssy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM); strAssy->connectModeTreeParent(satsystem::acs::ACS_SUBSYSTEM);
auto* starTrackerCookie = auto* starTrackerCookie =
new SerialCookie(objects::STAR_TRACKER, q7s::UART_STAR_TRACKER_DEV, uart::STAR_TRACKER_BAUD, new SerialCookie(objects::STAR_TRACKER, q7s::UART_STAR_TRACKER_DEV, serial::STAR_TRACKER_BAUD,
startracker::MAX_FRAME_SIZE * 2 + 2, UartModes::NON_CANONICAL); startracker::MAX_FRAME_SIZE * 2 + 2, UartModes::NON_CANONICAL);
starTrackerCookie->setNoFixedSizeReply(); starTrackerCookie->setNoFixedSizeReply();
StrComHandler* strHelper = new StrComHandler(objects::STR_HELPER); StrComHandler* strComIF = new StrComHandler(objects::STR_COM_IF);
const char* paramJsonFile = nullptr; const char* paramJsonFile = nullptr;
#ifdef EGSE #ifdef EGSE
@ -951,8 +951,8 @@ void ObjectFactory::createStrComponents(PowerSwitchIF* pwrSwitcher) {
} }
auto strFdir = new StrFdir(objects::STAR_TRACKER); auto strFdir = new StrFdir(objects::STAR_TRACKER);
auto starTracker = auto starTracker =
new StarTrackerHandler(objects::STAR_TRACKER, objects::UART_COM_IF, starTrackerCookie, new StarTrackerHandler(objects::STAR_TRACKER, objects::STR_COM_IF, starTrackerCookie,
paramJsonFile, strHelper, pcdu::PDU1_CH2_STAR_TRACKER_5V); paramJsonFile, strComIF, pcdu::PDU1_CH2_STAR_TRACKER_5V);
starTracker->setPowerSwitcher(pwrSwitcher); starTracker->setPowerSwitcher(pwrSwitcher);
starTracker->connectModeTreeParent(*strAssy); starTracker->connectModeTreeParent(*strAssy);
starTracker->setCustomFdir(strFdir); starTracker->setCustomFdir(strFdir);

View File

@ -307,11 +307,12 @@ void scheduling::initTasks() {
#endif #endif
#if OBSW_ADD_STAR_TRACKER == 1 #if OBSW_ADD_STAR_TRACKER == 1
// Relatively high priority to make sure STR COM works well.
PeriodicTaskIF* strHelperTask = factory->createPeriodicTask( PeriodicTaskIF* strHelperTask = factory->createPeriodicTask(
"STR_HELPER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc); "STR_HELPER", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
result = strHelperTask->addComponent(objects::STR_HELPER); result = strHelperTask->addComponent(objects::STR_COM_IF);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
scheduling::printAddObjectError("STR_HELPER", objects::STR_HELPER); scheduling::printAddObjectError("STR_HELPER", objects::STR_COM_IF);
} }
#endif /* OBSW_ADD_STAR_TRACKER == 1 */ #endif /* OBSW_ADD_STAR_TRACKER == 1 */

View File

@ -63,7 +63,7 @@ static constexpr dur_millis_t ACS_BOARD_CS_TIMEOUT = 50 * CS_FACTOR;
} // namespace spi } // namespace spi
namespace uart { namespace serial {
static constexpr size_t HYPERION_GPS_REPLY_MAX_BUFFER = 1024; static constexpr size_t HYPERION_GPS_REPLY_MAX_BUFFER = 1024;
static constexpr UartBaudRate SYRLINKS_BAUD = UartBaudRate::RATE_38400; static constexpr UartBaudRate SYRLINKS_BAUD = UartBaudRate::RATE_38400;
@ -73,6 +73,6 @@ static constexpr UartBaudRate PLOC_MPSOC_BAUD = UartBaudRate::RATE_115200;
static constexpr UartBaudRate PLOC_SUPV_BAUD = UartBaudRate::RATE_921600; static constexpr UartBaudRate PLOC_SUPV_BAUD = UartBaudRate::RATE_921600;
static constexpr UartBaudRate STAR_TRACKER_BAUD = UartBaudRate::RATE_921600; static constexpr UartBaudRate STAR_TRACKER_BAUD = UartBaudRate::RATE_921600;
} // namespace uart } // namespace serial
#endif /* COMMON_CONFIG_DEVCONF_H_ */ #endif /* COMMON_CONFIG_DEVCONF_H_ */

View File

@ -62,7 +62,7 @@ enum commonObjects : uint32_t {
RAD_SENSOR = 0x443200A5, RAD_SENSOR = 0x443200A5,
PLOC_UPDATER = 0x44330000, PLOC_UPDATER = 0x44330000,
PLOC_MEMORY_DUMPER = 0x44330001, PLOC_MEMORY_DUMPER = 0x44330001,
STR_HELPER = 0x44330002, STR_COM_IF = 0x44330002,
PLOC_MPSOC_HELPER = 0x44330003, PLOC_MPSOC_HELPER = 0x44330003,
AXI_PTME_CONFIG = 0x44330004, AXI_PTME_CONFIG = 0x44330004,
PTME_CONFIG = 0x44330005, PTME_CONFIG = 0x44330005,

2
fsfw

@ -1 +1 @@
Subproject commit 341437df1387aaf0128dd5304b5c0cc8ad734e69 Subproject commit f8a7c1d4ed621a3375db0da9b9e9f8d5484abbc1

View File

@ -155,23 +155,23 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
12409;0x3079;WRITE_SYSCALL_ERROR_PDEC;HIGH;No description;linux/ipcore/PdecHandler.h 12409;0x3079;WRITE_SYSCALL_ERROR_PDEC;HIGH;No description;linux/ipcore/PdecHandler.h
12410;0x307a;PDEC_RESET_FAILED;HIGH;Failed to pull PDEC reset to low;linux/ipcore/PdecHandler.h 12410;0x307a;PDEC_RESET_FAILED;HIGH;Failed to pull PDEC reset to low;linux/ipcore/PdecHandler.h
12411;0x307b;OPEN_IRQ_FILE_FAILED;HIGH;Failed to open the IRQ uio file;linux/ipcore/PdecHandler.h 12411;0x307b;OPEN_IRQ_FILE_FAILED;HIGH;Failed to open the IRQ uio file;linux/ipcore/PdecHandler.h
12500;0x30d4;IMAGE_UPLOAD_FAILED;LOW;Image upload failed;linux/devices/startracker/StrHelper.h 12500;0x30d4;IMAGE_UPLOAD_FAILED;LOW;Image upload failed;linux/devices/startracker/StrComHandler.h
12501;0x30d5;IMAGE_DOWNLOAD_FAILED;LOW;Image download failed;linux/devices/startracker/StrHelper.h 12501;0x30d5;IMAGE_DOWNLOAD_FAILED;LOW;Image download failed;linux/devices/startracker/StrComHandler.h
12502;0x30d6;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;linux/devices/startracker/StrHelper.h 12502;0x30d6;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;linux/devices/startracker/StrComHandler.h
12503;0x30d7;IMAGE_DOWNLOAD_SUCCESSFUL;LOW;Image download was successful;linux/devices/startracker/StrHelper.h 12503;0x30d7;IMAGE_DOWNLOAD_SUCCESSFUL;LOW;Image download was successful;linux/devices/startracker/StrComHandler.h
12504;0x30d8;FLASH_WRITE_SUCCESSFUL;LOW;Finished flash write procedure successfully;linux/devices/startracker/StrHelper.h 12504;0x30d8;FLASH_WRITE_SUCCESSFUL;LOW;Finished flash write procedure successfully;linux/devices/startracker/StrComHandler.h
12505;0x30d9;FLASH_READ_SUCCESSFUL;LOW;Finished flash read procedure successfully;linux/devices/startracker/StrHelper.h 12505;0x30d9;FLASH_READ_SUCCESSFUL;LOW;Finished flash read procedure successfully;linux/devices/startracker/StrComHandler.h
12506;0x30da;FLASH_READ_FAILED;LOW;Flash read procedure failed;linux/devices/startracker/StrHelper.h 12506;0x30da;FLASH_READ_FAILED;LOW;Flash read procedure failed;linux/devices/startracker/StrComHandler.h
12507;0x30db;FIRMWARE_UPDATE_SUCCESSFUL;LOW;Firmware update was successful;linux/devices/startracker/StrHelper.h 12507;0x30db;FIRMWARE_UPDATE_SUCCESSFUL;LOW;Firmware update was successful;linux/devices/startracker/StrComHandler.h
12508;0x30dc;FIRMWARE_UPDATE_FAILED;LOW;Firmware update failed;linux/devices/startracker/StrHelper.h 12508;0x30dc;FIRMWARE_UPDATE_FAILED;LOW;Firmware update failed;linux/devices/startracker/StrComHandler.h
12509;0x30dd;STR_HELPER_READING_REPLY_FAILED;LOW;Failed to read communication interface reply data P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux/devices/startracker/StrHelper.h 12509;0x30dd;STR_HELPER_READING_REPLY_FAILED;LOW;Failed to read communication interface reply data P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux/devices/startracker/StrComHandler.h
12510;0x30de;STR_HELPER_COM_ERROR;LOW;Unexpected stop of decoding sequence P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux/devices/startracker/StrHelper.h 12510;0x30de;STR_HELPER_COM_ERROR;LOW;Unexpected stop of decoding sequence P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux/devices/startracker/StrComHandler.h
12511;0x30df;STR_HELPER_NO_REPLY;LOW;Star tracker did not send replies (maybe device is powered off) P1: Position of upload or download packet for which no reply was sent;linux/devices/startracker/StrHelper.h 12511;0x30df;STR_HELPER_REPLY_TIMEOUT;LOW;Star tracker did not send a valid reply for a certain timeout. P1: Position of upload or download packet for which the packet wa sent. P2: Timeout;linux/devices/startracker/StrComHandler.h
12512;0x30e0;STR_HELPER_DEC_ERROR;LOW;Error during decoding of received reply occurred P1: Return value of decoding function P2: Position of upload/download packet, or address of flash write/read request;linux/devices/startracker/StrHelper.h 12513;0x30e1;STR_HELPER_DEC_ERROR;LOW;Error during decoding of received reply occurred P1: Return value of decoding function P2: Position of upload/download packet, or address of flash write/read request;linux/devices/startracker/StrComHandler.h
12513;0x30e1;POSITION_MISMATCH;LOW;Position mismatch P1: The expected position and thus the position for which the image upload/download failed;linux/devices/startracker/StrHelper.h 12514;0x30e2;POSITION_MISMATCH;LOW;Position mismatch P1: The expected position and thus the position for which the image upload/download failed;linux/devices/startracker/StrComHandler.h
12514;0x30e2;STR_HELPER_FILE_NOT_EXISTS;LOW;Specified file does not exist P1: Internal state of str helper;linux/devices/startracker/StrHelper.h 12515;0x30e3;STR_HELPER_FILE_NOT_EXISTS;LOW;Specified file does not exist P1: Internal state of str helper;linux/devices/startracker/StrComHandler.h
12515;0x30e3;STR_HELPER_SENDING_PACKET_FAILED;LOW;No description;linux/devices/startracker/StrHelper.h 12516;0x30e4;STR_HELPER_SENDING_PACKET_FAILED;LOW;No description;linux/devices/startracker/StrComHandler.h
12516;0x30e4;STR_HELPER_REQUESTING_MSG_FAILED;LOW;No description;linux/devices/startracker/StrHelper.h 12517;0x30e5;STR_HELPER_REQUESTING_MSG_FAILED;LOW;No description;linux/devices/startracker/StrComHandler.h
12600;0x3138;MPSOC_FLASH_WRITE_FAILED;LOW;Flash write fails;linux/devices/ploc/PlocMPSoCHelper.h 12600;0x3138;MPSOC_FLASH_WRITE_FAILED;LOW;Flash write fails;linux/devices/ploc/PlocMPSoCHelper.h
12601;0x3139;MPSOC_FLASH_WRITE_SUCCESSFUL;LOW;Flash write successful;linux/devices/ploc/PlocMPSoCHelper.h 12601;0x3139;MPSOC_FLASH_WRITE_SUCCESSFUL;LOW;Flash write successful;linux/devices/ploc/PlocMPSoCHelper.h
12602;0x313a;MPSOC_SENDING_COMMAND_FAILED;LOW;No description;linux/devices/ploc/PlocMPSoCHelper.h 12602;0x313a;MPSOC_SENDING_COMMAND_FAILED;LOW;No description;linux/devices/ploc/PlocMPSoCHelper.h

1 Event ID (dec) Event ID (hex) Name Severity Description File Path
155 12409 0x3079 WRITE_SYSCALL_ERROR_PDEC HIGH No description linux/ipcore/PdecHandler.h
156 12410 0x307a PDEC_RESET_FAILED HIGH Failed to pull PDEC reset to low linux/ipcore/PdecHandler.h
157 12411 0x307b OPEN_IRQ_FILE_FAILED HIGH Failed to open the IRQ uio file linux/ipcore/PdecHandler.h
158 12500 0x30d4 IMAGE_UPLOAD_FAILED LOW Image upload failed linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
159 12501 0x30d5 IMAGE_DOWNLOAD_FAILED LOW Image download failed linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
160 12502 0x30d6 IMAGE_UPLOAD_SUCCESSFUL LOW Uploading image to star tracker was successfulop linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
161 12503 0x30d7 IMAGE_DOWNLOAD_SUCCESSFUL LOW Image download was successful linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
162 12504 0x30d8 FLASH_WRITE_SUCCESSFUL LOW Finished flash write procedure successfully linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
163 12505 0x30d9 FLASH_READ_SUCCESSFUL LOW Finished flash read procedure successfully linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
164 12506 0x30da FLASH_READ_FAILED LOW Flash read procedure failed linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
165 12507 0x30db FIRMWARE_UPDATE_SUCCESSFUL LOW Firmware update was successful linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
166 12508 0x30dc FIRMWARE_UPDATE_FAILED LOW Firmware update failed linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
167 12509 0x30dd STR_HELPER_READING_REPLY_FAILED LOW Failed to read communication interface reply data P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
168 12510 0x30de STR_HELPER_COM_ERROR LOW Unexpected stop of decoding sequence P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
169 12511 0x30df STR_HELPER_NO_REPLY STR_HELPER_REPLY_TIMEOUT LOW Star tracker did not send replies (maybe device is powered off) P1: Position of upload or download packet for which no reply was sent Star tracker did not send a valid reply for a certain timeout. P1: Position of upload or download packet for which the packet wa sent. P2: Timeout linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
170 12512 12513 0x30e0 0x30e1 STR_HELPER_DEC_ERROR LOW Error during decoding of received reply occurred P1: Return value of decoding function P2: Position of upload/download packet, or address of flash write/read request linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
171 12513 12514 0x30e1 0x30e2 POSITION_MISMATCH LOW Position mismatch P1: The expected position and thus the position for which the image upload/download failed linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
172 12514 12515 0x30e2 0x30e3 STR_HELPER_FILE_NOT_EXISTS LOW Specified file does not exist P1: Internal state of str helper linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
173 12515 12516 0x30e3 0x30e4 STR_HELPER_SENDING_PACKET_FAILED LOW No description linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
174 12516 12517 0x30e4 0x30e5 STR_HELPER_REQUESTING_MSG_FAILED LOW No description linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
175 12600 0x3138 MPSOC_FLASH_WRITE_FAILED LOW Flash write fails linux/devices/ploc/PlocMPSoCHelper.h
176 12601 0x3139 MPSOC_FLASH_WRITE_SUCCESSFUL LOW Flash write successful linux/devices/ploc/PlocMPSoCHelper.h
177 12602 0x313a MPSOC_SENDING_COMMAND_FAILED LOW No description linux/devices/ploc/PlocMPSoCHelper.h

View File

@ -42,7 +42,7 @@
0x443200A5;RAD_SENSOR 0x443200A5;RAD_SENSOR
0x44330000;PLOC_UPDATER 0x44330000;PLOC_UPDATER
0x44330001;PLOC_MEMORY_DUMPER 0x44330001;PLOC_MEMORY_DUMPER
0x44330002;STR_HELPER 0x44330002;STR_COM_IF
0x44330003;PLOC_MPSOC_HELPER 0x44330003;PLOC_MPSOC_HELPER
0x44330004;AXI_PTME_CONFIG 0x44330004;AXI_PTME_CONFIG
0x44330005;PTME_CONFIG 0x44330005;PTME_CONFIG

1 0x42694269 TEST_TASK
42 0x443200A5 RAD_SENSOR
43 0x44330000 PLOC_UPDATER
44 0x44330001 PLOC_MEMORY_DUMPER
45 0x44330002 STR_HELPER STR_COM_IF
46 0x44330003 PLOC_MPSOC_HELPER
47 0x44330004 AXI_PTME_CONFIG
48 0x44330005 PTME_CONFIG

View File

@ -155,23 +155,23 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
12409;0x3079;WRITE_SYSCALL_ERROR_PDEC;HIGH;No description;linux/ipcore/PdecHandler.h 12409;0x3079;WRITE_SYSCALL_ERROR_PDEC;HIGH;No description;linux/ipcore/PdecHandler.h
12410;0x307a;PDEC_RESET_FAILED;HIGH;Failed to pull PDEC reset to low;linux/ipcore/PdecHandler.h 12410;0x307a;PDEC_RESET_FAILED;HIGH;Failed to pull PDEC reset to low;linux/ipcore/PdecHandler.h
12411;0x307b;OPEN_IRQ_FILE_FAILED;HIGH;Failed to open the IRQ uio file;linux/ipcore/PdecHandler.h 12411;0x307b;OPEN_IRQ_FILE_FAILED;HIGH;Failed to open the IRQ uio file;linux/ipcore/PdecHandler.h
12500;0x30d4;IMAGE_UPLOAD_FAILED;LOW;Image upload failed;linux/devices/startracker/StrHelper.h 12500;0x30d4;IMAGE_UPLOAD_FAILED;LOW;Image upload failed;linux/devices/startracker/StrComHandler.h
12501;0x30d5;IMAGE_DOWNLOAD_FAILED;LOW;Image download failed;linux/devices/startracker/StrHelper.h 12501;0x30d5;IMAGE_DOWNLOAD_FAILED;LOW;Image download failed;linux/devices/startracker/StrComHandler.h
12502;0x30d6;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;linux/devices/startracker/StrHelper.h 12502;0x30d6;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;linux/devices/startracker/StrComHandler.h
12503;0x30d7;IMAGE_DOWNLOAD_SUCCESSFUL;LOW;Image download was successful;linux/devices/startracker/StrHelper.h 12503;0x30d7;IMAGE_DOWNLOAD_SUCCESSFUL;LOW;Image download was successful;linux/devices/startracker/StrComHandler.h
12504;0x30d8;FLASH_WRITE_SUCCESSFUL;LOW;Finished flash write procedure successfully;linux/devices/startracker/StrHelper.h 12504;0x30d8;FLASH_WRITE_SUCCESSFUL;LOW;Finished flash write procedure successfully;linux/devices/startracker/StrComHandler.h
12505;0x30d9;FLASH_READ_SUCCESSFUL;LOW;Finished flash read procedure successfully;linux/devices/startracker/StrHelper.h 12505;0x30d9;FLASH_READ_SUCCESSFUL;LOW;Finished flash read procedure successfully;linux/devices/startracker/StrComHandler.h
12506;0x30da;FLASH_READ_FAILED;LOW;Flash read procedure failed;linux/devices/startracker/StrHelper.h 12506;0x30da;FLASH_READ_FAILED;LOW;Flash read procedure failed;linux/devices/startracker/StrComHandler.h
12507;0x30db;FIRMWARE_UPDATE_SUCCESSFUL;LOW;Firmware update was successful;linux/devices/startracker/StrHelper.h 12507;0x30db;FIRMWARE_UPDATE_SUCCESSFUL;LOW;Firmware update was successful;linux/devices/startracker/StrComHandler.h
12508;0x30dc;FIRMWARE_UPDATE_FAILED;LOW;Firmware update failed;linux/devices/startracker/StrHelper.h 12508;0x30dc;FIRMWARE_UPDATE_FAILED;LOW;Firmware update failed;linux/devices/startracker/StrComHandler.h
12509;0x30dd;STR_HELPER_READING_REPLY_FAILED;LOW;Failed to read communication interface reply data P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux/devices/startracker/StrHelper.h 12509;0x30dd;STR_HELPER_READING_REPLY_FAILED;LOW;Failed to read communication interface reply data P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux/devices/startracker/StrComHandler.h
12510;0x30de;STR_HELPER_COM_ERROR;LOW;Unexpected stop of decoding sequence P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux/devices/startracker/StrHelper.h 12510;0x30de;STR_HELPER_COM_ERROR;LOW;Unexpected stop of decoding sequence P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;linux/devices/startracker/StrComHandler.h
12511;0x30df;STR_HELPER_NO_REPLY;LOW;Star tracker did not send replies (maybe device is powered off) P1: Position of upload or download packet for which no reply was sent;linux/devices/startracker/StrHelper.h 12511;0x30df;STR_HELPER_REPLY_TIMEOUT;LOW;Star tracker did not send a valid reply for a certain timeout. P1: Position of upload or download packet for which the packet wa sent. P2: Timeout;linux/devices/startracker/StrComHandler.h
12512;0x30e0;STR_HELPER_DEC_ERROR;LOW;Error during decoding of received reply occurred P1: Return value of decoding function P2: Position of upload/download packet, or address of flash write/read request;linux/devices/startracker/StrHelper.h 12513;0x30e1;STR_HELPER_DEC_ERROR;LOW;Error during decoding of received reply occurred P1: Return value of decoding function P2: Position of upload/download packet, or address of flash write/read request;linux/devices/startracker/StrComHandler.h
12513;0x30e1;POSITION_MISMATCH;LOW;Position mismatch P1: The expected position and thus the position for which the image upload/download failed;linux/devices/startracker/StrHelper.h 12514;0x30e2;POSITION_MISMATCH;LOW;Position mismatch P1: The expected position and thus the position for which the image upload/download failed;linux/devices/startracker/StrComHandler.h
12514;0x30e2;STR_HELPER_FILE_NOT_EXISTS;LOW;Specified file does not exist P1: Internal state of str helper;linux/devices/startracker/StrHelper.h 12515;0x30e3;STR_HELPER_FILE_NOT_EXISTS;LOW;Specified file does not exist P1: Internal state of str helper;linux/devices/startracker/StrComHandler.h
12515;0x30e3;STR_HELPER_SENDING_PACKET_FAILED;LOW;No description;linux/devices/startracker/StrHelper.h 12516;0x30e4;STR_HELPER_SENDING_PACKET_FAILED;LOW;No description;linux/devices/startracker/StrComHandler.h
12516;0x30e4;STR_HELPER_REQUESTING_MSG_FAILED;LOW;No description;linux/devices/startracker/StrHelper.h 12517;0x30e5;STR_HELPER_REQUESTING_MSG_FAILED;LOW;No description;linux/devices/startracker/StrComHandler.h
12600;0x3138;MPSOC_FLASH_WRITE_FAILED;LOW;Flash write fails;linux/devices/ploc/PlocMPSoCHelper.h 12600;0x3138;MPSOC_FLASH_WRITE_FAILED;LOW;Flash write fails;linux/devices/ploc/PlocMPSoCHelper.h
12601;0x3139;MPSOC_FLASH_WRITE_SUCCESSFUL;LOW;Flash write successful;linux/devices/ploc/PlocMPSoCHelper.h 12601;0x3139;MPSOC_FLASH_WRITE_SUCCESSFUL;LOW;Flash write successful;linux/devices/ploc/PlocMPSoCHelper.h
12602;0x313a;MPSOC_SENDING_COMMAND_FAILED;LOW;No description;linux/devices/ploc/PlocMPSoCHelper.h 12602;0x313a;MPSOC_SENDING_COMMAND_FAILED;LOW;No description;linux/devices/ploc/PlocMPSoCHelper.h

1 Event ID (dec) Event ID (hex) Name Severity Description File Path
155 12409 0x3079 WRITE_SYSCALL_ERROR_PDEC HIGH No description linux/ipcore/PdecHandler.h
156 12410 0x307a PDEC_RESET_FAILED HIGH Failed to pull PDEC reset to low linux/ipcore/PdecHandler.h
157 12411 0x307b OPEN_IRQ_FILE_FAILED HIGH Failed to open the IRQ uio file linux/ipcore/PdecHandler.h
158 12500 0x30d4 IMAGE_UPLOAD_FAILED LOW Image upload failed linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
159 12501 0x30d5 IMAGE_DOWNLOAD_FAILED LOW Image download failed linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
160 12502 0x30d6 IMAGE_UPLOAD_SUCCESSFUL LOW Uploading image to star tracker was successfulop linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
161 12503 0x30d7 IMAGE_DOWNLOAD_SUCCESSFUL LOW Image download was successful linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
162 12504 0x30d8 FLASH_WRITE_SUCCESSFUL LOW Finished flash write procedure successfully linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
163 12505 0x30d9 FLASH_READ_SUCCESSFUL LOW Finished flash read procedure successfully linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
164 12506 0x30da FLASH_READ_FAILED LOW Flash read procedure failed linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
165 12507 0x30db FIRMWARE_UPDATE_SUCCESSFUL LOW Firmware update was successful linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
166 12508 0x30dc FIRMWARE_UPDATE_FAILED LOW Firmware update failed linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
167 12509 0x30dd STR_HELPER_READING_REPLY_FAILED LOW Failed to read communication interface reply data P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
168 12510 0x30de STR_HELPER_COM_ERROR LOW Unexpected stop of decoding sequence P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
169 12511 0x30df STR_HELPER_NO_REPLY STR_HELPER_REPLY_TIMEOUT LOW Star tracker did not send replies (maybe device is powered off) P1: Position of upload or download packet for which no reply was sent Star tracker did not send a valid reply for a certain timeout. P1: Position of upload or download packet for which the packet wa sent. P2: Timeout linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
170 12512 12513 0x30e0 0x30e1 STR_HELPER_DEC_ERROR LOW Error during decoding of received reply occurred P1: Return value of decoding function P2: Position of upload/download packet, or address of flash write/read request linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
171 12513 12514 0x30e1 0x30e2 POSITION_MISMATCH LOW Position mismatch P1: The expected position and thus the position for which the image upload/download failed linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
172 12514 12515 0x30e2 0x30e3 STR_HELPER_FILE_NOT_EXISTS LOW Specified file does not exist P1: Internal state of str helper linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
173 12515 12516 0x30e3 0x30e4 STR_HELPER_SENDING_PACKET_FAILED LOW No description linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
174 12516 12517 0x30e4 0x30e5 STR_HELPER_REQUESTING_MSG_FAILED LOW No description linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
175 12600 0x3138 MPSOC_FLASH_WRITE_FAILED LOW Flash write fails linux/devices/ploc/PlocMPSoCHelper.h
176 12601 0x3139 MPSOC_FLASH_WRITE_SUCCESSFUL LOW Flash write successful linux/devices/ploc/PlocMPSoCHelper.h
177 12602 0x313a MPSOC_SENDING_COMMAND_FAILED LOW No description linux/devices/ploc/PlocMPSoCHelper.h

View File

@ -41,7 +41,7 @@
0x443200A5;RAD_SENSOR 0x443200A5;RAD_SENSOR
0x44330000;PLOC_UPDATER 0x44330000;PLOC_UPDATER
0x44330001;PLOC_MEMORY_DUMPER 0x44330001;PLOC_MEMORY_DUMPER
0x44330002;STR_HELPER 0x44330002;STR_COM_IF
0x44330003;PLOC_MPSOC_HELPER 0x44330003;PLOC_MPSOC_HELPER
0x44330004;AXI_PTME_CONFIG 0x44330004;AXI_PTME_CONFIG
0x44330005;PTME_CONFIG 0x44330005;PTME_CONFIG

1 0x00005060 P60DOCK_TEST_TASK
41 0x443200A5 RAD_SENSOR
42 0x44330000 PLOC_UPDATER
43 0x44330001 PLOC_MEMORY_DUMPER
44 0x44330002 STR_HELPER STR_COM_IF
45 0x44330003 PLOC_MPSOC_HELPER
46 0x44330004 AXI_PTME_CONFIG
47 0x44330005 PTME_CONFIG

View File

@ -491,15 +491,18 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path
0x58a1;SUSS_ErrorLockMutex;No description;161;SUS_HANDLER;mission/devices/LegacySusHandler.h 0x58a1;SUSS_ErrorLockMutex;No description;161;SUS_HANDLER;mission/devices/LegacySusHandler.h
0x59a0;IPCI_PapbBusy;No description;160;CCSDS_IP_CORE_BRIDGE;linux/ipcore/PapbVcInterface.h 0x59a0;IPCI_PapbBusy;No description;160;CCSDS_IP_CORE_BRIDGE;linux/ipcore/PapbVcInterface.h
0x5aa0;PTME_UnknownVcId;No description;160;PTME;linux/ipcore/Ptme.h 0x5aa0;PTME_UnknownVcId;No description;160;PTME;linux/ipcore/Ptme.h
0x5ca0;STRHLP_SdNotMounted;SD card specified in path string not mounted;160;STR_HELPER;linux/devices/startracker/StrHelper.h 0x5c00;STRHLP_Busy;No description;0;STR_HELPER;linux/devices/startracker/StrComHandler.h
0x5ca1;STRHLP_FileNotExists;Specified file does not exist on filesystem;161;STR_HELPER;linux/devices/startracker/StrHelper.h 0x5c01;STRHLP_SdNotMounted;SD card specified in path string not mounted;1;STR_HELPER;linux/devices/startracker/StrComHandler.h
0x5ca2;STRHLP_PathNotExists;Specified path does not exist;162;STR_HELPER;linux/devices/startracker/StrHelper.h 0x5c02;STRHLP_FileNotExists;Specified file does not exist on filesystem;2;STR_HELPER;linux/devices/startracker/StrComHandler.h
0x5ca3;STRHLP_FileCreationFailed;Failed to create download image or read flash file;163;STR_HELPER;linux/devices/startracker/StrHelper.h 0x5c03;STRHLP_PathNotExists;Specified path does not exist;3;STR_HELPER;linux/devices/startracker/StrComHandler.h
0x5ca4;STRHLP_RegionMismatch;Region in flash write/read reply does not match expected region;164;STR_HELPER;linux/devices/startracker/StrHelper.h 0x5c04;STRHLP_FileCreationFailed;Failed to create download image or read flash file;4;STR_HELPER;linux/devices/startracker/StrComHandler.h
0x5ca5;STRHLP_AddressMismatch;Address in flash write/read reply does not match expected address;165;STR_HELPER;linux/devices/startracker/StrHelper.h 0x5c05;STRHLP_RegionMismatch;Region in flash write/read reply does not match expected region;5;STR_HELPER;linux/devices/startracker/StrComHandler.h
0x5ca6;STRHLP_LengthMismatch;Length in flash write/read reply does not match expected length;166;STR_HELPER;linux/devices/startracker/StrHelper.h 0x5c06;STRHLP_AddressMismatch;Address in flash write/read reply does not match expected address;6;STR_HELPER;linux/devices/startracker/StrComHandler.h
0x5ca7;STRHLP_StatusError;Status field in reply signals error;167;STR_HELPER;linux/devices/startracker/StrHelper.h 0x5c07;STRHLP_LengthMismatch;Length in flash write/read reply does not match expected length;7;STR_HELPER;linux/devices/startracker/StrComHandler.h
0x5ca8;STRHLP_InvalidTypeId;Reply has invalid type ID (should be of action reply type);168;STR_HELPER;linux/devices/startracker/StrHelper.h 0x5c08;STRHLP_StatusError;Status field in reply signals error;8;STR_HELPER;linux/devices/startracker/StrComHandler.h
0x5c09;STRHLP_InvalidTypeId;Reply has invalid type ID (should be of action reply type);9;STR_HELPER;linux/devices/startracker/StrComHandler.h
0x5c0a;STRHLP_ReceptionTimeout;No description;10;STR_HELPER;linux/devices/startracker/StrComHandler.h
0x5c0b;STRHLP_DecodingError;No description;11;STR_HELPER;linux/devices/startracker/StrComHandler.h
0x5d00;GOMS_PacketTooLong;No description;0;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h 0x5d00;GOMS_PacketTooLong;No description;0;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h
0x5d01;GOMS_InvalidTableId;No description;1;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h 0x5d01;GOMS_InvalidTableId;No description;1;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h
0x5d02;GOMS_InvalidAddress;No description;2;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h 0x5d02;GOMS_InvalidAddress;No description;2;GOM_SPACE_HANDLER;mission/devices/GomspaceDeviceHandler.h

1 Full ID (hex) Name Description Unique ID Subsytem Name File Path
491 0x58a1 SUSS_ErrorLockMutex No description 161 SUS_HANDLER mission/devices/LegacySusHandler.h
492 0x59a0 IPCI_PapbBusy No description 160 CCSDS_IP_CORE_BRIDGE linux/ipcore/PapbVcInterface.h
493 0x5aa0 PTME_UnknownVcId No description 160 PTME linux/ipcore/Ptme.h
494 0x5ca0 0x5c00 STRHLP_SdNotMounted STRHLP_Busy SD card specified in path string not mounted No description 160 0 STR_HELPER linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
495 0x5ca1 0x5c01 STRHLP_FileNotExists STRHLP_SdNotMounted Specified file does not exist on filesystem SD card specified in path string not mounted 161 1 STR_HELPER linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
496 0x5ca2 0x5c02 STRHLP_PathNotExists STRHLP_FileNotExists Specified path does not exist Specified file does not exist on filesystem 162 2 STR_HELPER linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
497 0x5ca3 0x5c03 STRHLP_FileCreationFailed STRHLP_PathNotExists Failed to create download image or read flash file Specified path does not exist 163 3 STR_HELPER linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
498 0x5ca4 0x5c04 STRHLP_RegionMismatch STRHLP_FileCreationFailed Region in flash write/read reply does not match expected region Failed to create download image or read flash file 164 4 STR_HELPER linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
499 0x5ca5 0x5c05 STRHLP_AddressMismatch STRHLP_RegionMismatch Address in flash write/read reply does not match expected address Region in flash write/read reply does not match expected region 165 5 STR_HELPER linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
500 0x5ca6 0x5c06 STRHLP_LengthMismatch STRHLP_AddressMismatch Length in flash write/read reply does not match expected length Address in flash write/read reply does not match expected address 166 6 STR_HELPER linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
501 0x5ca7 0x5c07 STRHLP_StatusError STRHLP_LengthMismatch Status field in reply signals error Length in flash write/read reply does not match expected length 167 7 STR_HELPER linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
502 0x5ca8 0x5c08 STRHLP_InvalidTypeId STRHLP_StatusError Reply has invalid type ID (should be of action reply type) Status field in reply signals error 168 8 STR_HELPER linux/devices/startracker/StrHelper.h linux/devices/startracker/StrComHandler.h
503 0x5c09 STRHLP_InvalidTypeId Reply has invalid type ID (should be of action reply type) 9 STR_HELPER linux/devices/startracker/StrComHandler.h
504 0x5c0a STRHLP_ReceptionTimeout No description 10 STR_HELPER linux/devices/startracker/StrComHandler.h
505 0x5c0b STRHLP_DecodingError No description 11 STR_HELPER linux/devices/startracker/StrComHandler.h
506 0x5d00 GOMS_PacketTooLong No description 0 GOM_SPACE_HANDLER mission/devices/GomspaceDeviceHandler.h
507 0x5d01 GOMS_InvalidTableId No description 1 GOM_SPACE_HANDLER mission/devices/GomspaceDeviceHandler.h
508 0x5d02 GOMS_InvalidAddress No description 2 GOM_SPACE_HANDLER mission/devices/GomspaceDeviceHandler.h

View File

@ -1,7 +1,7 @@
/** /**
* @brief Auto-generated event translation file. Contains 279 translations. * @brief Auto-generated event translation file. Contains 279 translations.
* @details * @details
* Generated on: 2023-03-21 23:59:36 * Generated on: 2023-03-22 01:14:08
*/ */
#include "translateEvents.h" #include "translateEvents.h"
@ -172,7 +172,7 @@ const char *FIRMWARE_UPDATE_SUCCESSFUL_STRING = "FIRMWARE_UPDATE_SUCCESSFUL";
const char *FIRMWARE_UPDATE_FAILED_STRING = "FIRMWARE_UPDATE_FAILED"; const char *FIRMWARE_UPDATE_FAILED_STRING = "FIRMWARE_UPDATE_FAILED";
const char *STR_HELPER_READING_REPLY_FAILED_STRING = "STR_HELPER_READING_REPLY_FAILED"; const char *STR_HELPER_READING_REPLY_FAILED_STRING = "STR_HELPER_READING_REPLY_FAILED";
const char *STR_HELPER_COM_ERROR_STRING = "STR_HELPER_COM_ERROR"; const char *STR_HELPER_COM_ERROR_STRING = "STR_HELPER_COM_ERROR";
const char *STR_HELPER_NO_REPLY_STRING = "STR_HELPER_NO_REPLY"; const char *STR_HELPER_REPLY_TIMEOUT_STRING = "STR_HELPER_REPLY_TIMEOUT";
const char *STR_HELPER_DEC_ERROR_STRING = "STR_HELPER_DEC_ERROR"; const char *STR_HELPER_DEC_ERROR_STRING = "STR_HELPER_DEC_ERROR";
const char *POSITION_MISMATCH_STRING = "POSITION_MISMATCH"; const char *POSITION_MISMATCH_STRING = "POSITION_MISMATCH";
const char *STR_HELPER_FILE_NOT_EXISTS_STRING = "STR_HELPER_FILE_NOT_EXISTS"; const char *STR_HELPER_FILE_NOT_EXISTS_STRING = "STR_HELPER_FILE_NOT_EXISTS";
@ -617,16 +617,16 @@ const char *translateEvents(Event event) {
case (12510): case (12510):
return STR_HELPER_COM_ERROR_STRING; return STR_HELPER_COM_ERROR_STRING;
case (12511): case (12511):
return STR_HELPER_NO_REPLY_STRING; return STR_HELPER_REPLY_TIMEOUT_STRING;
case (12512):
return STR_HELPER_DEC_ERROR_STRING;
case (12513): case (12513):
return POSITION_MISMATCH_STRING; return STR_HELPER_DEC_ERROR_STRING;
case (12514): case (12514):
return STR_HELPER_FILE_NOT_EXISTS_STRING; return POSITION_MISMATCH_STRING;
case (12515): case (12515):
return STR_HELPER_SENDING_PACKET_FAILED_STRING; return STR_HELPER_FILE_NOT_EXISTS_STRING;
case (12516): case (12516):
return STR_HELPER_SENDING_PACKET_FAILED_STRING;
case (12517):
return STR_HELPER_REQUESTING_MSG_FAILED_STRING; return STR_HELPER_REQUESTING_MSG_FAILED_STRING;
case (12600): case (12600):
return MPSOC_FLASH_WRITE_FAILED_STRING; return MPSOC_FLASH_WRITE_FAILED_STRING;

View File

@ -2,7 +2,7 @@
* @brief Auto-generated object translation file. * @brief Auto-generated object translation file.
* @details * @details
* Contains 173 translations. * Contains 173 translations.
* Generated on: 2023-03-21 23:59:36 * Generated on: 2023-03-22 01:14:08
*/ */
#include "translateObjects.h" #include "translateObjects.h"
@ -49,7 +49,7 @@ const char *PLPCDU_HANDLER_STRING = "PLPCDU_HANDLER";
const char *RAD_SENSOR_STRING = "RAD_SENSOR"; const char *RAD_SENSOR_STRING = "RAD_SENSOR";
const char *PLOC_UPDATER_STRING = "PLOC_UPDATER"; const char *PLOC_UPDATER_STRING = "PLOC_UPDATER";
const char *PLOC_MEMORY_DUMPER_STRING = "PLOC_MEMORY_DUMPER"; const char *PLOC_MEMORY_DUMPER_STRING = "PLOC_MEMORY_DUMPER";
const char *STR_HELPER_STRING = "STR_HELPER"; const char *STR_COM_IF_STRING = "STR_COM_IF";
const char *PLOC_MPSOC_HELPER_STRING = "PLOC_MPSOC_HELPER"; const char *PLOC_MPSOC_HELPER_STRING = "PLOC_MPSOC_HELPER";
const char *AXI_PTME_CONFIG_STRING = "AXI_PTME_CONFIG"; const char *AXI_PTME_CONFIG_STRING = "AXI_PTME_CONFIG";
const char *PTME_CONFIG_STRING = "PTME_CONFIG"; const char *PTME_CONFIG_STRING = "PTME_CONFIG";
@ -269,7 +269,7 @@ const char *translateObject(object_id_t object) {
case 0x44330001: case 0x44330001:
return PLOC_MEMORY_DUMPER_STRING; return PLOC_MEMORY_DUMPER_STRING;
case 0x44330002: case 0x44330002:
return STR_HELPER_STRING; return STR_COM_IF_STRING;
case 0x44330003: case 0x44330003:
return PLOC_MPSOC_HELPER_STRING; return PLOC_MPSOC_HELPER_STRING;
case 0x44330004: case 0x44330004:

View File

@ -314,7 +314,7 @@ void ObjectFactory::createRtdComponents(std::string spiDev, GpioIF* gpioComIF,
void ObjectFactory::createScexComponents(std::string uartDev, PowerSwitchIF* pwrSwitcher, void ObjectFactory::createScexComponents(std::string uartDev, PowerSwitchIF* pwrSwitcher,
SdCardMountedIF& mountedIF, bool onImmediately, SdCardMountedIF& mountedIF, bool onImmediately,
std::optional<power::Switch_t> switchId) { std::optional<power::Switch_t> switchId) {
auto* cookie = new SerialCookie(objects::SCEX, uartDev, uart::SCEX_BAUD, 4096); auto* cookie = new SerialCookie(objects::SCEX, uartDev, serial::SCEX_BAUD, 4096);
cookie->setTwoStopBits(); cookie->setTwoStopBits();
// cookie->setParityEven(); // cookie->setParityEven();
auto scexUartReader = new ScexUartReader(objects::SCEX_UART_READER); auto scexUartReader = new ScexUartReader(objects::SCEX_UART_READER);

View File

@ -98,11 +98,11 @@ ReturnValue_t ScexUartReader::initializeInterface(CookieIF *cookie) {
} }
// Setting up UART parameters // Setting up UART parameters
tty.c_cflag &= ~PARENB; // Clear parity bit tty.c_cflag &= ~PARENB; // Clear parity bit
uart::setStopbits(tty, uartCookie->getStopBits()); serial::setStopbits(tty, uartCookie->getStopBits());
uart::setBitsPerWord(tty, BitsPerWord::BITS_8); serial::setBitsPerWord(tty, BitsPerWord::BITS_8);
tty.c_cflag &= ~CRTSCTS; // Disable RTS/CTS hardware flow control tty.c_cflag &= ~CRTSCTS; // Disable RTS/CTS hardware flow control
uart::enableRead(tty); serial::enableRead(tty);
uart::ignoreCtrlLines(tty); serial::ignoreCtrlLines(tty);
// Use non-canonical mode and clear echo flag // Use non-canonical mode and clear echo flag
tty.c_lflag &= ~(ICANON | ECHO); tty.c_lflag &= ~(ICANON | ECHO);
@ -111,7 +111,7 @@ ReturnValue_t ScexUartReader::initializeInterface(CookieIF *cookie) {
tty.c_cc[VTIME] = 0; tty.c_cc[VTIME] = 0;
tty.c_cc[VMIN] = 0; tty.c_cc[VMIN] = 0;
uart::setBaudrate(tty, uartCookie->getBaudrate()); serial::setBaudrate(tty, uartCookie->getBaudrate());
if (tcsetattr(serialPort, TCSANOW, &tty) != 0) { if (tcsetattr(serialPort, TCSANOW, &tty) != 0) {
sif::warning << "ScexUartReader::initializeInterface: tcsetattr call failed with error [" sif::warning << "ScexUartReader::initializeInterface: tcsetattr call failed with error ["
<< errno << ", " << strerror(errno) << std::endl; << errno << ", " << strerror(errno) << std::endl;

View File

@ -58,12 +58,12 @@ ReturnValue_t PlocSupvUartManager::initializeInterface(CookieIF* cookie) {
} }
// Setting up UART parameters // Setting up UART parameters
tty.c_cflag &= ~PARENB; // Clear parity bit tty.c_cflag &= ~PARENB; // Clear parity bit
uart::setParity(tty, uartCookie->getParity()); serial::setParity(tty, uartCookie->getParity());
uart::setStopbits(tty, uartCookie->getStopBits()); serial::setStopbits(tty, uartCookie->getStopBits());
uart::setBitsPerWord(tty, BitsPerWord::BITS_8); serial::setBitsPerWord(tty, BitsPerWord::BITS_8);
tty.c_cflag &= ~CRTSCTS; // Disable RTS/CTS hardware flow control tty.c_cflag &= ~CRTSCTS; // Disable RTS/CTS hardware flow control
uart::enableRead(tty); serial::enableRead(tty);
uart::ignoreCtrlLines(tty); serial::ignoreCtrlLines(tty);
// Use non-canonical mode and clear echo flag // Use non-canonical mode and clear echo flag
tty.c_lflag &= ~(ICANON | ECHO); tty.c_lflag &= ~(ICANON | ECHO);
@ -72,7 +72,7 @@ ReturnValue_t PlocSupvUartManager::initializeInterface(CookieIF* cookie) {
tty.c_cc[VTIME] = 2; tty.c_cc[VTIME] = 2;
tty.c_cc[VMIN] = 0; tty.c_cc[VMIN] = 0;
uart::setBaudrate(tty, uartCookie->getBaudrate()); serial::setBaudrate(tty, uartCookie->getBaudrate());
if (tcsetattr(serialPort, TCSANOW, &tty) != 0) { if (tcsetattr(serialPort, TCSANOW, &tty) != 0) {
sif::warning << "PlocSupvUartManager::initializeInterface: tcsetattr call failed with error [" sif::warning << "PlocSupvUartManager::initializeInterface: tcsetattr call failed with error ["
<< errno << ", " << strerror(errno) << std::endl; << errno << ", " << strerror(errno) << std::endl;

View File

@ -246,9 +246,9 @@ class PlocSupvUartManager : public DeviceCommunicationIF,
std::array<uint8_t, 2048> recBuf = {}; std::array<uint8_t, 2048> recBuf = {};
std::array<uint8_t, 2048> encodedBuf = {}; std::array<uint8_t, 2048> encodedBuf = {};
std::array<uint8_t, 1200> decodedBuf = {}; std::array<uint8_t, 1200> decodedBuf = {};
std::array<uint8_t, 1200> ipcBuffer = {};
SimpleRingBuffer decodedRingBuf; SimpleRingBuffer decodedRingBuf;
FIFO<size_t, MAX_STORED_DECODED_PACKETS> decodedQueue; FIFO<size_t, MAX_STORED_DECODED_PACKETS> decodedQueue;
std::array<uint8_t, 1200> ipcBuffer = {};
SimpleRingBuffer ipcRingBuf; SimpleRingBuffer ipcRingBuf;
FIFO<size_t, MAX_STORED_DECODED_PACKETS> ipcQueue; FIFO<size_t, MAX_STORED_DECODED_PACKETS> ipcQueue;

View File

@ -1,17 +1,10 @@
#include "ArcsecJsonParamBase.h" #include "ArcsecJsonParamBase.h"
#include "ArcsecJsonKeys.h" #include "arcsecJsonKeys.h"
ArcsecJsonParamBase::ArcsecJsonParamBase(std::string setName) : setName(setName) {} ArcsecJsonParamBase::ArcsecJsonParamBase(std::string setName) : setName(setName) {}
ReturnValue_t ArcsecJsonParamBase::create(std::string fullname, uint8_t* buffer) { ReturnValue_t ArcsecJsonParamBase::create(uint8_t* buffer) {
// ReturnValue_t result = returnvalue::OK;
// result = init(fullname);
// if (result != returnvalue::OK) {
// sif::warning << "ArcsecJsonParamBase::create: Failed to init parameter command for set "
// << setName << std::endl;
// return result;
// }
ReturnValue_t result = createCommand(buffer); ReturnValue_t result = createCommand(buffer);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
sif::warning << "ArcsecJsonParamBase::create: Failed to create parameter command for set " sif::warning << "ArcsecJsonParamBase::create: Failed to create parameter command for set "

View File

@ -56,7 +56,7 @@ class ArcsecJsonParamBase {
* parameter set. * parameter set.
* @param buffer Pointer to the buffer the command will be written to * @param buffer Pointer to the buffer the command will be written to
*/ */
ReturnValue_t create(std::string fullname, uint8_t* buffer); ReturnValue_t create(uint8_t* buffer);
/** /**
* @brief Returns the size of the parameter command. * @brief Returns the size of the parameter command.

View File

@ -1,5 +1,4 @@
target_sources( target_sources(
${OBSW_NAME} ${OBSW_NAME}
PRIVATE StarTrackerHandler.cpp StarTrackerJsonCommands.cpp PRIVATE StarTrackerHandler.cpp strJsonCommands.cpp ArcsecDatalinkLayer.cpp
ArcsecDatalinkLayer.cpp ArcsecJsonParamBase.cpp StrComHandler.cpp ArcsecJsonParamBase.cpp StrComHandler.cpp helpers.cpp)
helpers.cpp)

View File

@ -11,9 +11,9 @@
#include <thread> #include <thread>
#include "OBSWConfig.h" #include "OBSWConfig.h"
#include "StarTrackerJsonCommands.h"
#include "arcsec/common/misc.h" #include "arcsec/common/misc.h"
#include "helpers.h" #include "helpers.h"
#include "strJsonCommands.h"
std::atomic_bool JCFG_DONE(false); std::atomic_bool JCFG_DONE(false);
@ -93,11 +93,6 @@ ReturnValue_t StarTrackerHandler::initialize() {
return ObjectManagerIF::CHILD_INIT_FAILED; return ObjectManagerIF::CHILD_INIT_FAILED;
} }
// result = strHelper->setComIF(communicationInterface);
// if (result != returnvalue::OK) {
// return ObjectManagerIF::CHILD_INIT_FAILED;
// }
// strHelper->setComCookie(comCookie);
return returnvalue::OK; return returnvalue::OK;
} }
@ -1529,7 +1524,7 @@ ReturnValue_t StarTrackerHandler::scanForTmReply(uint8_t replyId, DeviceCommandI
void StarTrackerHandler::handleEvent(EventMessage* eventMessage) { void StarTrackerHandler::handleEvent(EventMessage* eventMessage) {
object_id_t objectId = eventMessage->getReporter(); object_id_t objectId = eventMessage->getReporter();
switch (objectId) { switch (objectId) {
case objects::STR_HELPER: { case objects::STR_COM_IF: {
// All events from image loader signal either that the operation was successful or that it // All events from image loader signal either that the operation was successful or that it
// failed // failed
strHelperHandlingSpecialRequest = false; strHelperHandlingSpecialRequest = false;
@ -1577,9 +1572,8 @@ void StarTrackerHandler::prepareBootCommand() {
uint32_t length = 0; uint32_t length = 0;
struct BootActionRequest bootRequest = {BOOT_REGION_ID}; struct BootActionRequest bootRequest = {BOOT_REGION_ID};
arc_pack_boot_action_req(&bootRequest, commandBuffer, &length); arc_pack_boot_action_req(&bootRequest, commandBuffer, &length);
// dataLinkLayer.encodeFrame(commandBuffer, length); rawPacket = commandBuffer;
rawPacket = commandBuffer; // dataLinkLayer.getEncodedFrame(); rawPacketLen = length;
rawPacketLen = length; // dataLinkLayer.getEncodedLength();
} }
ReturnValue_t StarTrackerHandler::prepareChecksumCommand(const uint8_t* commandData, ReturnValue_t StarTrackerHandler::prepareChecksumCommand(const uint8_t* commandData,
@ -1611,9 +1605,8 @@ ReturnValue_t StarTrackerHandler::prepareChecksumCommand(const uint8_t* commandD
} }
uint32_t rawCmdLength = 0; uint32_t rawCmdLength = 0;
arc_pack_checksum_action_req(&req, commandBuffer, &rawCmdLength); arc_pack_checksum_action_req(&req, commandBuffer, &rawCmdLength);
// dataLinkLayer.encodeFrame(commandBuffer, rawCmdLength); rawPacket = commandBuffer;
rawPacket = commandBuffer; // dataLinkLayer.getEncodedFrame(); rawPacketLen = rawCmdLength;
rawPacketLen = rawCmdLength; // dataLinkLayer.getEncodedLength();
checksumCmd.rememberRegion = req.region; checksumCmd.rememberRegion = req.region;
checksumCmd.rememberAddress = req.address; checksumCmd.rememberAddress = req.address;
checksumCmd.rememberLength = req.length; checksumCmd.rememberLength = req.length;
@ -1623,51 +1616,45 @@ ReturnValue_t StarTrackerHandler::prepareChecksumCommand(const uint8_t* commandD
void StarTrackerHandler::prepareTimeRequest() { void StarTrackerHandler::prepareTimeRequest() {
uint32_t length = 0; uint32_t length = 0;
arc_tm_pack_time_req(commandBuffer, &length); arc_tm_pack_time_req(commandBuffer, &length);
// dataLinkLayer.encodeFrame(commandBuffer, length); rawPacket = commandBuffer;
rawPacket = commandBuffer; // dataLinkLayer.getEncodedFrame(); rawPacketLen = length;
rawPacketLen = length; // dataLinkLayer.getEncodedLength();
} }
void StarTrackerHandler::preparePingRequest() { void StarTrackerHandler::preparePingRequest() {
uint32_t length = 0; uint32_t length = 0;
struct PingActionRequest pingRequest = {PING_ID}; struct PingActionRequest pingRequest = {PING_ID};
arc_pack_ping_action_req(&pingRequest, commandBuffer, &length); arc_pack_ping_action_req(&pingRequest, commandBuffer, &length);
// dataLinkLayer.encodeFrame(commandBuffer, length); rawPacket = commandBuffer;
rawPacket = commandBuffer; // dataLinkLayer.getEncodedFrame(); rawPacketLen = length;
rawPacketLen = length; // dataLinkLayer.getEncodedLength();
} }
void StarTrackerHandler::prepareVersionRequest() { void StarTrackerHandler::prepareVersionRequest() {
uint32_t length = 0; uint32_t length = 0;
arc_tm_pack_version_req(commandBuffer, &length); arc_tm_pack_version_req(commandBuffer, &length);
// dataLinkLayer.encodeFrame(commandBuffer, length); rawPacket = commandBuffer;
rawPacket = commandBuffer; // dataLinkLayer.getEncodedFrame(); rawPacketLen = length;
rawPacketLen = length; // dataLinkLayer.getEncodedLength();
} }
void StarTrackerHandler::prepareInterfaceRequest() { void StarTrackerHandler::prepareInterfaceRequest() {
uint32_t length = 0; uint32_t length = 0;
arc_tm_pack_interface_req(commandBuffer, &length); arc_tm_pack_interface_req(commandBuffer, &length);
// dataLinkLayer.encodeFrame(commandBuffer, length); rawPacket = commandBuffer;
rawPacket = commandBuffer; // dataLinkLayer.getEncodedFrame(); rawPacketLen = length;
rawPacketLen = length; // dataLinkLayer.getEncodedLength();
} }
void StarTrackerHandler::preparePowerRequest() { void StarTrackerHandler::preparePowerRequest() {
uint32_t length = 0; uint32_t length = 0;
arc_tm_pack_power_req(commandBuffer, &length); arc_tm_pack_power_req(commandBuffer, &length);
// dataLinkLayer.encodeFrame(commandBuffer, length); rawPacket = commandBuffer;
rawPacket = commandBuffer; // dataLinkLayer.getEncodedFrame(); rawPacketLen = length;
rawPacketLen = length; // dataLinkLayer.getEncodedLength();
} }
void StarTrackerHandler::prepareSwitchToBootloaderCmd() { void StarTrackerHandler::prepareSwitchToBootloaderCmd() {
uint32_t length = 0; uint32_t length = 0;
struct RebootActionRequest rebootReq {}; struct RebootActionRequest rebootReq {};
arc_pack_reboot_action_req(&rebootReq, commandBuffer, &length); arc_pack_reboot_action_req(&rebootReq, commandBuffer, &length);
// dataLinkLayer.encodeFrame(commandBuffer, length); rawPacket = commandBuffer;
rawPacket = commandBuffer; // dataLinkLayer.getEncodedFrame(); rawPacketLen = length;
rawPacketLen = length; // dataLinkLayer.getEncodedLength();
} }
void StarTrackerHandler::prepareTakeImageCommand(const uint8_t* commandData) { void StarTrackerHandler::prepareTakeImageCommand(const uint8_t* commandData) {
@ -1675,33 +1662,29 @@ void StarTrackerHandler::prepareTakeImageCommand(const uint8_t* commandData) {
struct CameraActionRequest camReq; struct CameraActionRequest camReq;
camReq.actionid = *commandData; camReq.actionid = *commandData;
arc_pack_camera_action_req(&camReq, commandBuffer, &length); arc_pack_camera_action_req(&camReq, commandBuffer, &length);
// dataLinkLayer.encodeFrame(commandBuffer, length); rawPacket = commandBuffer;
rawPacket = commandBuffer; // dataLinkLayer.getEncodedFrame(); rawPacketLen = length;
rawPacketLen = length; // dataLinkLayer.getEncodedLength();
} }
void StarTrackerHandler::prepareSolutionRequest() { void StarTrackerHandler::prepareSolutionRequest() {
uint32_t length = 0; uint32_t length = 0;
arc_tm_pack_solution_req(commandBuffer, &length); arc_tm_pack_solution_req(commandBuffer, &length);
// dataLinkLayer.encodeFrame(commandBuffer, length); rawPacket = commandBuffer;
rawPacket = commandBuffer; // dataLinkLayer.getEncodedFrame(); rawPacketLen = length;
rawPacketLen = length; // dataLinkLayer.getEncodedLength();
} }
void StarTrackerHandler::prepareTemperatureRequest() { void StarTrackerHandler::prepareTemperatureRequest() {
uint32_t length = 0; uint32_t length = 0;
arc_tm_pack_temperature_req(commandBuffer, &length); arc_tm_pack_temperature_req(commandBuffer, &length);
// dataLinkLayer.encodeFrame(commandBuffer, length); rawPacket = commandBuffer;
rawPacket = commandBuffer; // dataLinkLayer.getEncodedFrame(); rawPacketLen = length;
rawPacketLen = length; // dataLinkLayer.getEncodedLength();
} }
void StarTrackerHandler::prepareHistogramRequest() { void StarTrackerHandler::prepareHistogramRequest() {
uint32_t length = 0; uint32_t length = 0;
arc_tm_pack_histogram_req(commandBuffer, &length); arc_tm_pack_histogram_req(commandBuffer, &length);
// dataLinkLayer.encodeFrame(commandBuffer, length); rawPacket = commandBuffer;
rawPacket = commandBuffer; // dataLinkLayer.getEncodedFrame(); rawPacketLen = length;
rawPacketLen = length; // dataLinkLayer.getEncodedLength();
} }
ReturnValue_t StarTrackerHandler::prepareParamCommand(const uint8_t* commandData, ReturnValue_t StarTrackerHandler::prepareParamCommand(const uint8_t* commandData,
@ -1712,9 +1695,8 @@ ReturnValue_t StarTrackerHandler::prepareParamCommand(const uint8_t* commandData
if (commandDataLen > MAX_PATH_SIZE) { if (commandDataLen > MAX_PATH_SIZE) {
return FILE_PATH_TOO_LONG; return FILE_PATH_TOO_LONG;
} }
std::string fullName(reinterpret_cast<const char*>(commandData), commandDataLen);
result = paramSet.create(fullName, commandBuffer); result = paramSet.create(commandBuffer);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
return result; return result;
} }
@ -1847,7 +1829,7 @@ ReturnValue_t StarTrackerHandler::handleSetParamReply(const uint8_t* rawFrame) {
return SET_PARAM_FAILED; return SET_PARAM_FAILED;
} }
if (internalState != InternalState::IDLE) { if (internalState != InternalState::IDLE) {
handleStartup(rawFrame + 1 + PARAMETER_ID_OFFSET); handleStartup(*(rawFrame + PARAMETER_ID_OFFSET));
} }
return returnvalue::OK; return returnvalue::OK;
} }
@ -2033,8 +2015,8 @@ ReturnValue_t StarTrackerHandler::handleActionReplySet(const uint8_t* rawFrame,
return result; return result;
} }
void StarTrackerHandler::handleStartup(const uint8_t* parameterId) { void StarTrackerHandler::handleStartup(uint8_t parameterId) {
switch (*parameterId) { switch (parameterId) {
case (startracker::ID::LOG_LEVEL): { case (startracker::ID::LOG_LEVEL): {
bootState = FwBootState::LIMITS; bootState = FwBootState::LIMITS;
break; break;
@ -2089,8 +2071,8 @@ void StarTrackerHandler::handleStartup(const uint8_t* parameterId) {
break; break;
} }
default: { default: {
sif::debug << "StarTrackerHandler::handleStartup: Received parameter reply with unexpected" sif::warning << "StarTrackerHandler::handleStartup: Received parameter reply with unexpected"
<< " parameter ID" << std::endl; << " parameter ID " << (int)parameterId << std::endl;
break; break;
} }
} }

View File

@ -2,20 +2,20 @@
#define MISSION_DEVICES_STARTRACKERHANDLER_H_ #define MISSION_DEVICES_STARTRACKERHANDLER_H_
#include <fsfw/datapool/PoolReadGuard.h> #include <fsfw/datapool/PoolReadGuard.h>
#include <linux/devices/startracker/StarTrackerJsonCommands.h>
#include <linux/devices/startracker/StrComHandler.h>
#include <thread> #include <thread>
#include "ArcsecDatalinkLayer.h" #include "ArcsecDatalinkLayer.h"
#include "ArcsecJsonParamBase.h" #include "ArcsecJsonParamBase.h"
#include "OBSWConfig.h" #include "OBSWConfig.h"
#include "StrComHandler.h"
#include "arcsec/common/SLIP.h" #include "arcsec/common/SLIP.h"
#include "devices/powerSwitcherList.h" #include "devices/powerSwitcherList.h"
#include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h"
#include "fsfw/src/fsfw/serialize/SerializeAdapter.h" #include "fsfw/src/fsfw/serialize/SerializeAdapter.h"
#include "fsfw/timemanager/Countdown.h" #include "fsfw/timemanager/Countdown.h"
#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" #include "linux/devices/devicedefinitions/StarTrackerDefinitions.h"
#include "strJsonCommands.h"
/** /**
* @brief This is the device handler for the star tracker from arcsec. * @brief This is the device handler for the star tracker from arcsec.
@ -472,7 +472,7 @@ class StarTrackerHandler : public DeviceHandlerBase {
/** /**
* @brief Handles the startup state machine * @brief Handles the startup state machine
*/ */
void handleStartup(const uint8_t* parameterId); void handleStartup(uint8_t parameterId);
/** /**
* @brief Handles telemtry replies and fills the appropriate dataset * @brief Handles telemtry replies and fills the appropriate dataset

View File

@ -1,6 +1,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <fsfw/filesystem/HasFileSystemIF.h> #include <fsfw/filesystem/HasFileSystemIF.h>
#include <fsfw/tasks/TaskFactory.h> #include <fsfw/tasks/TaskFactory.h>
#include <fsfw/timemanager/Stopwatch.h>
#include <linux/devices/startracker/StrComHandler.h> #include <linux/devices/startracker/StrComHandler.h>
#include <unistd.h> #include <unistd.h>
@ -18,7 +19,10 @@
using namespace returnvalue; using namespace returnvalue;
StrComHandler::StrComHandler(object_id_t objectId) : SystemObject(objectId) {} StrComHandler::StrComHandler(object_id_t objectId) : SystemObject(objectId) {
lock = MutexFactory::instance()->createMutex();
semaphore.acquire();
}
StrComHandler::~StrComHandler() {} StrComHandler::~StrComHandler() {}
@ -35,51 +39,60 @@ ReturnValue_t StrComHandler::initialize() {
ReturnValue_t StrComHandler::performOperation(uint8_t operationCode) { ReturnValue_t StrComHandler::performOperation(uint8_t operationCode) {
ReturnValue_t result = returnvalue::OK; ReturnValue_t result = returnvalue::OK;
semaphore.acquire();
while (true) { while (true) {
switch (internalState) { lock->lockMutex();
case InternalState::IDLE: { state = InternalState::SLEEPING;
semaphore.acquire(); lock->unlockMutex();
semaphore.acquire();
switch (state) {
case InternalState::POLL_ONE_REPLY: {
// Stopwatch watch;
replyTimeout.setTimeout(200);
replyResult = readOneReply(static_cast<uint32_t>(state));
{
MutexGuard mg(lock);
replyWasReceived = true;
}
break; break;
} }
case InternalState::UPLOAD_IMAGE: { case InternalState::UPLOAD_IMAGE: {
replyTimeout.setTimeout(200);
result = performImageUpload(); result = performImageUpload();
if (result == returnvalue::OK) { if (result == returnvalue::OK) {
triggerEvent(IMAGE_UPLOAD_SUCCESSFUL); triggerEvent(IMAGE_UPLOAD_SUCCESSFUL);
} else { } else {
triggerEvent(IMAGE_UPLOAD_FAILED); triggerEvent(IMAGE_UPLOAD_FAILED);
} }
internalState = InternalState::IDLE;
break; break;
} }
case InternalState::DOWNLOAD_IMAGE: { case InternalState::DOWNLOAD_IMAGE: {
replyTimeout.setTimeout(200);
result = performImageDownload(); result = performImageDownload();
if (result == returnvalue::OK) { if (result == returnvalue::OK) {
triggerEvent(IMAGE_DOWNLOAD_SUCCESSFUL); triggerEvent(IMAGE_DOWNLOAD_SUCCESSFUL);
} else { } else {
triggerEvent(IMAGE_DOWNLOAD_FAILED); triggerEvent(IMAGE_DOWNLOAD_FAILED);
} }
internalState = InternalState::IDLE;
break; break;
} }
case InternalState::FLASH_READ: { case InternalState::FLASH_READ: {
replyTimeout.setTimeout(200);
result = performFlashRead(); result = performFlashRead();
if (result == returnvalue::OK) { if (result == returnvalue::OK) {
triggerEvent(FLASH_READ_SUCCESSFUL); triggerEvent(FLASH_READ_SUCCESSFUL);
} else { } else {
triggerEvent(FLASH_READ_FAILED); triggerEvent(FLASH_READ_FAILED);
} }
internalState = InternalState::IDLE;
break; break;
} }
case InternalState::FIRMWARE_UPDATE: { case InternalState::FIRMWARE_UPDATE: {
replyTimeout.setTimeout(200);
result = performFirmwareUpdate(); result = performFirmwareUpdate();
if (result == returnvalue::OK) { if (result == returnvalue::OK) {
triggerEvent(FIRMWARE_UPDATE_SUCCESSFUL); triggerEvent(FIRMWARE_UPDATE_SUCCESSFUL);
} else { } else {
triggerEvent(FIRMWARE_UPDATE_FAILED); triggerEvent(FIRMWARE_UPDATE_FAILED);
} }
internalState = InternalState::IDLE;
break; break;
} }
default: default:
@ -90,6 +103,12 @@ ReturnValue_t StrComHandler::performOperation(uint8_t operationCode) {
} }
ReturnValue_t StrComHandler::startImageUpload(std::string fullname) { ReturnValue_t StrComHandler::startImageUpload(std::string fullname) {
{
MutexGuard mg(lock);
if (state != InternalState::SLEEPING) {
return BUSY;
}
}
#ifdef XIPHOS_Q7S #ifdef XIPHOS_Q7S
ReturnValue_t result = checkPath(fullname); ReturnValue_t result = checkPath(fullname);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
@ -100,13 +119,22 @@ ReturnValue_t StrComHandler::startImageUpload(std::string fullname) {
if (not std::filesystem::exists(fullname)) { if (not std::filesystem::exists(fullname)) {
return FILE_NOT_EXISTS; return FILE_NOT_EXISTS;
} }
internalState = InternalState::UPLOAD_IMAGE; {
MutexGuard mg(lock);
state = InternalState::UPLOAD_IMAGE;
}
semaphore.release(); semaphore.release();
terminate = false; terminate = false;
return returnvalue::OK; return returnvalue::OK;
} }
ReturnValue_t StrComHandler::startImageDownload(std::string path) { ReturnValue_t StrComHandler::startImageDownload(std::string path) {
{
MutexGuard mg(lock);
if (state != InternalState::SLEEPING) {
return BUSY;
}
}
#ifdef XIPHOS_Q7S #ifdef XIPHOS_Q7S
ReturnValue_t result = checkPath(path); ReturnValue_t result = checkPath(path);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
@ -117,7 +145,10 @@ ReturnValue_t StrComHandler::startImageDownload(std::string path) {
return PATH_NOT_EXISTS; return PATH_NOT_EXISTS;
} }
downloadImage.path = path; downloadImage.path = path;
internalState = InternalState::DOWNLOAD_IMAGE; {
MutexGuard mg(lock);
state = InternalState::DOWNLOAD_IMAGE;
}
terminate = false; terminate = false;
semaphore.release(); semaphore.release();
return returnvalue::OK; return returnvalue::OK;
@ -132,6 +163,12 @@ void StrComHandler::setDownloadImageName(std::string filename) {
void StrComHandler::setFlashReadFilename(std::string filename) { flashRead.filename = filename; } void StrComHandler::setFlashReadFilename(std::string filename) { flashRead.filename = filename; }
ReturnValue_t StrComHandler::startFirmwareUpdate(std::string fullname) { ReturnValue_t StrComHandler::startFirmwareUpdate(std::string fullname) {
{
MutexGuard mg(lock);
if (state != InternalState::SLEEPING) {
return BUSY;
}
}
#ifdef XIPHOS_Q7S #ifdef XIPHOS_Q7S
ReturnValue_t result = checkPath(fullname); ReturnValue_t result = checkPath(fullname);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
@ -144,7 +181,10 @@ ReturnValue_t StrComHandler::startFirmwareUpdate(std::string fullname) {
} }
flashWrite.firstRegion = static_cast<uint8_t>(startracker::FirmwareRegions::FIRST); flashWrite.firstRegion = static_cast<uint8_t>(startracker::FirmwareRegions::FIRST);
flashWrite.lastRegion = static_cast<uint8_t>(startracker::FirmwareRegions::LAST); flashWrite.lastRegion = static_cast<uint8_t>(startracker::FirmwareRegions::LAST);
internalState = InternalState::FIRMWARE_UPDATE; {
MutexGuard mg(lock);
state = InternalState::FIRMWARE_UPDATE;
}
semaphore.release(); semaphore.release();
terminate = false; terminate = false;
return returnvalue::OK; return returnvalue::OK;
@ -152,6 +192,12 @@ ReturnValue_t StrComHandler::startFirmwareUpdate(std::string fullname) {
ReturnValue_t StrComHandler::startFlashRead(std::string path, uint8_t startRegion, ReturnValue_t StrComHandler::startFlashRead(std::string path, uint8_t startRegion,
uint32_t length) { uint32_t length) {
{
MutexGuard mg(lock);
if (state != InternalState::SLEEPING) {
return BUSY;
}
}
#ifdef XIPHOS_Q7S #ifdef XIPHOS_Q7S
ReturnValue_t result = checkPath(path); ReturnValue_t result = checkPath(path);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
@ -164,7 +210,10 @@ ReturnValue_t StrComHandler::startFlashRead(std::string path, uint8_t startRegio
} }
flashRead.startRegion = startRegion; flashRead.startRegion = startRegion;
flashRead.size = length; flashRead.size = length;
internalState = InternalState::FLASH_READ; {
MutexGuard mg(lock);
state = InternalState::FLASH_READ;
}
semaphore.release(); semaphore.release();
terminate = false; terminate = false;
return returnvalue::OK; return returnvalue::OK;
@ -187,7 +236,6 @@ ReturnValue_t StrComHandler::performImageDownload() {
struct DownloadActionRequest downloadReq; struct DownloadActionRequest downloadReq;
uint32_t size = 0; uint32_t size = 0;
uint32_t retries = 0; uint32_t retries = 0;
const uint8_t* replyFrame;
size_t replySize = 0; size_t replySize = 0;
std::string image = Filenaming::generateAbsoluteFilename(downloadImage.path, std::string image = Filenaming::generateAbsoluteFilename(downloadImage.path,
downloadImage.filename, timestamping); downloadImage.filename, timestamping);
@ -201,38 +249,38 @@ ReturnValue_t StrComHandler::performImageDownload() {
file.close(); file.close();
return returnvalue::OK; return returnvalue::OK;
} }
arc_pack_download_action_req(&downloadReq, commandBuffer, &size); arc_pack_download_action_req(&downloadReq, cmdBuf.data(), &size);
result = sendAndRead(size, downloadReq.position, &replyFrame, replySize); result = sendAndRead(size, downloadReq.position);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
if (retries < CONFIG_MAX_DOWNLOAD_RETRIES) { if (retries < CONFIG_MAX_DOWNLOAD_RETRIES) {
uart::flushRxBuf(serialPort); serial::flushRxBuf(serialPort);
retries++; retries++;
continue; continue;
} }
file.close(); file.close();
return result; return result;
} }
result = checkActionReply(replyFrame, replySize); result = checkActionReply(replySize);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
if (retries < CONFIG_MAX_DOWNLOAD_RETRIES) { if (retries < CONFIG_MAX_DOWNLOAD_RETRIES) {
uart::flushRxBuf(serialPort); serial::flushRxBuf(serialPort);
retries++; retries++;
continue; continue;
} }
file.close(); file.close();
return result; return result;
} }
result = checkReplyPosition(replyFrame, downloadReq.position); result = checkReplyPosition(downloadReq.position);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
if (retries < CONFIG_MAX_DOWNLOAD_RETRIES) { if (retries < CONFIG_MAX_DOWNLOAD_RETRIES) {
uart::flushRxBuf(serialPort); serial::flushRxBuf(serialPort);
retries++; retries++;
continue; continue;
} }
file.close(); file.close();
return result; return result;
} }
file.write(reinterpret_cast<const char*>(replyFrame + IMAGE_DATA_OFFSET), CHUNK_SIZE); file.write(reinterpret_cast<const char*>(replyPtr + IMAGE_DATA_OFFSET), CHUNK_SIZE);
#if OBSW_DEBUG_STARTRACKER == 1 #if OBSW_DEBUG_STARTRACKER == 1
progressPrinter.print(downloadReq.position); progressPrinter.print(downloadReq.position);
#endif /* OBSW_DEBUG_STARTRACKER == 1 */ #endif /* OBSW_DEBUG_STARTRACKER == 1 */
@ -247,8 +295,6 @@ ReturnValue_t StrComHandler::performImageUpload() {
ReturnValue_t result = returnvalue::OK; ReturnValue_t result = returnvalue::OK;
uint32_t size = 0; uint32_t size = 0;
uint32_t imageSize = 0; uint32_t imageSize = 0;
const uint8_t* replyFrame;
size_t replySize = 0;
struct UploadActionRequest uploadReq; struct UploadActionRequest uploadReq;
uploadReq.position = 0; uploadReq.position = 0;
#ifdef XIPHOS_Q7S #ifdef XIPHOS_Q7S
@ -258,8 +304,7 @@ ReturnValue_t StrComHandler::performImageUpload() {
#endif #endif
std::memset(&uploadReq.data, 0, sizeof(uploadReq.data)); std::memset(&uploadReq.data, 0, sizeof(uploadReq.data));
if (not std::filesystem::exists(uploadImage.uploadFile)) { if (not std::filesystem::exists(uploadImage.uploadFile)) {
triggerEvent(STR_HELPER_FILE_NOT_EXISTS, static_cast<uint32_t>(internalState)); triggerEvent(STR_HELPER_FILE_NOT_EXISTS, static_cast<uint32_t>(state));
internalState = InternalState::IDLE;
return returnvalue::FAILED; return returnvalue::FAILED;
} }
std::ifstream file(uploadImage.uploadFile, std::ifstream::binary); std::ifstream file(uploadImage.uploadFile, std::ifstream::binary);
@ -276,26 +321,29 @@ ReturnValue_t StrComHandler::performImageUpload() {
#endif /* OBSW_DEBUG_STARTRACKER == 1 */ #endif /* OBSW_DEBUG_STARTRACKER == 1 */
while ((uploadReq.position + 1) * SIZE_IMAGE_PART < imageSize) { while ((uploadReq.position + 1) * SIZE_IMAGE_PART < imageSize) {
if (terminate) { if (terminate) {
file.close();
return returnvalue::OK; return returnvalue::OK;
} }
file.seekg(uploadReq.position * SIZE_IMAGE_PART, file.beg); file.seekg(uploadReq.position * SIZE_IMAGE_PART, file.beg);
file.read(reinterpret_cast<char*>(uploadReq.data), SIZE_IMAGE_PART); file.read(reinterpret_cast<char*>(uploadReq.data), SIZE_IMAGE_PART);
arc_pack_upload_action_req(&uploadReq, commandBuffer, &size); arc_pack_upload_action_req(&uploadReq, cmdBuf.data(), &size);
result = sendAndRead(size, uploadReq.position, &replyFrame, replySize); result = sendAndRead(size, uploadReq.position);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
file.close();
return returnvalue::FAILED; return returnvalue::FAILED;
} }
result = checkActionReply(replyFrame, replySize); result = checkActionReply(replyLen);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
file.close();
return result; return result;
} }
#if OBSW_DEBUG_STARTRACKER == 1 #if OBSW_DEBUG_STARTRACKER == 1
progressPrinter.print((uploadReq.position + 1) * SIZE_IMAGE_PART); progressPrinter.print((uploadReq.position + 1) * SIZE_IMAGE_PART);
#endif /* OBSW_DEBUG_STARTRACKER == 1 */ #endif /* OBSW_DEBUG_STARTRACKER == 1 */
uploadReq.position++; uploadReq.position++;
// This does a bit of delaying roughly every second
if (uploadReq.position % 50 == 0) {
// Some grace time for other tasks
TaskFactory::delayTask(2);
}
} }
std::memset(uploadReq.data, 0, sizeof(uploadReq.data)); std::memset(uploadReq.data, 0, sizeof(uploadReq.data));
uint32_t remainder = imageSize - uploadReq.position * SIZE_IMAGE_PART; uint32_t remainder = imageSize - uploadReq.position * SIZE_IMAGE_PART;
@ -303,12 +351,12 @@ ReturnValue_t StrComHandler::performImageUpload() {
file.read(reinterpret_cast<char*>(uploadReq.data), remainder); file.read(reinterpret_cast<char*>(uploadReq.data), remainder);
file.close(); file.close();
uploadReq.position++; uploadReq.position++;
arc_pack_upload_action_req(&uploadReq, commandBuffer, &size); arc_pack_upload_action_req(&uploadReq, cmdBuf.data(), &size);
result = sendAndRead(size, uploadReq.position, &replyFrame, replySize); result = sendAndRead(size, uploadReq.position);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
return returnvalue::FAILED; return returnvalue::FAILED;
} }
result = checkActionReply(replyFrame, replySize); result = checkActionReply(replyLen);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
return result; return result;
} }
@ -340,16 +388,16 @@ ReturnValue_t StrComHandler::performFlashWrite() {
uint32_t size = 0; uint32_t size = 0;
uint32_t bytesWritten = 0; uint32_t bytesWritten = 0;
uint32_t fileSize = 0; uint32_t fileSize = 0;
const uint8_t* replyFrame;
size_t replySize = 0;
struct WriteActionRequest req; struct WriteActionRequest req;
if (not std::filesystem::exists(flashWrite.fullname)) { if (not std::filesystem::exists(flashWrite.fullname)) {
triggerEvent(STR_HELPER_FILE_NOT_EXISTS, static_cast<uint32_t>(internalState)); triggerEvent(STR_HELPER_FILE_NOT_EXISTS, static_cast<uint32_t>(state));
internalState = InternalState::IDLE;
return returnvalue::FAILED; return returnvalue::FAILED;
} }
std::ifstream file(flashWrite.fullname, std::ifstream::binary); std::ifstream file(flashWrite.fullname, std::ifstream::binary);
if (file.bad()) {
return returnvalue::FAILED;
}
file.seekg(0, file.end); file.seekg(0, file.end);
fileSize = file.tellg(); fileSize = file.tellg();
if (fileSize > FLASH_REGION_SIZE * (flashWrite.lastRegion - flashWrite.firstRegion)) { if (fileSize > FLASH_REGION_SIZE * (flashWrite.lastRegion - flashWrite.firstRegion)) {
@ -365,7 +413,6 @@ ReturnValue_t StrComHandler::performFlashWrite() {
req.length = CHUNK_SIZE; req.length = CHUNK_SIZE;
for (uint32_t idx = 0; idx < fileChunks; idx++) { for (uint32_t idx = 0; idx < fileChunks; idx++) {
if (terminate) { if (terminate) {
file.close();
return returnvalue::OK; return returnvalue::OK;
} }
file.seekg(idx * CHUNK_SIZE, file.beg); file.seekg(idx * CHUNK_SIZE, file.beg);
@ -375,21 +422,23 @@ ReturnValue_t StrComHandler::performFlashWrite() {
bytesWritten = 0; bytesWritten = 0;
} }
req.address = bytesWritten; req.address = bytesWritten;
arc_pack_write_action_req(&req, commandBuffer, &size); arc_pack_write_action_req(&req, cmdBuf.data(), &size);
result = sendAndRead(size, req.address, &replyFrame, replySize); result = sendAndRead(size, req.address);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
file.close();
return result; return result;
} }
result = checkActionReply(replyFrame, replySize); result = checkActionReply(replyLen);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
file.close();
return result; return result;
} }
bytesWritten += CHUNK_SIZE; bytesWritten += CHUNK_SIZE;
#if OBSW_DEBUG_STARTRACKER == 1 #if OBSW_DEBUG_STARTRACKER == 1
progressPrinter.print(idx * CHUNK_SIZE); progressPrinter.print(idx * CHUNK_SIZE);
#endif /* OBSW_DEBUG_STARTRACKER == 1 */ #endif /* OBSW_DEBUG_STARTRACKER == 1 */
if (idx % 50 == 0) {
// Some grace time for other tasks
TaskFactory::delayTask(2);
}
} }
uint32_t remainingBytes = fileSize - fileChunks * CHUNK_SIZE; uint32_t remainingBytes = fileSize - fileChunks * CHUNK_SIZE;
file.seekg((fileChunks - 1) * CHUNK_SIZE, file.beg); file.seekg((fileChunks - 1) * CHUNK_SIZE, file.beg);
@ -402,12 +451,12 @@ ReturnValue_t StrComHandler::performFlashWrite() {
req.address = bytesWritten; req.address = bytesWritten;
req.length = remainingBytes; req.length = remainingBytes;
bytesWritten += remainingBytes; bytesWritten += remainingBytes;
arc_pack_write_action_req(&req, commandBuffer, &size); arc_pack_write_action_req(&req, cmdBuf.data(), &size);
result = sendAndRead(size, req.address, &replyFrame, replySize); result = sendAndRead(size, req.address);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
return result; return result;
} }
result = checkActionReply(replyFrame, replySize); result = checkActionReply(replyLen);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
return result; return result;
} }
@ -431,8 +480,6 @@ ReturnValue_t StrComHandler::performFlashRead() {
uint32_t bytesRead = 0; uint32_t bytesRead = 0;
uint32_t size = 0; uint32_t size = 0;
uint32_t retries = 0; uint32_t retries = 0;
const uint8_t* replyFrame;
size_t replySize = 0;
Timestamp timestamp; Timestamp timestamp;
std::string fullname = std::string fullname =
Filenaming::generateAbsoluteFilename(flashRead.path, flashRead.filename, timestamping); Filenaming::generateAbsoluteFilename(flashRead.path, flashRead.filename, timestamping);
@ -451,28 +498,28 @@ ReturnValue_t StrComHandler::performFlashRead() {
} else { } else {
req.length = CHUNK_SIZE; req.length = CHUNK_SIZE;
} }
arc_pack_read_action_req(&req, commandBuffer, &size); arc_pack_read_action_req(&req, cmdBuf.data(), &size);
result = sendAndRead(size, req.address, &replyFrame, replySize); result = sendAndRead(size, req.address);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
if (retries < CONFIG_MAX_DOWNLOAD_RETRIES) { if (retries < CONFIG_MAX_DOWNLOAD_RETRIES) {
uart::flushRxBuf(serialPort); serial::flushRxBuf(serialPort);
retries++; retries++;
continue; continue;
} }
file.close(); file.close();
return result; return result;
} }
result = checkActionReply(replyFrame, replySize); result = checkActionReply(replyLen);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
if (retries < CONFIG_MAX_DOWNLOAD_RETRIES) { if (retries < CONFIG_MAX_DOWNLOAD_RETRIES) {
uart::flushRxBuf(serialPort); serial::flushRxBuf(serialPort);
retries++; retries++;
continue; continue;
} }
file.close(); file.close();
return result; return result;
} }
file.write(reinterpret_cast<const char*>(replyFrame + FLASH_READ_DATA_OFFSET), req.length); file.write(reinterpret_cast<const char*>(replyPtr + FLASH_READ_DATA_OFFSET), req.length);
bytesRead += req.length; bytesRead += req.length;
req.address += req.length; req.address += req.length;
if (req.address >= FLASH_REGION_SIZE) { if (req.address >= FLASH_REGION_SIZE) {
@ -488,51 +535,29 @@ ReturnValue_t StrComHandler::performFlashRead() {
return returnvalue::OK; return returnvalue::OK;
} }
ReturnValue_t StrComHandler::sendAndRead(size_t size, uint32_t failParameter, ReturnValue_t StrComHandler::sendAndRead(size_t size, uint32_t failParameter) {
const uint8_t** replyFrame, size_t& replyLen) {
ReturnValue_t result = returnvalue::OK; ReturnValue_t result = returnvalue::OK;
uint8_t nextDelayMs = 1;
ReturnValue_t decResult = returnvalue::OK;
const uint8_t* sendData; const uint8_t* sendData;
size_t txFrameLen = 0; size_t txFrameLen = 0;
datalinkLayer.encodeFrame(commandBuffer, size, &sendData, txFrameLen); datalinkLayer.encodeFrame(cmdBuf.data(), size, &sendData, txFrameLen);
int writeResult = write(serialPort, sendData, txFrameLen); int writeResult = write(serialPort, sendData, txFrameLen);
if (writeResult < 0) { if (writeResult < 0) {
sif::warning << "StrHelper::sendAndRead: Failed to send packet" << std::endl; sif::warning << "StrHelper::sendAndRead: Failed to send packet" << std::endl;
triggerEvent(STR_HELPER_SENDING_PACKET_FAILED, result, failParameter); triggerEvent(STR_HELPER_SENDING_PACKET_FAILED, result, failParameter);
return returnvalue::FAILED; return returnvalue::FAILED;
} }
replyTimeout.resetTimer();
while (true) { return readOneReply(failParameter);
handleSerialReception();
result = datalinkLayer.checkRingBufForFrame(replyFrame, replyLen);
if (result == returnvalue::OK) {
return returnvalue::OK;
}
if (replyTimeout.hasTimedOut()) {
triggerEvent(STR_HELPER_REPLY_TIMEOUT, failParameter, replyTimeout.getTimeoutMs());
return returnvalue::FAILED;
}
TaskFactory::delayTask(nextDelayMs);
if (nextDelayMs < 32) {
nextDelayMs *= 2;
}
}
if (decResult != returnvalue::OK) {
triggerEvent(STR_HELPER_DEC_ERROR, decResult, failParameter);
return returnvalue::FAILED;
}
return returnvalue::OK;
} }
ReturnValue_t StrComHandler::checkActionReply(const uint8_t* rawFrame, size_t replySize) { ReturnValue_t StrComHandler::checkActionReply(size_t replySize) {
uint8_t type = str::getReplyFrameType(rawFrame); uint8_t type = str::getReplyFrameType(replyPtr);
if (type != TMTC_ACTIONREPLY) { if (type != TMTC_ACTIONREPLY) {
sif::warning << "StrHelper::checkActionReply: Received reply with invalid type ID" << std::endl; sif::warning << "StrHelper::checkActionReply: Received reply with invalid type ID" << std::endl;
return INVALID_TYPE_ID; return INVALID_TYPE_ID;
} }
uint8_t status = str::getStatusField(rawFrame); uint8_t status = str::getStatusField(replyPtr);
if (status != ArcsecDatalinkLayer::STATUS_OK) { if (status != ArcsecDatalinkLayer::STATUS_OK) {
sif::warning << "StrHelper::checkActionReply: Status failure: " sif::warning << "StrHelper::checkActionReply: Status failure: "
<< static_cast<unsigned int>(status) << std::endl; << static_cast<unsigned int>(status) << std::endl;
@ -541,10 +566,9 @@ ReturnValue_t StrComHandler::checkActionReply(const uint8_t* rawFrame, size_t re
return returnvalue::OK; return returnvalue::OK;
} }
ReturnValue_t StrComHandler::checkReplyPosition(const uint8_t* rawFrame, ReturnValue_t StrComHandler::checkReplyPosition(uint32_t expectedPosition) {
uint32_t expectedPosition) {
uint32_t receivedPosition = 0; uint32_t receivedPosition = 0;
std::memcpy(&receivedPosition, rawFrame + POS_OFFSET, sizeof(receivedPosition)); std::memcpy(&receivedPosition, replyPtr + POS_OFFSET, sizeof(receivedPosition));
if (receivedPosition != expectedPosition) { if (receivedPosition != expectedPosition) {
triggerEvent(POSITION_MISMATCH, receivedPosition); triggerEvent(POSITION_MISMATCH, receivedPosition);
return returnvalue::FAILED; return returnvalue::FAILED;
@ -589,11 +613,11 @@ ReturnValue_t StrComHandler::initializeInterface(CookieIF* cookie) {
} }
// Setting up UART parameters // Setting up UART parameters
tty.c_cflag &= ~PARENB; // Clear parity bit tty.c_cflag &= ~PARENB; // Clear parity bit
uart::setStopbits(tty, serCookie->getStopBits()); serial::setStopbits(tty, serCookie->getStopBits());
uart::setBitsPerWord(tty, BitsPerWord::BITS_8); serial::setBitsPerWord(tty, BitsPerWord::BITS_8);
tty.c_cflag &= ~CRTSCTS; // Disable RTS/CTS hardware flow control tty.c_cflag &= ~CRTSCTS; // Disable RTS/CTS hardware flow control
uart::enableRead(tty); serial::enableRead(tty);
uart::ignoreCtrlLines(tty); serial::ignoreCtrlLines(tty);
// Use non-canonical mode and clear echo flag // Use non-canonical mode and clear echo flag
tty.c_lflag &= ~(ICANON | ECHO); tty.c_lflag &= ~(ICANON | ECHO);
@ -602,7 +626,7 @@ ReturnValue_t StrComHandler::initializeInterface(CookieIF* cookie) {
tty.c_cc[VTIME] = 0; tty.c_cc[VTIME] = 0;
tty.c_cc[VMIN] = 0; tty.c_cc[VMIN] = 0;
uart::setBaudrate(tty, serCookie->getBaudrate()); serial::setBaudrate(tty, serCookie->getBaudrate());
if (tcsetattr(serialPort, TCSANOW, &tty) != 0) { if (tcsetattr(serialPort, TCSANOW, &tty) != 0) {
sif::warning << "ScexUartReader::initializeInterface: tcsetattr call failed with error [" sif::warning << "ScexUartReader::initializeInterface: tcsetattr call failed with error ["
<< errno << ", " << strerror(errno) << std::endl; << errno << ", " << strerror(errno) << std::endl;
@ -614,6 +638,14 @@ ReturnValue_t StrComHandler::initializeInterface(CookieIF* cookie) {
ReturnValue_t StrComHandler::sendMessage(CookieIF* cookie, const uint8_t* sendData, ReturnValue_t StrComHandler::sendMessage(CookieIF* cookie, const uint8_t* sendData,
size_t sendLen) { size_t sendLen) {
{
MutexGuard mg(lock);
if (state != InternalState::SLEEPING) {
return BUSY;
}
}
serial::flushRxBuf(serialPort);
const uint8_t* txFrame; const uint8_t* txFrame;
size_t frameLen; size_t frameLen;
datalinkLayer.encodeFrame(sendData, sendLen, &txFrame, frameLen); datalinkLayer.encodeFrame(sendData, sendLen, &txFrame, frameLen);
@ -623,6 +655,20 @@ ReturnValue_t StrComHandler::sendMessage(CookieIF* cookie, const uint8_t* sendDa
<< std::endl; << std::endl;
return returnvalue::FAILED; return returnvalue::FAILED;
} }
// Hacky, but the alternatives look bleak. The raw data contains the information we need
// and there are not too many special cases.
if (sendData[0] == TMTC_ACTIONREQ) {
// 1 is a firmware boot request and 7 is a reboot request. For both, no reply is expected.
if (sendData[1] == 7 or sendData[1] == 1) {
return returnvalue::OK;
}
}
{
MutexGuard mg(lock);
state = InternalState::POLL_ONE_REPLY;
}
// Unlock task to perform reply reading.
semaphore.release();
return returnvalue::OK; return returnvalue::OK;
} }
@ -633,13 +679,29 @@ ReturnValue_t StrComHandler::requestReceiveMessage(CookieIF* cookie, size_t requ
} }
ReturnValue_t StrComHandler::readReceivedMessage(CookieIF* cookie, uint8_t** buffer, size_t* size) { ReturnValue_t StrComHandler::readReceivedMessage(CookieIF* cookie, uint8_t** buffer, size_t* size) {
return returnvalue::OK; // Consider it a configuration error if the task is not done with a command -> reply cycle
// in time.
bool replyWasReceived = false;
{
MutexGuard mg(lock);
if (state != InternalState::SLEEPING) {
return BUSY;
}
replyWasReceived = this->replyWasReceived;
}
if (not replyWasReceived) {
*size = 0;
return returnvalue::OK;
}
if (replyResult == returnvalue::OK) {
*buffer = const_cast<uint8_t*>(replyPtr);
*size = replyLen;
}
return replyResult;
} }
ReturnValue_t StrComHandler::unlockAndEraseRegions(uint32_t from, uint32_t to) { ReturnValue_t StrComHandler::unlockAndEraseRegions(uint32_t from, uint32_t to) {
ReturnValue_t result = returnvalue::OK; ReturnValue_t result = returnvalue::OK;
const uint8_t* replyFrame;
size_t replySize = 0;
#if OBSW_DEBUG_STARTRACKER == 1 #if OBSW_DEBUG_STARTRACKER == 1
ProgressPrinter progressPrinter("Unlock and erase", to - from); ProgressPrinter progressPrinter("Unlock and erase", to - from);
#endif /* OBSW_DEBUG_STARTRACKER == 1 */ #endif /* OBSW_DEBUG_STARTRACKER == 1 */
@ -649,17 +711,20 @@ ReturnValue_t StrComHandler::unlockAndEraseRegions(uint32_t from, uint32_t to) {
for (uint32_t idx = from; idx <= to; idx++) { for (uint32_t idx = from; idx <= to; idx++) {
unlockReq.region = idx; unlockReq.region = idx;
unlockReq.code = startracker::region_secrets::secret[idx]; unlockReq.code = startracker::region_secrets::secret[idx];
arc_pack_unlock_action_req(&unlockReq, commandBuffer, &size); arc_pack_unlock_action_req(&unlockReq, cmdBuf.data(), &size);
sendAndRead(size, unlockReq.region, &replyFrame, replySize); result = sendAndRead(size, unlockReq.region);
result = checkActionReply(replyFrame, replySize); if (result != returnvalue::OK) {
return result;
}
result = checkActionReply(replyLen);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
sif::warning << "StrHelper::unlockAndEraseRegions: Failed to unlock region with id " sif::warning << "StrHelper::unlockAndEraseRegions: Failed to unlock region with id "
<< static_cast<unsigned int>(unlockReq.region) << std::endl; << static_cast<unsigned int>(unlockReq.region) << std::endl;
return result; return result;
} }
eraseReq.region = idx; eraseReq.region = idx;
arc_pack_erase_action_req(&eraseReq, commandBuffer, &size); arc_pack_erase_action_req(&eraseReq, cmdBuf.data(), &size);
result = sendAndRead(size, eraseReq.region, &replyFrame, replySize); result = sendAndRead(size, eraseReq.region);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
sif::warning << "StrHelper::unlockAndEraseRegions: Failed to erase region with id " sif::warning << "StrHelper::unlockAndEraseRegions: Failed to erase region with id "
<< static_cast<unsigned int>(eraseReq.region) << std::endl; << static_cast<unsigned int>(eraseReq.region) << std::endl;
@ -686,9 +751,33 @@ ReturnValue_t StrComHandler::handleSerialReception() {
<< " bytes" << std::endl; << " bytes" << std::endl;
return FAILED; return FAILED;
} else if (bytesRead > 0) { } else if (bytesRead > 0) {
// sif::info << "Received " << bytesRead << " bytes from the PLOC Supervisor:" << std::endl; // sif::info << "Received " << bytesRead << " bytes from the STR" << std::endl;
// arrayprinter::print(recBuf.data(), bytesRead); // arrayprinter::print(recBuf.data(), bytesRead);
datalinkLayer.feedData(recBuf.data(), bytesRead); datalinkLayer.feedData(recBuf.data(), bytesRead);
} }
return OK; return OK;
} }
ReturnValue_t StrComHandler::readOneReply(uint32_t failParameter) {
ReturnValue_t result;
uint32_t nextDelayMs = 1;
replyTimeout.resetTimer();
while (true) {
handleSerialReception();
result = datalinkLayer.checkRingBufForFrame(&replyPtr, replyLen);
if (result == returnvalue::OK) {
return returnvalue::OK;
} else if (result != ArcsecDatalinkLayer::DEC_IN_PROGRESS) {
triggerEvent(STR_HELPER_DEC_ERROR, result, failParameter);
return DECODING_ERROR;
}
if (replyTimeout.hasTimedOut()) {
triggerEvent(STR_COM_REPLY_TIMEOUT, failParameter, replyTimeout.getTimeoutMs());
return RECEPTION_TIMEOUT;
}
TaskFactory::delayTask(nextDelayMs);
if (nextDelayMs < 32) {
nextDelayMs *= 2;
}
}
}

View File

@ -28,24 +28,27 @@ class StrComHandler : public SystemObject, public DeviceCommunicationIF, public
public: public:
static const uint8_t INTERFACE_ID = CLASS_ID::STR_HELPER; static const uint8_t INTERFACE_ID = CLASS_ID::STR_HELPER;
static const ReturnValue_t BUSY = MAKE_RETURN_CODE(0);
//! [EXPORT] : [COMMENT] SD card specified in path string not mounted //! [EXPORT] : [COMMENT] SD card specified in path string not mounted
static const ReturnValue_t SD_NOT_MOUNTED = MAKE_RETURN_CODE(0); static const ReturnValue_t SD_NOT_MOUNTED = MAKE_RETURN_CODE(1);
//! [EXPORT] : [COMMENT] Specified file does not exist on filesystem //! [EXPORT] : [COMMENT] Specified file does not exist on filesystem
static const ReturnValue_t FILE_NOT_EXISTS = MAKE_RETURN_CODE(1); static const ReturnValue_t FILE_NOT_EXISTS = MAKE_RETURN_CODE(2);
//! [EXPORT] : [COMMENT] Specified path does not exist //! [EXPORT] : [COMMENT] Specified path does not exist
static const ReturnValue_t PATH_NOT_EXISTS = MAKE_RETURN_CODE(2); static const ReturnValue_t PATH_NOT_EXISTS = MAKE_RETURN_CODE(3);
//! [EXPORT] : [COMMENT] Failed to create download image or read flash file //! [EXPORT] : [COMMENT] Failed to create download image or read flash file
static const ReturnValue_t FILE_CREATION_FAILED = MAKE_RETURN_CODE(3); static const ReturnValue_t FILE_CREATION_FAILED = MAKE_RETURN_CODE(4);
//! [EXPORT] : [COMMENT] Region in flash write/read reply does not match expected region //! [EXPORT] : [COMMENT] Region in flash write/read reply does not match expected region
static const ReturnValue_t REGION_MISMATCH = MAKE_RETURN_CODE(4); static const ReturnValue_t REGION_MISMATCH = MAKE_RETURN_CODE(5);
//! [EXPORT] : [COMMENT] Address in flash write/read reply does not match expected address //! [EXPORT] : [COMMENT] Address in flash write/read reply does not match expected address
static const ReturnValue_t ADDRESS_MISMATCH = MAKE_RETURN_CODE(5); static const ReturnValue_t ADDRESS_MISMATCH = MAKE_RETURN_CODE(6);
//! [EXPORT] : [COMMENT] Length in flash write/read reply does not match expected length //! [EXPORT] : [COMMENT] Length in flash write/read reply does not match expected length
static const ReturnValue_t LENGTH_MISMATCH = MAKE_RETURN_CODE(6); static const ReturnValue_t LENGTH_MISMATCH = MAKE_RETURN_CODE(7);
//! [EXPORT] : [COMMENT] Status field in reply signals error //! [EXPORT] : [COMMENT] Status field in reply signals error
static const ReturnValue_t STATUS_ERROR = MAKE_RETURN_CODE(7); static const ReturnValue_t STATUS_ERROR = MAKE_RETURN_CODE(8);
//! [EXPORT] : [COMMENT] Reply has invalid type ID (should be of action reply type) //! [EXPORT] : [COMMENT] Reply has invalid type ID (should be of action reply type)
static const ReturnValue_t INVALID_TYPE_ID = MAKE_RETURN_CODE(8); static const ReturnValue_t INVALID_TYPE_ID = MAKE_RETURN_CODE(9);
static const ReturnValue_t RECEPTION_TIMEOUT = MAKE_RETURN_CODE(10);
static const ReturnValue_t DECODING_ERROR = MAKE_RETURN_CODE(11);
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::STR_HELPER; static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::STR_HELPER;
@ -77,7 +80,7 @@ class StrComHandler : public SystemObject, public DeviceCommunicationIF, public
static const Event STR_HELPER_COM_ERROR = MAKE_EVENT(10, severity::LOW); static const Event STR_HELPER_COM_ERROR = MAKE_EVENT(10, severity::LOW);
//! [EXPORT] : [COMMENT] Star tracker did not send a valid reply for a certain timeout. //! [EXPORT] : [COMMENT] Star tracker did not send a valid reply for a certain timeout.
//! P1: Position of upload or download packet for which the packet wa sent. P2: Timeout //! P1: Position of upload or download packet for which the packet wa sent. P2: Timeout
static const Event STR_HELPER_REPLY_TIMEOUT = MAKE_EVENT(11, severity::LOW); static const Event STR_COM_REPLY_TIMEOUT = MAKE_EVENT(11, severity::LOW);
//! [EXPORT] : [COMMENT] Error during decoding of received reply occurred //! [EXPORT] : [COMMENT] Error during decoding of received reply occurred
//! P1: Return value of decoding function //! P1: Return value of decoding function
//! P2: Position of upload/download packet, or address of flash write/read request //! P2: Position of upload/download packet, or address of flash write/read request
@ -186,15 +189,23 @@ class StrComHandler : public SystemObject, public DeviceCommunicationIF, public
static const size_t CONFIG_MAX_DOWNLOAD_RETRIES = 3; static const size_t CONFIG_MAX_DOWNLOAD_RETRIES = 3;
static const uint32_t FLASH_ERASE_DELAY = 500; static const uint32_t FLASH_ERASE_DELAY = 500;
enum class InternalState { IDLE, UPLOAD_IMAGE, DOWNLOAD_IMAGE, FLASH_READ, FIRMWARE_UPDATE }; enum class InternalState {
SLEEPING,
POLL_ONE_REPLY,
UPLOAD_IMAGE,
DOWNLOAD_IMAGE,
FLASH_READ,
FIRMWARE_UPDATE
};
InternalState internalState = InternalState::IDLE; InternalState state = InternalState::SLEEPING;
ArcsecDatalinkLayer datalinkLayer; ArcsecDatalinkLayer datalinkLayer;
MutexIF *lock;
BinarySemaphore semaphore; BinarySemaphore semaphore;
Countdown replyTimeout = Countdown(2000); Countdown replyTimeout = Countdown(20);
struct UploadImage { struct UploadImage {
// Name including absolute path of image to upload // Name including absolute path of image to upload
@ -239,9 +250,14 @@ class StrComHandler : public SystemObject, public DeviceCommunicationIF, public
SdCardManager *sdcMan = nullptr; SdCardManager *sdcMan = nullptr;
#endif #endif
uint8_t commandBuffer[startracker::MAX_FRAME_SIZE]; std::array<uint8_t, startracker::MAX_FRAME_SIZE> cmdBuf{};
std::array<uint8_t, 4096> recBuf{}; std::array<uint8_t, 4096> recBuf{};
bool replyWasReceived = false;
const uint8_t *replyPtr = nullptr;
size_t replyLen = 0;
ReturnValue_t replyResult = returnvalue::OK;
bool terminate = false; bool terminate = false;
#ifdef EGSE #ifdef EGSE
@ -304,22 +320,23 @@ class StrComHandler : public SystemObject, public DeviceCommunicationIF, public
/** /**
* @brief Sends packet to the star tracker and reads reply by using the communication * @brief Sends packet to the star tracker and reads reply by using the communication
* interface * interface
* * @details
* The reply frame is stored in the data link layer helper. A pointer to the start of the frame
* is assigned to the @replyPtr member of this class. The frame length will be assigned to
* the @replyLen member.
* @param size Size of data beforehand written to the commandBuffer * @param size Size of data beforehand written to the commandBuffer
* @param parameter Parameter 2 of trigger event function * @param parameter Parameter 2 of trigger event function
* @param delayMs Delay in milliseconds between send and receive call
* *
* @return returnvalue::OK if successful, otherwise returnvalue::FAILED * @return returnvalue::OK if successful, otherwise returnvalue::FAILED
*/ */
ReturnValue_t sendAndRead(size_t size, uint32_t parameter, const uint8_t **replyFrame, ReturnValue_t sendAndRead(size_t size, uint32_t parameter);
size_t &replyLen);
/** /**
* @brief Checks the header (type id and status fields) of the action reply * @brief Checks the header (type id and status fields) of the action reply
* *
* @return returnvalue::OK if reply confirms success of packet transfer, otherwise REUTRN_FAILED * @return returnvalue::OK if reply confirms success of packet transfer, otherwise REUTRN_FAILED
*/ */
ReturnValue_t checkActionReply(const uint8_t *rawFrame, size_t replySize); ReturnValue_t checkActionReply(size_t replySize);
/** /**
* @brief Checks the position field in a star tracker upload/download reply. * @brief Checks the position field in a star tracker upload/download reply.
@ -329,7 +346,7 @@ class StrComHandler : public SystemObject, public DeviceCommunicationIF, public
* @return returnvalue::OK if received position matches expected position, otherwise * @return returnvalue::OK if received position matches expected position, otherwise
* returnvalue::FAILED * returnvalue::FAILED
*/ */
ReturnValue_t checkReplyPosition(const uint8_t *rawFrame, uint32_t expectedPosition); ReturnValue_t checkReplyPosition(uint32_t expectedPosition);
#ifdef XIPHOS_Q7S #ifdef XIPHOS_Q7S
/** /**
@ -348,6 +365,15 @@ class StrComHandler : public SystemObject, public DeviceCommunicationIF, public
* *
*/ */
ReturnValue_t unlockAndEraseRegions(uint32_t from, uint32_t to); ReturnValue_t unlockAndEraseRegions(uint32_t from, uint32_t to);
/**
* The reply frame is stored in the data link layer helper. A pointer to the start of the frame
* is assigned to the @replyPtr member of this class. The frame length will be assigned to
* the @replyLen member.
* @param failParameter
* @return
*/
ReturnValue_t readOneReply(uint32_t failParameter);
}; };
#endif /* BSP_Q7S_DEVICES_STRHELPER_H_ */ #endif /* BSP_Q7S_DEVICES_STRHELPER_H_ */

View File

@ -1,6 +1,6 @@
#include "StarTrackerJsonCommands.h" #include "strJsonCommands.h"
#include "ArcsecJsonKeys.h" #include "arcsecJsonKeys.h"
Limits::Limits() : ArcsecJsonParamBase(arcseckeys::LIMITS) {} Limits::Limits() : ArcsecJsonParamBase(arcseckeys::LIMITS) {}

View File

@ -1,7 +1,7 @@
/** /**
* @brief Auto-generated event translation file. Contains 279 translations. * @brief Auto-generated event translation file. Contains 279 translations.
* @details * @details
* Generated on: 2023-03-21 23:59:36 * Generated on: 2023-03-22 01:14:08
*/ */
#include "translateEvents.h" #include "translateEvents.h"
@ -172,7 +172,7 @@ const char *FIRMWARE_UPDATE_SUCCESSFUL_STRING = "FIRMWARE_UPDATE_SUCCESSFUL";
const char *FIRMWARE_UPDATE_FAILED_STRING = "FIRMWARE_UPDATE_FAILED"; const char *FIRMWARE_UPDATE_FAILED_STRING = "FIRMWARE_UPDATE_FAILED";
const char *STR_HELPER_READING_REPLY_FAILED_STRING = "STR_HELPER_READING_REPLY_FAILED"; const char *STR_HELPER_READING_REPLY_FAILED_STRING = "STR_HELPER_READING_REPLY_FAILED";
const char *STR_HELPER_COM_ERROR_STRING = "STR_HELPER_COM_ERROR"; const char *STR_HELPER_COM_ERROR_STRING = "STR_HELPER_COM_ERROR";
const char *STR_HELPER_NO_REPLY_STRING = "STR_HELPER_NO_REPLY"; const char *STR_HELPER_REPLY_TIMEOUT_STRING = "STR_HELPER_REPLY_TIMEOUT";
const char *STR_HELPER_DEC_ERROR_STRING = "STR_HELPER_DEC_ERROR"; const char *STR_HELPER_DEC_ERROR_STRING = "STR_HELPER_DEC_ERROR";
const char *POSITION_MISMATCH_STRING = "POSITION_MISMATCH"; const char *POSITION_MISMATCH_STRING = "POSITION_MISMATCH";
const char *STR_HELPER_FILE_NOT_EXISTS_STRING = "STR_HELPER_FILE_NOT_EXISTS"; const char *STR_HELPER_FILE_NOT_EXISTS_STRING = "STR_HELPER_FILE_NOT_EXISTS";
@ -617,16 +617,16 @@ const char *translateEvents(Event event) {
case (12510): case (12510):
return STR_HELPER_COM_ERROR_STRING; return STR_HELPER_COM_ERROR_STRING;
case (12511): case (12511):
return STR_HELPER_NO_REPLY_STRING; return STR_HELPER_REPLY_TIMEOUT_STRING;
case (12512):
return STR_HELPER_DEC_ERROR_STRING;
case (12513): case (12513):
return POSITION_MISMATCH_STRING; return STR_HELPER_DEC_ERROR_STRING;
case (12514): case (12514):
return STR_HELPER_FILE_NOT_EXISTS_STRING; return POSITION_MISMATCH_STRING;
case (12515): case (12515):
return STR_HELPER_SENDING_PACKET_FAILED_STRING; return STR_HELPER_FILE_NOT_EXISTS_STRING;
case (12516): case (12516):
return STR_HELPER_SENDING_PACKET_FAILED_STRING;
case (12517):
return STR_HELPER_REQUESTING_MSG_FAILED_STRING; return STR_HELPER_REQUESTING_MSG_FAILED_STRING;
case (12600): case (12600):
return MPSOC_FLASH_WRITE_FAILED_STRING; return MPSOC_FLASH_WRITE_FAILED_STRING;

View File

@ -2,7 +2,7 @@
* @brief Auto-generated object translation file. * @brief Auto-generated object translation file.
* @details * @details
* Contains 173 translations. * Contains 173 translations.
* Generated on: 2023-03-21 23:59:36 * Generated on: 2023-03-22 01:14:08
*/ */
#include "translateObjects.h" #include "translateObjects.h"
@ -49,7 +49,7 @@ const char *PLPCDU_HANDLER_STRING = "PLPCDU_HANDLER";
const char *RAD_SENSOR_STRING = "RAD_SENSOR"; const char *RAD_SENSOR_STRING = "RAD_SENSOR";
const char *PLOC_UPDATER_STRING = "PLOC_UPDATER"; const char *PLOC_UPDATER_STRING = "PLOC_UPDATER";
const char *PLOC_MEMORY_DUMPER_STRING = "PLOC_MEMORY_DUMPER"; const char *PLOC_MEMORY_DUMPER_STRING = "PLOC_MEMORY_DUMPER";
const char *STR_HELPER_STRING = "STR_HELPER"; const char *STR_COM_IF_STRING = "STR_COM_IF";
const char *PLOC_MPSOC_HELPER_STRING = "PLOC_MPSOC_HELPER"; const char *PLOC_MPSOC_HELPER_STRING = "PLOC_MPSOC_HELPER";
const char *AXI_PTME_CONFIG_STRING = "AXI_PTME_CONFIG"; const char *AXI_PTME_CONFIG_STRING = "AXI_PTME_CONFIG";
const char *PTME_CONFIG_STRING = "PTME_CONFIG"; const char *PTME_CONFIG_STRING = "PTME_CONFIG";
@ -269,7 +269,7 @@ const char *translateObject(object_id_t object) {
case 0x44330001: case 0x44330001:
return PLOC_MEMORY_DUMPER_STRING; return PLOC_MEMORY_DUMPER_STRING;
case 0x44330002: case 0x44330002:
return STR_HELPER_STRING; return STR_COM_IF_STRING;
case 0x44330003: case 0x44330003:
return PLOC_MPSOC_HELPER_STRING; return PLOC_MPSOC_HELPER_STRING;
case 0x44330004: case 0x44330004:

View File

@ -318,11 +318,23 @@ ReturnValue_t pst::pstTcsAndAcs(FixedTimeslotTaskIF *thisSequence, AcsPstCfg cfg
} }
if (cfg.scheduleStr) { if (cfg.scheduleStr) {
// 2 COM cycles for full PST for STR. The STR requests 2 packets types in NORMAL mode, this
// ensures we always get an updated STR dataset for a regular normal mode cycle.
thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::SEND_WRITE); thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::GET_WRITE); thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::SEND_READ); thisSequence->addSlot(objects::STAR_TRACKER, length * config::spiSched::SCHED_BLOCK_2_PERIOD,
thisSequence->addSlot(objects::STAR_TRACKER, length * 0, DeviceHandlerIF::GET_READ); DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::STAR_TRACKER, length * config::spiSched::SCHED_BLOCK_2_PERIOD,
DeviceHandlerIF::GET_READ);
thisSequence->addSlot(objects::STAR_TRACKER, length * config::spiSched::SCHED_BLOCK_2_PERIOD,
DeviceHandlerIF::SEND_WRITE);
thisSequence->addSlot(objects::STAR_TRACKER, length * config::spiSched::SCHED_BLOCK_2_PERIOD,
DeviceHandlerIF::GET_WRITE);
thisSequence->addSlot(objects::STAR_TRACKER, length * config::spiSched::SCHED_BLOCK_3_PERIOD,
DeviceHandlerIF::SEND_READ);
thisSequence->addSlot(objects::STAR_TRACKER, length * config::spiSched::SCHED_BLOCK_3_PERIOD,
DeviceHandlerIF::GET_READ);
} }
bool enableAside = true; bool enableAside = true;

2
tmtc

@ -1 +1 @@
Subproject commit c171654d2b18547249ee03ace3a4016e8837cf4a Subproject commit 2263938b8b1324b309a44d70c291800050ff4178