Merge branch 'develop' into meier/ptme
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
Jakob Meier 2021-10-04 15:07:58 +02:00
commit 7f70673625
14 changed files with 71 additions and 46 deletions

View File

@ -187,9 +187,13 @@ void initmission::createPstTasks(TaskFactory& factory,
missedDeadlineFunc); missedDeadlineFunc);
result = pst::pstSpi(spiPst); result = pst::pstSpi(spiPst);
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl; if(result != FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl;
}
}
else {
taskVec.push_back(spiPst);
} }
taskVec.push_back(spiPst);
#endif #endif
FixedTimeslotTaskIF* uartPst = factory.createFixedTimeslotTask( FixedTimeslotTaskIF* uartPst = factory.createFixedTimeslotTask(

View File

@ -297,43 +297,43 @@ void ObjectFactory::createSunSensorComponents(LinuxLibgpioIF *gpioComIF, SpiComI
GpioCookie* gpioCookieSus = new GpioCookie(); GpioCookie* gpioCookieSus = new GpioCookie();
GpioCallback* susgpio = nullptr; GpioCallback* susgpio = nullptr;
susgpio = new GpioCallback("Chip select SUS 1", gpio::OUT, 1, susgpio = new GpioCallback("Chip select SUS 1", gpio::OUT, gpio::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF); &gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_1, susgpio); gpioCookieSus->addGpio(gpioIds::CS_SUS_1, susgpio);
susgpio = new GpioCallback("Chip select SUS 2", gpio::OUT, 1, susgpio = new GpioCallback("Chip select SUS 2", gpio::OUT, gpio::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF); &gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_2, susgpio); gpioCookieSus->addGpio(gpioIds::CS_SUS_2, susgpio);
susgpio = new GpioCallback("Chip select SUS 3", gpio::OUT, 1, susgpio = new GpioCallback("Chip select SUS 3", gpio::OUT, gpio::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF); &gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_3, susgpio); gpioCookieSus->addGpio(gpioIds::CS_SUS_3, susgpio);
susgpio = new GpioCallback("Chip select SUS 4", gpio::OUT, 1, susgpio = new GpioCallback("Chip select SUS 4", gpio::OUT, gpio::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF); &gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_4, susgpio); gpioCookieSus->addGpio(gpioIds::CS_SUS_4, susgpio);
susgpio = new GpioCallback("Chip select SUS 5", gpio::OUT, 1, susgpio = new GpioCallback("Chip select SUS 5", gpio::OUT, gpio::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF); &gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_5, susgpio); gpioCookieSus->addGpio(gpioIds::CS_SUS_5, susgpio);
susgpio = new GpioCallback("Chip select SUS 6", gpio::OUT, 1, susgpio = new GpioCallback("Chip select SUS 6", gpio::OUT, gpio::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF); &gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_6, susgpio); gpioCookieSus->addGpio(gpioIds::CS_SUS_6, susgpio);
susgpio = new GpioCallback("Chip select SUS 7", gpio::OUT, 1, susgpio = new GpioCallback("Chip select SUS 7", gpio::OUT, gpio::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF); &gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_7, susgpio); gpioCookieSus->addGpio(gpioIds::CS_SUS_7, susgpio);
susgpio = new GpioCallback("Chip select SUS 8", gpio::OUT, 1, susgpio = new GpioCallback("Chip select SUS 8", gpio::OUT, gpio::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF); &gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_8, susgpio); gpioCookieSus->addGpio(gpioIds::CS_SUS_8, susgpio);
susgpio = new GpioCallback("Chip select SUS 9", gpio::OUT, 1, susgpio = new GpioCallback("Chip select SUS 9", gpio::OUT, gpio::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF); &gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_9, susgpio); gpioCookieSus->addGpio(gpioIds::CS_SUS_9, susgpio);
susgpio = new GpioCallback("Chip select SUS 10", gpio::OUT, 1, susgpio = new GpioCallback("Chip select SUS 10", gpio::OUT, gpio::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF); &gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_10, susgpio); gpioCookieSus->addGpio(gpioIds::CS_SUS_10, susgpio);
susgpio = new GpioCallback("Chip select SUS 11", gpio::OUT, 1, susgpio = new GpioCallback("Chip select SUS 11", gpio::OUT, gpio::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF); &gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_11, susgpio); gpioCookieSus->addGpio(gpioIds::CS_SUS_11, susgpio);
susgpio = new GpioCallback("Chip select SUS 12", gpio::OUT, 1, susgpio = new GpioCallback("Chip select SUS 12", gpio::OUT, gpio::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF); &gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_12, susgpio); gpioCookieSus->addGpio(gpioIds::CS_SUS_12, susgpio);
susgpio = new GpioCallback("Chip select SUS 13", gpio::OUT, 1, susgpio = new GpioCallback("Chip select SUS 13", gpio::OUT, gpio::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF); &gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_13, susgpio); gpioCookieSus->addGpio(gpioIds::CS_SUS_13, susgpio);
@ -413,7 +413,8 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI
std::stringstream consumer; std::stringstream consumer;
GpiodRegularByLineName* gpio = nullptr; GpiodRegularByLineName* gpio = nullptr;
consumer << "0x" << std::hex << objects::GYRO_0_ADIS_HANDLER; consumer << "0x" << std::hex << objects::GYRO_0_ADIS_HANDLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ADIS_CS, consumer.str(), gpio::OUT, gpio::HIGH); gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ADIS_CS, consumer.str(),
gpio::OUT, gpio::HIGH);
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_0_ADIS_CS, gpio); gpioCookieAcsBoard->addGpio(gpioIds::GYRO_0_ADIS_CS, gpio);
consumer.str(""); consumer.str("");
@ -869,19 +870,31 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF) {
auto rwHandler1 = new RwHandler(objects::RW1, objects::SPI_COM_IF, rw1SpiCookie, gpioComIF, auto rwHandler1 = new RwHandler(objects::RW1, objects::SPI_COM_IF, rw1SpiCookie, gpioComIF,
gpioIds::EN_RW1); gpioIds::EN_RW1);
#if OBSW_DEBUG_RW == 1
rwHandler1->setStartUpImmediately();
#endif
rw1SpiCookie->setCallbackArgs(rwHandler1); rw1SpiCookie->setCallbackArgs(rwHandler1);
rwHandler1->setStartUpImmediately(); rwHandler1->setStartUpImmediately();
auto rwHandler2 = new RwHandler(objects::RW2, objects::SPI_COM_IF, rw2SpiCookie, gpioComIF, auto rwHandler2 = new RwHandler(objects::RW2, objects::SPI_COM_IF, rw2SpiCookie, gpioComIF,
gpioIds::EN_RW2); gpioIds::EN_RW2);
#if OBSW_DEBUG_RW == 1
rwHandler2->setStartUpImmediately();
#endif
rw2SpiCookie->setCallbackArgs(rwHandler2); rw2SpiCookie->setCallbackArgs(rwHandler2);
auto rwHandler3 = new RwHandler(objects::RW3, objects::SPI_COM_IF, rw3SpiCookie, gpioComIF, auto rwHandler3 = new RwHandler(objects::RW3, objects::SPI_COM_IF, rw3SpiCookie, gpioComIF,
gpioIds::EN_RW3); gpioIds::EN_RW3);
#if OBSW_DEBUG_RW == 1
rwHandler3->setStartUpImmediately();
#endif
rw3SpiCookie->setCallbackArgs(rwHandler3); rw3SpiCookie->setCallbackArgs(rwHandler3);
auto rwHandler4 = new RwHandler(objects::RW4, objects::SPI_COM_IF, rw4SpiCookie, gpioComIF, auto rwHandler4 = new RwHandler(objects::RW4, objects::SPI_COM_IF, rw4SpiCookie, gpioComIF,
gpioIds::EN_RW4); gpioIds::EN_RW4);
#if OBSW_DEBUG_RW == 1
rwHandler4->setStartUpImmediately();
#endif
rw4SpiCookie->setCallbackArgs(rwHandler4); rw4SpiCookie->setCallbackArgs(rwHandler4);
} }

