Merge remote-tracking branch 'origin/develop' into mueller/pdec_irq_handling
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
This commit is contained in:
commit
115c6a6a57
@ -98,9 +98,30 @@ set(OBSW_ADD_ACS_BOARD
|
|||||||
set(OBSW_ADD_GPS_CTRL
|
set(OBSW_ADD_GPS_CTRL
|
||||||
${INIT_VAL}
|
${INIT_VAL}
|
||||||
CACHE STRING "Add GPS controllers")
|
CACHE STRING "Add GPS controllers")
|
||||||
|
set(OBSW_ADD_CCSDS_IP_CORES
|
||||||
|
1
|
||||||
|
CACHE STRING "Add CCSDS IP cores")
|
||||||
|
set(OBSW_TM_TO_PTME
|
||||||
|
1
|
||||||
|
CACHE STRING "Send telemetry to PTME IP core")
|
||||||
|
set(OBSW_TC_FROM_PDEC
|
||||||
|
1
|
||||||
|
CACHE STRING "Poll telecommand from PDEC IP core")
|
||||||
set(OBSW_ADD_TCS_CTRL
|
set(OBSW_ADD_TCS_CTRL
|
||||||
${INIT_VAL}
|
${INIT_VAL}
|
||||||
CACHE STRING "Add TCS controllers")
|
CACHE STRING "Add TCS controllers")
|
||||||
|
set(OBSW_ADD_HEATERS
|
||||||
|
${INIT_VAL}
|
||||||
|
CACHE STRING "Add TCS heaters")
|
||||||
|
set(OBSW_ADD_PLOC_SUPERVISOR
|
||||||
|
${INIT_VAL}
|
||||||
|
CACHE STRING "Add PLOC supervisor handler")
|
||||||
|
set(OBSW_ADD_SA_DEPL
|
||||||
|
${INIT_VAL}
|
||||||
|
CACHE STRING "Add SA deployment handler")
|
||||||
|
set(OBSW_ADD_PLOC_MPSOC
|
||||||
|
${INIT_VAL}
|
||||||
|
CACHE STRING "Add MPSoC handler")
|
||||||
set(OBSW_ADD_ACS_CTRL
|
set(OBSW_ADD_ACS_CTRL
|
||||||
${INIT_VAL}
|
${INIT_VAL}
|
||||||
CACHE STRING "Add ACS controller")
|
CACHE STRING "Add ACS controller")
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
debugging. */
|
debugging. */
|
||||||
#define OBSW_VEBOSE_LEVEL 1
|
#define OBSW_VEBOSE_LEVEL 1
|
||||||
|
|
||||||
#define OBSW_USE_CCSDS_IP_CORE 0
|
#define OBSW_ADD_CCSDS_IP_CORES 0
|
||||||
// Set to 1 if all telemetry should be sent to the PTME IP Core
|
// Set to 1 if all telemetry should be sent to the PTME IP Core
|
||||||
#define OBSW_TM_TO_PTME 0
|
#define OBSW_TM_TO_PTME 0
|
||||||
// Set to 1 if telecommands are received via the PDEC IP Core
|
// Set to 1 if telecommands are received via the PDEC IP Core
|
||||||
|
@ -103,7 +103,7 @@
|
|||||||
/*******************************************************************/
|
/*******************************************************************/
|
||||||
#cmakedefine EIVE_BUILD_GPSD_GPS_HANDLER
|
#cmakedefine EIVE_BUILD_GPSD_GPS_HANDLER
|
||||||
|
|
||||||
#define OBSW_USE_CCSDS_IP_CORE 0
|
#define OBSW_ADD_CCSDS_IP_CORES 0
|
||||||
// Set to 1 if all telemetry should be sent to the PTME IP Core
|
// Set to 1 if all telemetry should be sent to the PTME IP Core
|
||||||
#define OBSW_TM_TO_PTME 0
|
#define OBSW_TM_TO_PTME 0
|
||||||
// Set to 1 if telecommands are received via the PDEC IP Core
|
// Set to 1 if telecommands are received via the PDEC IP Core
|
||||||
|
@ -14,18 +14,12 @@
|
|||||||
/** All of the following flags should be enabled for mission code */
|
/** All of the following flags should be enabled for mission code */
|
||||||
/*******************************************************************/
|
/*******************************************************************/
|
||||||
|
|
||||||
#define OBSW_USE_CCSDS_IP_CORE 1
|
|
||||||
// Set to 1 if all telemetry should be sent to the PTME IP Core
|
|
||||||
#define OBSW_TM_TO_PTME 0
|
|
||||||
// Set to 1 if telecommands are received via the PDEC IP Core
|
|
||||||
#define OBSW_TC_FROM_PDEC 0
|
|
||||||
|
|
||||||
#define OBSW_ADD_GOMSPACE_PCDU @OBSW_ADD_GOMSPACE_PCDU@
|
#define OBSW_ADD_GOMSPACE_PCDU @OBSW_ADD_GOMSPACE_PCDU@
|
||||||
#define OBSW_ADD_MGT @OBSW_ADD_MGT@
|
#define OBSW_ADD_MGT @OBSW_ADD_MGT@
|
||||||
#define OBSW_ADD_BPX_BATTERY_HANDLER @OBSW_ADD_BPX_BATTERY_HANDLER@
|
#define OBSW_ADD_BPX_BATTERY_HANDLER @OBSW_ADD_BPX_BATTERY_HANDLER@
|
||||||
#define OBSW_ADD_STAR_TRACKER @OBSW_ADD_STAR_TRACKER@
|
#define OBSW_ADD_STAR_TRACKER @OBSW_ADD_STAR_TRACKER@
|
||||||
#define OBSW_ADD_PLOC_SUPERVISOR 1
|
#define OBSW_ADD_PLOC_SUPERVISOR @OBSW_ADD_PLOC_SUPERVISOR@
|
||||||
#define OBSW_ADD_PLOC_MPSOC 1
|
#define OBSW_ADD_PLOC_MPSOC @OBSW_ADD_PLOC_MPSOC@
|
||||||
#define OBSW_ADD_SUN_SENSORS @OBSW_ADD_SUN_SENSORS@
|
#define OBSW_ADD_SUN_SENSORS @OBSW_ADD_SUN_SENSORS@
|
||||||
#define OBSW_ADD_SUS_BOARD_ASS @OBSW_ADD_SUS_BOARD_ASS@
|
#define OBSW_ADD_SUS_BOARD_ASS @OBSW_ADD_SUS_BOARD_ASS@
|
||||||
#define OBSW_ADD_ACS_BOARD @OBSW_ADD_ACS_BOARD@
|
#define OBSW_ADD_ACS_BOARD @OBSW_ADD_ACS_BOARD@
|
||||||
@ -34,11 +28,18 @@
|
|||||||
#define OBSW_ADD_TCS_CTRL @OBSW_ADD_TCS_CTRL@
|
#define OBSW_ADD_TCS_CTRL @OBSW_ADD_TCS_CTRL@
|
||||||
#define OBSW_ADD_RW @OBSW_ADD_RW@
|
#define OBSW_ADD_RW @OBSW_ADD_RW@
|
||||||
#define OBSW_ADD_RTD_DEVICES @OBSW_ADD_RTD_DEVICES@
|
#define OBSW_ADD_RTD_DEVICES @OBSW_ADD_RTD_DEVICES@
|
||||||
|
#define OBSW_ADD_SA_DEPL @OBSW_ADD_SA_DEPL@
|
||||||
#define OBSW_ADD_SCEX_DEVICE @OBSW_ADD_SCEX_DEVICE@
|
#define OBSW_ADD_SCEX_DEVICE @OBSW_ADD_SCEX_DEVICE@
|
||||||
|
#define OBSW_ADD_HEATERS @OBSW_ADD_HEATERS@
|
||||||
#define OBSW_ADD_TMP_DEVICES @OBSW_ADD_TMP_DEVICES@
|
#define OBSW_ADD_TMP_DEVICES @OBSW_ADD_TMP_DEVICES@
|
||||||
#define OBSW_ADD_RAD_SENSORS @OBSW_ADD_RAD_SENSORS@
|
#define OBSW_ADD_RAD_SENSORS @OBSW_ADD_RAD_SENSORS@
|
||||||
#define OBSW_ADD_PL_PCDU @OBSW_ADD_PL_PCDU@
|
#define OBSW_ADD_PL_PCDU @OBSW_ADD_PL_PCDU@
|
||||||
#define OBSW_ADD_SYRLINKS @OBSW_ADD_SYRLINKS@
|
#define OBSW_ADD_SYRLINKS @OBSW_ADD_SYRLINKS@
|
||||||
|
#define OBSW_ADD_CCSDS_IP_CORES @OBSW_ADD_CCSDS_IP_CORES@
|
||||||
|
// Set to 1 if all telemetry should be sent to the PTME IP Core
|
||||||
|
#define OBSW_TM_TO_PTME @OBSW_TM_TO_PTME@
|
||||||
|
// Set to 1 if telecommands are received via the PDEC IP Core
|
||||||
|
#define OBSW_TC_FROM_PDEC @OBSW_TC_FROM_PDEC@
|
||||||
#define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0
|
#define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0
|
||||||
|
|
||||||
// Configuration parameter which causes the core controller to try to keep at least one SD card
|
// Configuration parameter which causes the core controller to try to keep at least one SD card
|
||||||
|
@ -75,8 +75,10 @@ ReturnValue_t Q7STestTask::performOneShotAction() {
|
|||||||
if (doTestProtHandler) {
|
if (doTestProtHandler) {
|
||||||
testProtHandler();
|
testProtHandler();
|
||||||
}
|
}
|
||||||
FsOpCodes opCode = FsOpCodes::CREATE_EMPTY_FILE_IN_TMP;
|
if (DO_TEST_FS_HANDLER) {
|
||||||
testFileSystemHandlerDirect(opCode);
|
FsOpCodes opCode = FsOpCodes::CREATE_EMPTY_FILE_IN_TMP;
|
||||||
|
testFileSystemHandlerDirect(opCode);
|
||||||
|
}
|
||||||
return TestTask::performOneShotAction();
|
return TestTask::performOneShotAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ class Q7STestTask : public TestTask {
|
|||||||
bool doTestScratchApi = false;
|
bool doTestScratchApi = false;
|
||||||
static constexpr bool DO_TEST_GOMSPACE_API = false;
|
static constexpr bool DO_TEST_GOMSPACE_API = false;
|
||||||
static constexpr bool DO_TEST_GOMSPACE_GET_CONFIG = false;
|
static constexpr bool DO_TEST_GOMSPACE_GET_CONFIG = false;
|
||||||
|
static constexpr bool DO_TEST_FS_HANDLER = false;
|
||||||
bool doTestGpsShm = false;
|
bool doTestGpsShm = false;
|
||||||
bool doTestGpsSocket = false;
|
bool doTestGpsSocket = false;
|
||||||
bool doTestProtHandler = false;
|
bool doTestProtHandler = false;
|
||||||
|
@ -41,19 +41,19 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
|
|||||||
uint8_t writeSize = 0;
|
uint8_t writeSize = 0;
|
||||||
|
|
||||||
gpioId_t gpioId = cookie->getChipSelectPin();
|
gpioId_t gpioId = cookie->getChipSelectPin();
|
||||||
GpioIF* gpioIF = comIf->getGpioInterface();
|
GpioIF& gpioIF = comIf->getGpioInterface();
|
||||||
MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING;
|
MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING;
|
||||||
uint32_t timeoutMs = 0;
|
uint32_t timeoutMs = 0;
|
||||||
MutexIF* mutex = comIf->getCsMutex();
|
MutexIF* mutex = comIf->getCsMutex();
|
||||||
cookie->getMutexParams(timeoutType, timeoutMs);
|
cookie->getMutexParams(timeoutType, timeoutMs);
|
||||||
if (mutex == nullptr or gpioIF == nullptr) {
|
if (mutex == nullptr) {
|
||||||
sif::debug << "rwSpiCallback::spiCallback: Mutex or GPIO interface invalid" << std::endl;
|
sif::debug << "rwSpiCallback::spiCallback: Mutex or GPIO interface invalid" << std::endl;
|
||||||
return returnvalue::FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
int fileDescriptor = 0;
|
int fileDescriptor = 0;
|
||||||
const std::string& dev = comIf->getSpiDev();
|
const std::string& dev = comIf->getSpiDev();
|
||||||
result = openSpi(dev, O_RDWR, gpioIF, gpioId, mutex, timeoutType, timeoutMs, fileDescriptor);
|
result = openSpi(dev, O_RDWR, &gpioIF, gpioId, mutex, timeoutType, timeoutMs, fileDescriptor);
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -75,7 +75,7 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
|
|||||||
|
|
||||||
if (write(fileDescriptor, writeBuffer, writeSize) != static_cast<ssize_t>(writeSize)) {
|
if (write(fileDescriptor, writeBuffer, writeSize) != static_cast<ssize_t>(writeSize)) {
|
||||||
sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl;
|
sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl;
|
||||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
closeSpi(fileDescriptor, gpioId, &gpioIF, mutex);
|
||||||
return RwHandler::SPI_WRITE_FAILURE;
|
return RwHandler::SPI_WRITE_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
|
|||||||
}
|
}
|
||||||
if (write(fileDescriptor, writeBuffer, writeSize) != static_cast<ssize_t>(writeSize)) {
|
if (write(fileDescriptor, writeBuffer, writeSize) != static_cast<ssize_t>(writeSize)) {
|
||||||
sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl;
|
sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl;
|
||||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
closeSpi(fileDescriptor, gpioId, &gpioIF, mutex);
|
||||||
return RwHandler::SPI_WRITE_FAILURE;
|
return RwHandler::SPI_WRITE_FAILURE;
|
||||||
}
|
}
|
||||||
idx++;
|
idx++;
|
||||||
@ -112,14 +112,14 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
|
|||||||
|
|
||||||
if (write(fileDescriptor, writeBuffer, writeSize) != static_cast<ssize_t>(writeSize)) {
|
if (write(fileDescriptor, writeBuffer, writeSize) != static_cast<ssize_t>(writeSize)) {
|
||||||
sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl;
|
sif::error << "rwSpiCallback::spiCallback: Write failed!" << std::endl;
|
||||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
closeSpi(fileDescriptor, gpioId, &gpioIF, mutex);
|
||||||
return RwHandler::SPI_WRITE_FAILURE;
|
return RwHandler::SPI_WRITE_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t* rxBuf = nullptr;
|
uint8_t* rxBuf = nullptr;
|
||||||
result = comIf->getReadBuffer(cookie->getSpiAddress(), &rxBuf);
|
result = comIf->getReadBuffer(cookie->getSpiAddress(), &rxBuf);
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
closeSpi(fileDescriptor, gpioId, &gpioIF, mutex);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,9 +127,9 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
|
|||||||
|
|
||||||
// There must be a delay of at least 20 ms after sending the command.
|
// There must be a delay of at least 20 ms after sending the command.
|
||||||
// Delay for 70 ms here and release the SPI bus for that duration.
|
// Delay for 70 ms here and release the SPI bus for that duration.
|
||||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
closeSpi(fileDescriptor, gpioId, &gpioIF, mutex);
|
||||||
usleep(RwDefinitions::SPI_REPLY_DELAY);
|
usleep(RwDefinitions::SPI_REPLY_DELAY);
|
||||||
result = openSpi(dev, O_RDWR, gpioIF, gpioId, mutex, timeoutType, timeoutMs, fileDescriptor);
|
result = openSpi(dev, O_RDWR, &gpioIF, gpioId, mutex, timeoutType, timeoutMs, fileDescriptor);
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -142,13 +142,13 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
|
|||||||
for (int idx = 0; idx < 10; idx++) {
|
for (int idx = 0; idx < 10; idx++) {
|
||||||
if (read(fileDescriptor, &byteRead, 1) != 1) {
|
if (read(fileDescriptor, &byteRead, 1) != 1) {
|
||||||
sif::error << "rwSpiCallback::spiCallback: Read failed" << std::endl;
|
sif::error << "rwSpiCallback::spiCallback: Read failed" << std::endl;
|
||||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
closeSpi(fileDescriptor, gpioId, &gpioIF, mutex);
|
||||||
return RwHandler::SPI_READ_FAILURE;
|
return RwHandler::SPI_READ_FAILURE;
|
||||||
}
|
}
|
||||||
if (idx == 0) {
|
if (idx == 0) {
|
||||||
if (byteRead != FLAG_BYTE) {
|
if (byteRead != FLAG_BYTE) {
|
||||||
sif::error << "Invalid data, expected start marker" << std::endl;
|
sif::error << "Invalid data, expected start marker" << std::endl;
|
||||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
closeSpi(fileDescriptor, gpioId, &gpioIF, mutex);
|
||||||
return RwHandler::NO_START_MARKER;
|
return RwHandler::NO_START_MARKER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -159,7 +159,7 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
|
|||||||
|
|
||||||
if (idx == 9) {
|
if (idx == 9) {
|
||||||
sif::error << "rwSpiCallback::spiCallback: Empty frame timeout" << std::endl;
|
sif::error << "rwSpiCallback::spiCallback: Empty frame timeout" << std::endl;
|
||||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
closeSpi(fileDescriptor, gpioId, &gpioIF, mutex);
|
||||||
return RwHandler::NO_REPLY;
|
return RwHandler::NO_REPLY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -199,7 +199,7 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
|
|||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
sif::error << "rwSpiCallback::spiCallback: Invalid substitute" << std::endl;
|
sif::error << "rwSpiCallback::spiCallback: Invalid substitute" << std::endl;
|
||||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
closeSpi(fileDescriptor, gpioId, &gpioIF, mutex);
|
||||||
result = RwHandler::INVALID_SUBSTITUTE;
|
result = RwHandler::INVALID_SUBSTITUTE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -233,7 +233,7 @@ ReturnValue_t spiCallback(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sen
|
|||||||
|
|
||||||
cookie->setTransferSize(decodedFrameLen);
|
cookie->setTransferSize(decodedFrameLen);
|
||||||
|
|
||||||
closeSpi(fileDescriptor, gpioId, gpioIF, mutex);
|
closeSpi(fileDescriptor, gpioId, &gpioIF, mutex);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -82,6 +82,12 @@ void CoreController::performControlOperation() {
|
|||||||
sdStateMachine();
|
sdStateMachine();
|
||||||
performMountedSdCardOperations();
|
performMountedSdCardOperations();
|
||||||
if (sdCardCheckCd.hasTimedOut()) {
|
if (sdCardCheckCd.hasTimedOut()) {
|
||||||
|
if (shortSdCardCdCounter < 2) {
|
||||||
|
shortSdCardCdCounter++;
|
||||||
|
}
|
||||||
|
if (shortSdCardCdCounter == 2) {
|
||||||
|
sdCardCheckCd.setTimeout(DEFAULT_SD_CARD_CHECK_TIMEOUT);
|
||||||
|
}
|
||||||
performSdCardCheck();
|
performSdCardCheck();
|
||||||
sdCardCheckCd.resetTimer();
|
sdCardCheckCd.resetTimer();
|
||||||
}
|
}
|
||||||
|
@ -70,6 +70,9 @@ class CoreController : public ExtendedControllerBase {
|
|||||||
static constexpr char CHIP_1_COPY_0_MOUNT_DIR[] = "/tmp/mntupdate-xdi-qspi1-nom-rootfs";
|
static constexpr char CHIP_1_COPY_0_MOUNT_DIR[] = "/tmp/mntupdate-xdi-qspi1-nom-rootfs";
|
||||||
static constexpr char CHIP_1_COPY_1_MOUNT_DIR[] = "/tmp/mntupdate-xdi-qspi1-gold-rootfs";
|
static constexpr char CHIP_1_COPY_1_MOUNT_DIR[] = "/tmp/mntupdate-xdi-qspi1-gold-rootfs";
|
||||||
|
|
||||||
|
static constexpr dur_millis_t INIT_SD_CARD_CHECK_TIMEOUT = 5000;
|
||||||
|
static constexpr dur_millis_t DEFAULT_SD_CARD_CHECK_TIMEOUT = 60000;
|
||||||
|
|
||||||
static constexpr ActionId_t LIST_DIRECTORY_INTO_FILE = 0;
|
static constexpr ActionId_t LIST_DIRECTORY_INTO_FILE = 0;
|
||||||
static constexpr ActionId_t SWITCH_REBOOT_FILE_HANDLING = 5;
|
static constexpr ActionId_t SWITCH_REBOOT_FILE_HANDLING = 5;
|
||||||
static constexpr ActionId_t RESET_REBOOT_COUNTERS = 6;
|
static constexpr ActionId_t RESET_REBOOT_COUNTERS = 6;
|
||||||
@ -210,6 +213,8 @@ class CoreController : public ExtendedControllerBase {
|
|||||||
RebootFile rebootFile = {};
|
RebootFile rebootFile = {};
|
||||||
std::string currMntPrefix;
|
std::string currMntPrefix;
|
||||||
bool performOneShotSdCardOpsSwitch = false;
|
bool performOneShotSdCardOpsSwitch = false;
|
||||||
|
uint8_t shortSdCardCdCounter = 0;
|
||||||
|
Countdown sdCardCheckCd = Countdown(INIT_SD_CARD_CHECK_TIMEOUT);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Index 0: Chip 0 Copy 0
|
* Index 0: Chip 0 Copy 0
|
||||||
@ -229,7 +234,7 @@ class CoreController : public ExtendedControllerBase {
|
|||||||
|
|
||||||
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
||||||
LocalDataPoolManager& poolManager) override;
|
LocalDataPoolManager& poolManager) override;
|
||||||
Countdown sdCardCheckCd = Countdown(120000);
|
|
||||||
LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
|
LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
|
||||||
ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, uint32_t* msToReachTheMode);
|
ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, uint32_t* msToReachTheMode);
|
||||||
void performMountedSdCardOperations();
|
void performMountedSdCardOperations();
|
||||||
|
@ -73,6 +73,7 @@ void initmission::initTasks() {
|
|||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
initmission::printAddObjectError("CORE_CTRL", objects::CORE_CONTROLLER);
|
initmission::printAddObjectError("CORE_CTRL", objects::CORE_CONTROLLER);
|
||||||
}
|
}
|
||||||
|
#if OBSW_ADD_SA_DEPL == 1
|
||||||
// Could add this to the core controller but the core controller does so many thing that I would
|
// Could add this to the core controller but the core controller does so many thing that I would
|
||||||
// prefer to have the solar array deployment in a seprate task.
|
// prefer to have the solar array deployment in a seprate task.
|
||||||
PeriodicTaskIF* solarArrayDeplTask = factory->createPeriodicTask(
|
PeriodicTaskIF* solarArrayDeplTask = factory->createPeriodicTask(
|
||||||
@ -81,6 +82,7 @@ void initmission::initTasks() {
|
|||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
initmission::printAddObjectError("SOLAR_ARRAY_DEPL", objects::SOLAR_ARRAY_DEPL_HANDLER);
|
initmission::printAddObjectError("SOLAR_ARRAY_DEPL", objects::SOLAR_ARRAY_DEPL_HANDLER);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* TMTC Distribution */
|
/* TMTC Distribution */
|
||||||
PeriodicTaskIF* tmTcDistributor = factory->createPeriodicTask(
|
PeriodicTaskIF* tmTcDistributor = factory->createPeriodicTask(
|
||||||
@ -117,7 +119,7 @@ void initmission::initTasks() {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if OBSW_USE_CCSDS_IP_CORE == 1
|
#if OBSW_ADD_CCSDS_IP_CORES == 1
|
||||||
PeriodicTaskIF* ccsdsHandlerTask = factory->createPeriodicTask(
|
PeriodicTaskIF* ccsdsHandlerTask = factory->createPeriodicTask(
|
||||||
"CCSDS_HANDLER", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
"CCSDS_HANDLER", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
||||||
result = ccsdsHandlerTask->addComponent(objects::CCSDS_HANDLER);
|
result = ccsdsHandlerTask->addComponent(objects::CCSDS_HANDLER);
|
||||||
@ -134,7 +136,7 @@ void initmission::initTasks() {
|
|||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
initmission::printAddObjectError("PDEC Handler", objects::PDEC_HANDLER);
|
initmission::printAddObjectError("PDEC Handler", objects::PDEC_HANDLER);
|
||||||
}
|
}
|
||||||
#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */
|
#endif /* OBSW_ADD_CCSDS_IP_CORE == 1 */
|
||||||
|
|
||||||
#if OBSW_ADD_CFDP_COMPONENTS == 1
|
#if OBSW_ADD_CFDP_COMPONENTS == 1
|
||||||
PeriodicTaskIF* cfdpTask = factory->createPeriodicTask(
|
PeriodicTaskIF* cfdpTask = factory->createPeriodicTask(
|
||||||
@ -234,10 +236,12 @@ void initmission::initTasks() {
|
|||||||
initmission::printAddObjectError("THERMAL_CONTROLLER", objects::THERMAL_CONTROLLER);
|
initmission::printAddObjectError("THERMAL_CONTROLLER", objects::THERMAL_CONTROLLER);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#if OBSW_ADD_HEATERS == 1
|
||||||
result = tcsSystemTask->addComponent(objects::HEATER_HANDLER);
|
result = tcsSystemTask->addComponent(objects::HEATER_HANDLER);
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
initmission::printAddObjectError("HEATER_HANDLER", objects::HEATER_HANDLER);
|
initmission::printAddObjectError("HEATER_HANDLER", objects::HEATER_HANDLER);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if OBSW_ADD_STAR_TRACKER == 1
|
#if OBSW_ADD_STAR_TRACKER == 1
|
||||||
PeriodicTaskIF* strHelperTask = factory->createPeriodicTask(
|
PeriodicTaskIF* strHelperTask = factory->createPeriodicTask(
|
||||||
@ -307,13 +311,15 @@ void initmission::initTasks() {
|
|||||||
tmtcPollingTask->startTask();
|
tmtcPollingTask->startTask();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if OBSW_USE_CCSDS_IP_CORE == 1
|
#if OBSW_ADD_CCSDS_IP_CORES == 1
|
||||||
ccsdsHandlerTask->startTask();
|
ccsdsHandlerTask->startTask();
|
||||||
pdecHandlerTask->startTask();
|
pdecHandlerTask->startTask();
|
||||||
#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */
|
#endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */
|
||||||
|
|
||||||
sysCtrlTask->startTask();
|
// sysCtrlTask->startTask();
|
||||||
|
#if OBSW_ADD_SA_DEPL == 1
|
||||||
solarArrayDeplTask->startTask();
|
solarArrayDeplTask->startTask();
|
||||||
|
#endif
|
||||||
|
|
||||||
taskStarter(pstTasks, "PST task vector");
|
taskStarter(pstTasks, "PST task vector");
|
||||||
taskStarter(pusTasks, "PUS task vector");
|
taskStarter(pusTasks, "PUS task vector");
|
||||||
@ -340,7 +346,9 @@ void initmission::initTasks() {
|
|||||||
tcsPollingTask->startTask();
|
tcsPollingTask->startTask();
|
||||||
tcsTask->startTask();
|
tcsTask->startTask();
|
||||||
#endif /* OBSW_ADD_RTD_DEVICES == 1 */
|
#endif /* OBSW_ADD_RTD_DEVICES == 1 */
|
||||||
tcsSystemTask->startTask();
|
if (not tcsSystemTask->isEmpty()) {
|
||||||
|
tcsSystemTask->startTask();
|
||||||
|
}
|
||||||
#if OBSW_ADD_PLOC_SUPERVISOR == 1
|
#if OBSW_ADD_PLOC_SUPERVISOR == 1
|
||||||
supvHelperTask->startTask();
|
supvHelperTask->startTask();
|
||||||
#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */
|
#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */
|
||||||
|
@ -145,10 +145,8 @@ void ObjectFactory::createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, Ua
|
|||||||
new CspComIF(objects::CSP_COM_IF);
|
new CspComIF(objects::CSP_COM_IF);
|
||||||
*i2cComIF = new I2cComIF(objects::I2C_COM_IF);
|
*i2cComIF = new I2cComIF(objects::I2C_COM_IF);
|
||||||
*uartComIF = new UartComIF(objects::UART_COM_IF);
|
*uartComIF = new UartComIF(objects::UART_COM_IF);
|
||||||
*spiMainComIF = new SpiComIF(objects::SPI_MAIN_COM_IF, q7s::SPI_DEFAULT_DEV, *gpioComIF);
|
*spiMainComIF = new SpiComIF(objects::SPI_MAIN_COM_IF, q7s::SPI_DEFAULT_DEV, **gpioComIF);
|
||||||
*spiRWComIF = new SpiComIF(objects::SPI_RW_COM_IF, q7s::SPI_RW_DEV, *gpioComIF);
|
*spiRWComIF = new SpiComIF(objects::SPI_RW_COM_IF, q7s::SPI_RW_DEV, **gpioComIF);
|
||||||
/* Adding gpios for chip select decoding to the gpioComIf */
|
|
||||||
q7s::gpioCallbacks::initSpiCsDecoder(*gpioComIF);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher) {
|
void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher) {
|
||||||
@ -193,8 +191,11 @@ void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchI
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) {
|
ReturnValue_t ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) {
|
||||||
using namespace gpio;
|
using namespace gpio;
|
||||||
|
if(gpioComIF == nullptr) {
|
||||||
|
return returnvalue::FAILED;
|
||||||
|
}
|
||||||
GpioCookie* gpioCookieRadSensor = new GpioCookie;
|
GpioCookie* gpioCookieRadSensor = new GpioCookie;
|
||||||
std::stringstream consumer;
|
std::stringstream consumer;
|
||||||
consumer << "0x" << std::hex << objects::RAD_SENSOR;
|
consumer << "0x" << std::hex << objects::RAD_SENSOR;
|
||||||
@ -220,6 +221,7 @@ void ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) {
|
|||||||
#if OBSW_DEBUG_RAD_SENSOR == 1
|
#if OBSW_DEBUG_RAD_SENSOR == 1
|
||||||
radSensor->enablePeriodicDataPrint(true);
|
radSensor->enablePeriodicDataPrint(true);
|
||||||
#endif
|
#endif
|
||||||
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF,
|
void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF,
|
||||||
|
@ -26,7 +26,7 @@ void createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher
|
|||||||
void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
|
void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
|
||||||
PowerSwitchIF* pwrSwitcher);
|
PowerSwitchIF* pwrSwitcher);
|
||||||
void createTmpComponents();
|
void createTmpComponents();
|
||||||
void createRadSensorComponent(LinuxLibgpioIF* gpioComIF);
|
ReturnValue_t createRadSensorComponent(LinuxLibgpioIF* gpioComIF);
|
||||||
void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF,
|
void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF,
|
||||||
PowerSwitchIF* pwrSwitcher);
|
PowerSwitchIF* pwrSwitcher);
|
||||||
void createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwitcher, HealthTableIF* healthTable);
|
void createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwitcher, HealthTableIF* healthTable);
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#include <bsp_q7s/callbacks/q7sGpioCallbacks.h>
|
||||||
#include <fsfw/health/HealthTableIF.h>
|
#include <fsfw/health/HealthTableIF.h>
|
||||||
#include <fsfw/power/DummyPowerSwitcher.h>
|
#include <fsfw/power/DummyPowerSwitcher.h>
|
||||||
|
|
||||||
@ -24,6 +25,9 @@ void ObjectFactory::produce(void* args) {
|
|||||||
I2cComIF* i2cComIF = nullptr;
|
I2cComIF* i2cComIF = nullptr;
|
||||||
SpiComIF* spiRwComIF = nullptr;
|
SpiComIF* spiRwComIF = nullptr;
|
||||||
createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiMainComIF, &i2cComIF, &spiRwComIF);
|
createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiMainComIF, &i2cComIF, &spiRwComIF);
|
||||||
|
/* Adding gpios for chip select decoding to the gpioComIf */
|
||||||
|
q7s::gpioCallbacks::initSpiCsDecoder(gpioComIF);
|
||||||
|
gpioCallbacks::disableAllDecoder(gpioComIF);
|
||||||
|
|
||||||
// Hardware is usually not connected to EM, so we need to create dummies which replace lower
|
// Hardware is usually not connected to EM, so we need to create dummies which replace lower
|
||||||
// level components.
|
// level components.
|
||||||
@ -33,8 +37,8 @@ void ObjectFactory::produce(void* args) {
|
|||||||
|
|
||||||
new CoreController(objects::CORE_CONTROLLER);
|
new CoreController(objects::CORE_CONTROLLER);
|
||||||
|
|
||||||
gpioCallbacks::disableAllDecoder(gpioComIF);
|
|
||||||
PowerSwitchIF* pwrSwitcher = new DummyPowerSwitcher(objects::PCDU_HANDLER, 18, 0);
|
PowerSwitchIF* pwrSwitcher = new DummyPowerSwitcher(objects::PCDU_HANDLER, 18, 0);
|
||||||
|
static_cast<void>(pwrSwitcher);
|
||||||
|
|
||||||
// Regular FM code, does not work for EM if the hardware is not connected
|
// Regular FM code, does not work for EM if the hardware is not connected
|
||||||
// createPcduComponents(gpioComIF, &pwrSwitcher);
|
// createPcduComponents(gpioComIF, &pwrSwitcher);
|
||||||
@ -44,19 +48,24 @@ void ObjectFactory::produce(void* args) {
|
|||||||
// createRtdComponents(q7s::SPI_DEFAULT_DEV, gpioComIF, pwrSwitcher, spiMainComIF);
|
// createRtdComponents(q7s::SPI_DEFAULT_DEV, gpioComIF, pwrSwitcher, spiMainComIF);
|
||||||
// createTmpComponents();
|
// createTmpComponents();
|
||||||
// createSolarArrayDeploymentComponents();
|
// createSolarArrayDeploymentComponents();
|
||||||
createRadSensorComponent(gpioComIF);
|
// createPayloadComponents(gpioComIF);
|
||||||
|
// createHeaterComponents(gpioComIF, pwrSwitcher, healthTable);
|
||||||
|
|
||||||
|
// TODO: Careful! Switching this on somehow messes with the communication with the ProASIC
|
||||||
|
// and will cause xsc_boot_copy commands to always boot to 0 0
|
||||||
|
// createRadSensorComponent(gpioComIF);
|
||||||
|
|
||||||
#if OBSW_ADD_ACS_BOARD == 1
|
#if OBSW_ADD_ACS_BOARD == 1
|
||||||
createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher);
|
createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher);
|
||||||
#endif
|
#endif
|
||||||
createHeaterComponents(gpioComIF, pwrSwitcher, healthTable);
|
|
||||||
|
|
||||||
createPayloadComponents(gpioComIF);
|
|
||||||
|
|
||||||
#if OBSW_ADD_MGT == 1
|
#if OBSW_ADD_MGT == 1
|
||||||
createImtqComponents(pwrSwitcher);
|
createImtqComponents(pwrSwitcher);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if OBSW_ADD_RW == 1
|
||||||
createReactionWheelComponents(gpioComIF, pwrSwitcher);
|
createReactionWheelComponents(gpioComIF, pwrSwitcher);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if OBSW_ADD_BPX_BATTERY_HANDLER == 1
|
#if OBSW_ADD_BPX_BATTERY_HANDLER == 1
|
||||||
createBpxBatteryComponent();
|
createBpxBatteryComponent();
|
||||||
@ -65,9 +74,9 @@ void ObjectFactory::produce(void* args) {
|
|||||||
#if OBSW_ADD_STAR_TRACKER == 1
|
#if OBSW_ADD_STAR_TRACKER == 1
|
||||||
createStrComponents(pwrSwitcher);
|
createStrComponents(pwrSwitcher);
|
||||||
#endif /* OBSW_ADD_STAR_TRACKER == 1 */
|
#endif /* OBSW_ADD_STAR_TRACKER == 1 */
|
||||||
#if OBSW_USE_CCSDS_IP_CORE == 1
|
#if OBSW_ADD_CCSDS_IP_CORES == 1
|
||||||
createCcsdsComponents(gpioComIF);
|
createCcsdsComponents(gpioComIF);
|
||||||
#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */
|
#endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */
|
||||||
/* Test Task */
|
/* Test Task */
|
||||||
#if OBSW_ADD_TEST_CODE == 1
|
#if OBSW_ADD_TEST_CODE == 1
|
||||||
createTestComponents(gpioComIF);
|
createTestComponents(gpioComIF);
|
||||||
@ -76,7 +85,5 @@ void ObjectFactory::produce(void* args) {
|
|||||||
createScexComponents(q7s::UART_SCEX_DEV, pwrSwitcher, *SdCardManager::instance(), true,
|
createScexComponents(q7s::UART_SCEX_DEV, pwrSwitcher, *SdCardManager::instance(), true,
|
||||||
std::nullopt);
|
std::nullopt);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
createMiscComponents();
|
|
||||||
createAcsController();
|
createAcsController();
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#include <bsp_q7s/callbacks/q7sGpioCallbacks.h>
|
||||||
#include <mission/devices/devicedefinitions/GomspaceDefinitions.h>
|
#include <mission/devices/devicedefinitions/GomspaceDefinitions.h>
|
||||||
|
|
||||||
#include "OBSWConfig.h"
|
#include "OBSWConfig.h"
|
||||||
@ -23,10 +24,11 @@ void ObjectFactory::produce(void* args) {
|
|||||||
PowerSwitchIF* pwrSwitcher = nullptr;
|
PowerSwitchIF* pwrSwitcher = nullptr;
|
||||||
SpiComIF* spiRwComIF = nullptr;
|
SpiComIF* spiRwComIF = nullptr;
|
||||||
createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiMainComIF, &i2cComIF, &spiRwComIF);
|
createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiMainComIF, &i2cComIF, &spiRwComIF);
|
||||||
createTmpComponents();
|
/* Adding gpios for chip select decoding to the gpioComIf */
|
||||||
new CoreController(objects::CORE_CONTROLLER);
|
q7s::gpioCallbacks::initSpiCsDecoder(gpioComIF);
|
||||||
|
|
||||||
gpioCallbacks::disableAllDecoder(gpioComIF);
|
gpioCallbacks::disableAllDecoder(gpioComIF);
|
||||||
|
|
||||||
|
new CoreController(objects::CORE_CONTROLLER);
|
||||||
createPcduComponents(gpioComIF, &pwrSwitcher);
|
createPcduComponents(gpioComIF, &pwrSwitcher);
|
||||||
createRadSensorComponent(gpioComIF);
|
createRadSensorComponent(gpioComIF);
|
||||||
createSunSensorComponents(gpioComIF, spiMainComIF, pwrSwitcher, q7s::SPI_DEFAULT_DEV);
|
createSunSensorComponents(gpioComIF, spiMainComIF, pwrSwitcher, q7s::SPI_DEFAULT_DEV);
|
||||||
@ -55,9 +57,9 @@ void ObjectFactory::produce(void* args) {
|
|||||||
#if OBSW_ADD_STAR_TRACKER == 1
|
#if OBSW_ADD_STAR_TRACKER == 1
|
||||||
createStrComponents(pwrSwitcher);
|
createStrComponents(pwrSwitcher);
|
||||||
#endif /* OBSW_ADD_STAR_TRACKER == 1 */
|
#endif /* OBSW_ADD_STAR_TRACKER == 1 */
|
||||||
#if OBSW_USE_CCSDS_IP_CORE == 1
|
#if OBSW_ADD_CCSDS_IP_CORES == 1
|
||||||
createCcsdsComponents(gpioComIF);
|
createCcsdsComponents(gpioComIF);
|
||||||
#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */
|
#endif /* OBSW_ADD_CCSDS_IP_CORES == 1 */
|
||||||
|
|
||||||
#if OBSW_ADD_SCEX_DEVICE == 1
|
#if OBSW_ADD_SCEX_DEVICE == 1
|
||||||
createScexComponents(q7s::UART_SCEX_DEV, pwrSwitcher, *SdCardManager::instance(), false,
|
createScexComponents(q7s::UART_SCEX_DEV, pwrSwitcher, *SdCardManager::instance(), false,
|
||||||
|
@ -107,7 +107,7 @@ void initmission::initTasks() {
|
|||||||
}
|
}
|
||||||
#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */
|
#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */
|
||||||
|
|
||||||
#if OBSW_USE_CCSDS_IP_CORE == 1
|
#if OBSW_ADD_CCSDS_IP_CORE == 1
|
||||||
PeriodicTaskIF* ccsdsHandlerTask = factory->createPeriodicTask(
|
PeriodicTaskIF* ccsdsHandlerTask = factory->createPeriodicTask(
|
||||||
"CCSDS_HANDLER", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
"CCSDS_HANDLER", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
||||||
result = ccsdsHandlerTask->addComponent(objects::CCSDS_HANDLER);
|
result = ccsdsHandlerTask->addComponent(objects::CCSDS_HANDLER);
|
||||||
@ -124,7 +124,7 @@ void initmission::initTasks() {
|
|||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
initmission::printAddObjectError("PDEC Handler", objects::PDEC_HANDLER);
|
initmission::printAddObjectError("PDEC Handler", objects::PDEC_HANDLER);
|
||||||
}
|
}
|
||||||
#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */
|
#endif /* OBSW_ADD_CCSDS_IP_CORE == 1 */
|
||||||
|
|
||||||
auto taskStarter = [](std::vector<PeriodicTaskIF*>& taskVector, std::string name) {
|
auto taskStarter = [](std::vector<PeriodicTaskIF*>& taskVector, std::string name) {
|
||||||
for (const auto& task : taskVector) {
|
for (const auto& task : taskVector) {
|
||||||
@ -140,10 +140,10 @@ void initmission::initTasks() {
|
|||||||
tmtcDistributor->startTask();
|
tmtcDistributor->startTask();
|
||||||
tmtcBridgeTask->startTask();
|
tmtcBridgeTask->startTask();
|
||||||
tmtcPollingTask->startTask();
|
tmtcPollingTask->startTask();
|
||||||
#if OBSW_USE_CCSDS_IP_CORE == 1
|
#if OBSW_ADD_CCSDS_IP_CORE == 1
|
||||||
pdecHandlerTask->startTask();
|
pdecHandlerTask->startTask();
|
||||||
ccsdsHandlerTask->startTask();
|
ccsdsHandlerTask->startTask();
|
||||||
#endif /* #if OBSW_USE_CCSDS_IP_CORE == 1 */
|
#endif /* #if OBSW_ADD_CCSDS_IP_CORE == 1 */
|
||||||
#if OBSW_ADD_PLOC_SUPERVISOR == 1
|
#if OBSW_ADD_PLOC_SUPERVISOR == 1
|
||||||
supvHelperTask->startTask();
|
supvHelperTask->startTask();
|
||||||
#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */
|
#endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
/** All of the following flags should be enabled for mission code */
|
/** All of the following flags should be enabled for mission code */
|
||||||
/*******************************************************************/
|
/*******************************************************************/
|
||||||
|
|
||||||
#define OBSW_USE_CCSDS_IP_CORE 0
|
#define OBSW_ADD_CCSDS_IP_CORE 0
|
||||||
// Set to 1 if all telemetry should be sent to the PTME IP Core
|
// Set to 1 if all telemetry should be sent to the PTME IP Core
|
||||||
#define OBSW_TM_TO_PTME 0
|
#define OBSW_TM_TO_PTME 0
|
||||||
// Set to 1 if telecommands are received via the PDEC IP Core
|
// Set to 1 if telecommands are received via the PDEC IP Core
|
||||||
|
@ -55,7 +55,7 @@ namespace uart {
|
|||||||
|
|
||||||
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;
|
||||||
static constexpr UartBaudRate SCEX_BAUD = UartBaudRate::RATE_57600;
|
static constexpr UartBaudRate SCEX_BAUD = UartBaudRate::RATE_38400;
|
||||||
static constexpr UartBaudRate GNSS_BAUD = UartBaudRate::RATE_9600;
|
static constexpr UartBaudRate GNSS_BAUD = UartBaudRate::RATE_9600;
|
||||||
static constexpr UartBaudRate PLOC_MPSOC_BAUD = UartBaudRate::RATE_115200;
|
static constexpr UartBaudRate PLOC_MPSOC_BAUD = UartBaudRate::RATE_115200;
|
||||||
static constexpr UartBaudRate PLOC_SUPV_BAUD = UartBaudRate::RATE_115200;
|
static constexpr UartBaudRate PLOC_SUPV_BAUD = UartBaudRate::RATE_115200;
|
||||||
|
2
fsfw
2
fsfw
@ -1 +1 @@
|
|||||||
Subproject commit 1f05e6b297af8a6d310394e959c4d0cf13632831
|
Subproject commit 1b7e94d718ba8f526dd53324d33d0e577cbfc81b
|
@ -118,10 +118,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;
|
||||||
|
|
||||||
// The SCEX experiment has a fixed baud rate.
|
uart::setBaudrate(tty, uartCookie->getBaudrate());
|
||||||
if (cfsetispeed(&tty, B38400) != 0) {
|
|
||||||
sif::warning << "ScexUartReader::initializeInterface: Setting baud rate failed" << std::endl;
|
|
||||||
}
|
|
||||||
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;
|
||||||
|
@ -460,20 +460,18 @@ ReturnValue_t pst::pstI2c(FixedTimeslotTaskIF *thisSequence) {
|
|||||||
ReturnValue_t pst::pstUart(FixedTimeslotTaskIF *thisSequence) {
|
ReturnValue_t pst::pstUart(FixedTimeslotTaskIF *thisSequence) {
|
||||||
// Length of a communication cycle
|
// Length of a communication cycle
|
||||||
uint32_t length = thisSequence->getPeriodMs();
|
uint32_t length = thisSequence->getPeriodMs();
|
||||||
bool uartPstEmpty = true;
|
static_cast<void>(length);
|
||||||
|
|
||||||
#if OBSW_ADD_PLOC_MPSOC == 1
|
#if OBSW_ADD_PLOC_MPSOC == 1
|
||||||
uartPstEmpty = false;
|
|
||||||
thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0,
|
thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0,
|
||||||
DeviceHandlerIF::PERFORM_OPERATION);
|
DeviceHandlerIF::PERFORM_OPERATION);
|
||||||
thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE);
|
thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE);
|
||||||
thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.4, DeviceHandlerIF::GET_WRITE);
|
thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.4, DeviceHandlerIF::GET_WRITE);
|
||||||
thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.6, DeviceHandlerIF::SEND_READ);
|
thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.6, DeviceHandlerIF::SEND_READ);
|
||||||
thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.8, DeviceHandlerIF::GET_READ);
|
thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.8, DeviceHandlerIF::GET_READ);
|
||||||
#endif
|
|
||||||
|
|
||||||
thisSequence->addSlot(objects::PLOC_MEMORY_DUMPER, length * 0,
|
thisSequence->addSlot(objects::PLOC_MEMORY_DUMPER, length * 0,
|
||||||
DeviceHandlerIF::PERFORM_OPERATION);
|
DeviceHandlerIF::PERFORM_OPERATION);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if OBSW_ADD_PLOC_SUPERVISOR == 1
|
#if OBSW_ADD_PLOC_SUPERVISOR == 1
|
||||||
thisSequence->addSlot(objects::PLOC_SUPERVISOR_HANDLER, length * 0,
|
thisSequence->addSlot(objects::PLOC_SUPERVISOR_HANDLER, length * 0,
|
||||||
DeviceHandlerIF::PERFORM_OPERATION);
|
DeviceHandlerIF::PERFORM_OPERATION);
|
||||||
@ -485,7 +483,6 @@ ReturnValue_t pst::pstUart(FixedTimeslotTaskIF *thisSequence) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if OBSW_ADD_SYRLINKS == 1
|
#if OBSW_ADD_SYRLINKS == 1
|
||||||
uartPstEmpty = false;
|
|
||||||
thisSequence->addSlot(objects::SYRLINKS_HK_HANDLER, length * 0,
|
thisSequence->addSlot(objects::SYRLINKS_HK_HANDLER, length * 0,
|
||||||
DeviceHandlerIF::PERFORM_OPERATION);
|
DeviceHandlerIF::PERFORM_OPERATION);
|
||||||
thisSequence->addSlot(objects::SYRLINKS_HK_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE);
|
thisSequence->addSlot(objects::SYRLINKS_HK_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE);
|
||||||
@ -495,22 +492,13 @@ ReturnValue_t pst::pstUart(FixedTimeslotTaskIF *thisSequence) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if OBSW_ADD_STAR_TRACKER == 1
|
#if OBSW_ADD_STAR_TRACKER == 1
|
||||||
uartPstEmpty = false;
|
|
||||||
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.2, DeviceHandlerIF::SEND_WRITE);
|
thisSequence->addSlot(objects::STAR_TRACKER, length * 0.2, DeviceHandlerIF::SEND_WRITE);
|
||||||
thisSequence->addSlot(objects::STAR_TRACKER, length * 0.4, DeviceHandlerIF::GET_WRITE);
|
thisSequence->addSlot(objects::STAR_TRACKER, length * 0.4, DeviceHandlerIF::GET_WRITE);
|
||||||
thisSequence->addSlot(objects::STAR_TRACKER, length * 0.6, DeviceHandlerIF::SEND_READ);
|
thisSequence->addSlot(objects::STAR_TRACKER, length * 0.6, DeviceHandlerIF::SEND_READ);
|
||||||
thisSequence->addSlot(objects::STAR_TRACKER, length * 0.8, DeviceHandlerIF::GET_READ);
|
thisSequence->addSlot(objects::STAR_TRACKER, length * 0.8, DeviceHandlerIF::GET_READ);
|
||||||
#endif
|
#endif
|
||||||
static_cast<void>(length);
|
return thisSequence->checkSequence();
|
||||||
if (uartPstEmpty) {
|
|
||||||
return returnvalue::OK;
|
|
||||||
}
|
|
||||||
if (thisSequence->checkSequence() != returnvalue::OK) {
|
|
||||||
sif::error << "UART PST initialization failed" << std::endl;
|
|
||||||
return returnvalue::FAILED;
|
|
||||||
}
|
|
||||||
return returnvalue::OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t pst::pstGompaceCan(FixedTimeslotTaskIF *thisSequence) {
|
ReturnValue_t pst::pstGompaceCan(FixedTimeslotTaskIF *thisSequence) {
|
||||||
|
@ -422,12 +422,12 @@ ReturnValue_t GyroADIS1650XHandler::spiSendCallback(SpiComIF *comIf, SpiCookie *
|
|||||||
cookie->setTransferSize(2);
|
cookie->setTransferSize(2);
|
||||||
|
|
||||||
gpioId_t gpioId = cookie->getChipSelectPin();
|
gpioId_t gpioId = cookie->getChipSelectPin();
|
||||||
GpioIF *gpioIF = comIf->getGpioInterface();
|
GpioIF& gpioIF = comIf->getGpioInterface();
|
||||||
MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING;
|
MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING;
|
||||||
uint32_t timeoutMs = 0;
|
uint32_t timeoutMs = 0;
|
||||||
MutexIF *mutex = comIf->getCsMutex();
|
MutexIF *mutex = comIf->getCsMutex();
|
||||||
cookie->getMutexParams(timeoutType, timeoutMs);
|
cookie->getMutexParams(timeoutType, timeoutMs);
|
||||||
if (mutex == nullptr or gpioIF == nullptr) {
|
if (mutex == nullptr) {
|
||||||
#if OBSW_VERBOSE_LEVEL >= 1
|
#if OBSW_VERBOSE_LEVEL >= 1
|
||||||
sif::warning << "GyroADIS16507Handler::spiSendCallback: "
|
sif::warning << "GyroADIS16507Handler::spiSendCallback: "
|
||||||
"Mutex or GPIO interface invalid"
|
"Mutex or GPIO interface invalid"
|
||||||
@ -453,7 +453,7 @@ ReturnValue_t GyroADIS1650XHandler::spiSendCallback(SpiComIF *comIf, SpiCookie *
|
|||||||
while (idx < sendLen) {
|
while (idx < sendLen) {
|
||||||
// Pull SPI CS low. For now, no support for active high given
|
// Pull SPI CS low. For now, no support for active high given
|
||||||
if (gpioId != gpio::NO_GPIO) {
|
if (gpioId != gpio::NO_GPIO) {
|
||||||
gpioIF->pullLow(gpioId);
|
gpioIF.pullLow(gpioId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute transfer
|
// Execute transfer
|
||||||
@ -468,7 +468,7 @@ ReturnValue_t GyroADIS1650XHandler::spiSendCallback(SpiComIF *comIf, SpiCookie *
|
|||||||
#endif /* FSFW_LINUX_SPI_WIRETAPPING == 1 */
|
#endif /* FSFW_LINUX_SPI_WIRETAPPING == 1 */
|
||||||
|
|
||||||
if (gpioId != gpio::NO_GPIO) {
|
if (gpioId != gpio::NO_GPIO) {
|
||||||
gpioIF->pullHigh(gpioId);
|
gpioIF.pullHigh(gpioId);
|
||||||
}
|
}
|
||||||
|
|
||||||
idx += 2;
|
idx += 2;
|
||||||
|
@ -719,11 +719,11 @@ ReturnValue_t PayloadPcduHandler::transferAsTwo(SpiComIF* comIf, SpiCookie* cook
|
|||||||
cookie->setTransferSize(transferLen);
|
cookie->setTransferSize(transferLen);
|
||||||
|
|
||||||
gpioId_t gpioId = cookie->getChipSelectPin();
|
gpioId_t gpioId = cookie->getChipSelectPin();
|
||||||
GpioIF* gpioIF = comIf->getGpioInterface();
|
GpioIF& gpioIF = comIf->getGpioInterface();
|
||||||
MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING;
|
MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING;
|
||||||
uint32_t timeoutMs = 0;
|
uint32_t timeoutMs = 0;
|
||||||
MutexIF* mutex = comIf->getCsMutex();
|
MutexIF* mutex = comIf->getCsMutex();
|
||||||
if (mutex == nullptr or gpioIF == nullptr) {
|
if (mutex == nullptr) {
|
||||||
#if OBSW_VERBOSE_LEVEL >= 1
|
#if OBSW_VERBOSE_LEVEL >= 1
|
||||||
sif::warning << "GyroADIS16507Handler::spiSendCallback: "
|
sif::warning << "GyroADIS16507Handler::spiSendCallback: "
|
||||||
"Mutex or GPIO interface invalid"
|
"Mutex or GPIO interface invalid"
|
||||||
@ -753,7 +753,7 @@ ReturnValue_t PayloadPcduHandler::transferAsTwo(SpiComIF* comIf, SpiCookie* cook
|
|||||||
transferStruct->len = transferLen;
|
transferStruct->len = transferLen;
|
||||||
// Pull SPI CS low. For now, no support for active high given
|
// Pull SPI CS low. For now, no support for active high given
|
||||||
if (gpioId != gpio::NO_GPIO) {
|
if (gpioId != gpio::NO_GPIO) {
|
||||||
gpioIF->pullLow(gpioId);
|
gpioIF.pullLow(gpioId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute transfer
|
// Execute transfer
|
||||||
@ -768,14 +768,14 @@ ReturnValue_t PayloadPcduHandler::transferAsTwo(SpiComIF* comIf, SpiCookie* cook
|
|||||||
#endif /* FSFW_LINUX_SPI_WIRETAPPING == 1 */
|
#endif /* FSFW_LINUX_SPI_WIRETAPPING == 1 */
|
||||||
|
|
||||||
if (gpioId != gpio::NO_GPIO) {
|
if (gpioId != gpio::NO_GPIO) {
|
||||||
gpioIF->pullHigh(gpioId);
|
gpioIF.pullHigh(gpioId);
|
||||||
}
|
}
|
||||||
|
|
||||||
transferStruct->tx_buf += transferLen;
|
transferStruct->tx_buf += transferLen;
|
||||||
transferStruct->rx_buf += transferLen;
|
transferStruct->rx_buf += transferLen;
|
||||||
transferStruct->len = plpcdu::TEMP_REPLY_SIZE - 1;
|
transferStruct->len = plpcdu::TEMP_REPLY_SIZE - 1;
|
||||||
if (gpioId != gpio::NO_GPIO) {
|
if (gpioId != gpio::NO_GPIO) {
|
||||||
gpioIF->pullLow(gpioId);
|
gpioIF.pullLow(gpioId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute transfer
|
// Execute transfer
|
||||||
@ -790,7 +790,7 @@ ReturnValue_t PayloadPcduHandler::transferAsTwo(SpiComIF* comIf, SpiCookie* cook
|
|||||||
#endif /* FSFW_LINUX_SPI_WIRETAPPING == 1 */
|
#endif /* FSFW_LINUX_SPI_WIRETAPPING == 1 */
|
||||||
|
|
||||||
if (gpioId != gpio::NO_GPIO) {
|
if (gpioId != gpio::NO_GPIO) {
|
||||||
gpioIF->pullHigh(gpioId);
|
gpioIF.pullHigh(gpioId);
|
||||||
}
|
}
|
||||||
|
|
||||||
transferStruct->tx_buf = origTx;
|
transferStruct->tx_buf = origTx;
|
||||||
|
@ -151,7 +151,7 @@ bool SolarArrayDeploymentHandler::autonomousDeplForFile(sd::SdCard sdCard, const
|
|||||||
string line;
|
string line;
|
||||||
string word;
|
string word;
|
||||||
unsigned int lineNum = 0;
|
unsigned int lineNum = 0;
|
||||||
AutonomousDeplState deplState;
|
AutonomousDeplState deplState = AutonomousDeplState::INIT;
|
||||||
bool stateSwitch = false;
|
bool stateSwitch = false;
|
||||||
uint32_t secsSinceBoot = 0;
|
uint32_t secsSinceBoot = 0;
|
||||||
while (std::getline(file, line)) {
|
while (std::getline(file, line)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user