View File

@ -53,7 +53,7 @@ void initSpiCsDecoder(GpioIF* gpioComIF) {
} }
} }
void spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp, int value, void spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp, gpio::Levels value,
void* args) { void* args) {
if (gpioComInterface == nullptr) { if (gpioComInterface == nullptr) {
@ -67,10 +67,10 @@ void spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp, int value
return; return;
} }
if (value == 1) { if (value == gpio::HIGH) {
disableAllDecoder(); disableAllDecoder();
} }
else if (value == 0) { else if (value == gpio::LOW) {
switch (gpioId) { switch (gpioId) {
case(gpioIds::RTD_IC3): { case(gpioIds::RTD_IC3): {
enableDecoderTcsIc1(); enableDecoderTcsIc1();

View File

@ -17,7 +17,8 @@ namespace gpioCallbacks {
* @brief This function implements the decoding to multiply gpios by using the decoder * @brief This function implements the decoding to multiply gpios by using the decoder
* chips SN74LVC138APWR on the TCS board and the interface board. * chips SN74LVC138APWR on the TCS board and the interface board.
*/ */
void spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp, int value, void* args); void spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp,
gpio::Levels value, void* args);
/** /**
* @brief This function sets mux bits 1-3 to a state which will only enable the decoder * @brief This function sets mux bits 1-3 to a state which will only enable the decoder

View File

@ -4,7 +4,7 @@
const char* const SW_NAME = "eive"; const char* const SW_NAME = "eive";
#define SW_VERSION 1 #define SW_VERSION 1
#define SW_SUBVERSION 7 #define SW_SUBVERSION 8
#define SW_REVISION 0 #define SW_REVISION 0
#endif /* COMMON_CONFIG_OBSWVERSION_H_ */ #endif /* COMMON_CONFIG_OBSWVERSION_H_ */

View File

@ -7,8 +7,6 @@
namespace CLASS_ID { namespace CLASS_ID {
enum commonClassIds: uint8_t { enum commonClassIds: uint8_t {
COMMON_CLASS_ID_START = FW_CLASS_ID_COUNT, COMMON_CLASS_ID_START = FW_CLASS_ID_COUNT,
MGM_LIS3MDL, //MGMLIS3
MGM_RM3100, //MGMRM3100
PCDU_HANDLER, //PCDU PCDU_HANDLER, //PCDU
HEATER_HANDLER, //HEATER HEATER_HANDLER, //HEATER
SYRLINKS_HANDLER, //SYRLINKS SYRLINKS_HANDLER, //SYRLINKS

View File

@ -6,8 +6,6 @@
namespace SUBSYSTEM_ID { namespace SUBSYSTEM_ID {
enum: uint8_t { enum: uint8_t {
COMMON_SUBSYSTEM_ID_START = FW_SUBSYSTEM_ID_RANGE, COMMON_SUBSYSTEM_ID_START = FW_SUBSYSTEM_ID_RANGE,
MGM_LIS3MDL = 106,
MGM_RM3100 = 107,
PCDU_HANDLER = 108, PCDU_HANDLER = 108,
HEATER_HANDLER = 109, HEATER_HANDLER = 109,
SA_DEPL_HANDLER = 110, SA_DEPL_HANDLER = 110,

2
fsfw

@ -1 +1 @@
Subproject commit 16b125ef6cdfbe1349e5b21b783cd72c871372a8 Subproject commit a84c770dfb8447325c263da42d5cecd99b38d1f0

View File

@ -72,7 +72,7 @@ static constexpr size_t FSFW_MAX_TM_PACKET_SIZE = 2048;
} }
#define FSFW_HAL_LINUX_SPI_WIRETAPPING 0 #define FSFW_HAL_SPI_WIRETAPPING 0
#define FSFW_DEV_HYPERION_GPS_CREATE_NMEA_CSV 0 #define FSFW_DEV_HYPERION_GPS_CREATE_NMEA_CSV 0
#define FSFW_HAL_L3GD20_GYRO_DEBUG 0 #define FSFW_HAL_L3GD20_GYRO_DEBUG 0

View File

@ -536,9 +536,16 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) {
} }
#endif /* OBSW_ADD_ACS_BOARD == 1 */ #endif /* OBSW_ADD_ACS_BOARD == 1 */
if (thisSequence->checkSequence() != HasReturnvaluesIF::RETURN_OK) { ReturnValue_t seqCheck = thisSequence->checkSequence();
sif::error << "SPI PST initialization failed" << std::endl; if (seqCheck != HasReturnvaluesIF::RETURN_OK) {
return HasReturnvaluesIF::RETURN_FAILED; if(seqCheck == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
sif::warning << "SPI PST is empty.." << std::endl;
}
else {
sif::error << "SPI PST initialization failed" << std::endl;
}
return seqCheck;
} }
return HasReturnvaluesIF::RETURN_OK; return HasReturnvaluesIF::RETURN_OK;
} }

View File

@ -60,10 +60,8 @@ ReturnValue_t GPSHyperionHandler::buildCommandFromCommand(
PoolReadGuard pg(&gpsSet); PoolReadGuard pg(&gpsSet);
// Set HK entries invalid // Set HK entries invalid
gpsSet.setValidity(false, true); gpsSet.setValidity(false, true);
// The user needs to implement this. Don't touch states for now, the device should resetCallback(resetCallbackArgs);
// quickly reboot and send valid strings again. return HasActionsIF::EXECUTION_FINISHED;
actionHelper.finish(true, getCommanderQueueId(deviceCommand), deviceCommand);
return resetCallback(resetCallbackArgs);
} }
return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED; return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED;
} }
@ -210,3 +208,7 @@ ReturnValue_t GPSHyperionHandler::initialize() {
// Enable reply immediately for now // Enable reply immediately for now
return updatePeriodicReply(true, GpsHyperion::GPS_REPLY); return updatePeriodicReply(true, GpsHyperion::GPS_REPLY);
} }
ReturnValue_t GPSHyperionHandler::acceptExternalDeviceCommands() {
return DeviceHandlerBase::acceptExternalDeviceCommands();
}

View File

@ -22,6 +22,7 @@ public:
using gpioResetFunction_t = ReturnValue_t (*) (void* args); using gpioResetFunction_t = ReturnValue_t (*) (void* args);
void setResetPinTriggerFunction(gpioResetFunction_t resetCallback, void*args); void setResetPinTriggerFunction(gpioResetFunction_t resetCallback, void*args);
ReturnValue_t acceptExternalDeviceCommands() override;
ReturnValue_t initialize() override; ReturnValue_t initialize() override;
protected: protected:

View File

@ -441,7 +441,7 @@ ReturnValue_t GyroADIS16507Handler::spiSendCallback(SpiComIF *comIf, SpiCookie *
utility::handleIoctlError("SpiComIF::sendMessage: ioctl error."); utility::handleIoctlError("SpiComIF::sendMessage: ioctl error.");
result = SpiComIF::FULL_DUPLEX_TRANSFER_FAILED; result = SpiComIF::FULL_DUPLEX_TRANSFER_FAILED;
} }
#if FSFW_HAL_LINUX_SPI_WIRETAPPING == 1 #if FSFW_HAL_SPI_WIRETAPPING == 1
comIf->performSpiWiretapping(cookie); comIf->performSpiWiretapping(cookie);
#endif /* FSFW_LINUX_SPI_WIRETAPPING == 1 */ #endif /* FSFW_LINUX_SPI_WIRETAPPING == 1 */

View File

@ -144,47 +144,48 @@ void RwHandler::fillCommandAndReplyMap() {
ReturnValue_t RwHandler::scanForReply(const uint8_t *start, size_t remainingSize, ReturnValue_t RwHandler::scanForReply(const uint8_t *start, size_t remainingSize,
DeviceCommandId_t *foundId, size_t *foundLen) { DeviceCommandId_t *foundId, size_t *foundLen) {
uint8_t replyByte = *start;
switch (*(start)) { switch (replyByte) {
case (static_cast<uint8_t>(RwDefinitions::GET_LAST_RESET_STATUS)): { case (RwDefinitions::GET_LAST_RESET_STATUS): {
*foundLen = RwDefinitions::SIZE_GET_RESET_STATUS; *foundLen = RwDefinitions::SIZE_GET_RESET_STATUS;
*foundId = RwDefinitions::GET_LAST_RESET_STATUS; *foundId = RwDefinitions::GET_LAST_RESET_STATUS;
break; break;
} }
case (static_cast<uint8_t>(RwDefinitions::CLEAR_LAST_RESET_STATUS)): { case (RwDefinitions::CLEAR_LAST_RESET_STATUS): {
*foundLen = RwDefinitions::SIZE_CLEAR_RESET_STATUS; *foundLen = RwDefinitions::SIZE_CLEAR_RESET_STATUS;
*foundId = RwDefinitions::CLEAR_LAST_RESET_STATUS; *foundId = RwDefinitions::CLEAR_LAST_RESET_STATUS;
break; break;
} }
case (static_cast<uint8_t>(RwDefinitions::GET_RW_STATUS)): { case (RwDefinitions::GET_RW_STATUS): {
*foundLen = RwDefinitions::SIZE_GET_RW_STATUS; *foundLen = RwDefinitions::SIZE_GET_RW_STATUS;
*foundId = RwDefinitions::GET_RW_STATUS; *foundId = RwDefinitions::GET_RW_STATUS;
break; break;
} }
case (static_cast<uint8_t>(RwDefinitions::INIT_RW_CONTROLLER)): { case (RwDefinitions::INIT_RW_CONTROLLER): {
*foundLen = RwDefinitions::SIZE_INIT_RW; *foundLen = RwDefinitions::SIZE_INIT_RW;
*foundId = RwDefinitions::INIT_RW_CONTROLLER; *foundId = RwDefinitions::INIT_RW_CONTROLLER;
break; break;
} }
case (static_cast<uint8_t>(RwDefinitions::SET_SPEED)): { case (RwDefinitions::SET_SPEED): {
*foundLen = RwDefinitions::SIZE_SET_SPEED_REPLY; *foundLen = RwDefinitions::SIZE_SET_SPEED_REPLY;
*foundId = RwDefinitions::SET_SPEED; *foundId = RwDefinitions::SET_SPEED;
break; break;
} }
case (static_cast<uint8_t>(RwDefinitions::GET_TEMPERATURE)): { case (RwDefinitions::GET_TEMPERATURE): {
*foundLen = RwDefinitions::SIZE_GET_TEMPERATURE_REPLY; *foundLen = RwDefinitions::SIZE_GET_TEMPERATURE_REPLY;
*foundId = RwDefinitions::GET_TEMPERATURE; *foundId = RwDefinitions::GET_TEMPERATURE;
break; break;
} }
case (static_cast<uint8_t>(RwDefinitions::GET_TM)): { case (RwDefinitions::GET_TM): {
*foundLen = RwDefinitions::SIZE_GET_TELEMETRY_REPLY; *foundLen = RwDefinitions::SIZE_GET_TELEMETRY_REPLY;
*foundId = RwDefinitions::GET_TM; *foundId = RwDefinitions::GET_TM;
break; break;
} }
default: { default: {
sif::debug << "RwHandler::scanForReply: Reply contains invalid command code" << std::endl; sif::warning << "RwHandler::scanForReply: Reply contains invalid command code" <<
std::endl;
*foundLen = remainingSize;
return RETURN_FAILED; return RETURN_FAILED;
break;
} }
} }