This commit is contained in:
parent
ce04532759
commit
bb0c4ac03e
@ -31,7 +31,7 @@
|
|||||||
xsc::Chip CoreController::CURRENT_CHIP = xsc::Chip::NO_CHIP;
|
xsc::Chip CoreController::CURRENT_CHIP = xsc::Chip::NO_CHIP;
|
||||||
xsc::Copy CoreController::CURRENT_COPY = xsc::Copy::NO_COPY;
|
xsc::Copy CoreController::CURRENT_COPY = xsc::Copy::NO_COPY;
|
||||||
|
|
||||||
CoreController::CoreController(object_id_t objectId, const std::atomic_uint16_t& i2cErrors)
|
CoreController::CoreController(object_id_t objectId, const std::atomic_uint16_t &i2cErrors)
|
||||||
: ExtendedControllerBase(objectId, 5),
|
: ExtendedControllerBase(objectId, 5),
|
||||||
cmdExecutor(4096),
|
cmdExecutor(4096),
|
||||||
cmdReplyBuf(4096, true),
|
cmdReplyBuf(4096, true),
|
||||||
@ -108,7 +108,7 @@ void CoreController::performControlOperation() {
|
|||||||
sdStateMachine();
|
sdStateMachine();
|
||||||
performMountedSdCardOperations();
|
performMountedSdCardOperations();
|
||||||
readHkData();
|
readHkData();
|
||||||
if(i2cErrors >= 5) {
|
if (i2cErrors >= 5) {
|
||||||
bool protOpPerformed = false;
|
bool protOpPerformed = false;
|
||||||
triggerEvent(I2C_UNAVAILABLE_REBOOT);
|
triggerEvent(I2C_UNAVAILABLE_REBOOT);
|
||||||
gracefulShutdownTasks(CURRENT_CHIP, CURRENT_COPY, protOpPerformed);
|
gracefulShutdownTasks(CURRENT_CHIP, CURRENT_COPY, protOpPerformed);
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include <fsfw/globalfunctions/PeriodicOperationDivider.h>
|
#include <fsfw/globalfunctions/PeriodicOperationDivider.h>
|
||||||
#include <libxiphos.h>
|
#include <libxiphos.h>
|
||||||
|
|
||||||
|
#include <atomic>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
|
||||||
#include "CoreDefinitions.h"
|
#include "CoreDefinitions.h"
|
||||||
@ -15,7 +16,6 @@
|
|||||||
#include "fsfw/controller/ExtendedControllerBase.h"
|
#include "fsfw/controller/ExtendedControllerBase.h"
|
||||||
#include "mission/devices/devicedefinitions/GPSDefinitions.h"
|
#include "mission/devices/devicedefinitions/GPSDefinitions.h"
|
||||||
#include "mission/trace.h"
|
#include "mission/trace.h"
|
||||||
#include <atomic>
|
|
||||||
|
|
||||||
class Timer;
|
class Timer;
|
||||||
class SdCardManager;
|
class SdCardManager;
|
||||||
@ -132,7 +132,8 @@ class CoreController : public ExtendedControllerBase {
|
|||||||
//! P1: First 16 bits boot count of image 0 0, last 16 bits boot count of image 0 1.
|
//! P1: First 16 bits boot count of image 0 0, last 16 bits boot count of image 0 1.
|
||||||
//! P2: First 16 bits boot count of image 1 0, last 16 bits boot count of image 1 1.
|
//! P2: First 16 bits boot count of image 1 0, last 16 bits boot count of image 1 1.
|
||||||
static constexpr Event INDIVIDUAL_BOOT_COUNTS = event::makeEvent(SUBSYSTEM_ID, 8, severity::INFO);
|
static constexpr Event INDIVIDUAL_BOOT_COUNTS = event::makeEvent(SUBSYSTEM_ID, 8, severity::INFO);
|
||||||
static constexpr Event I2C_UNAVAILABLE_REBOOT = event::makeEvent(SUBSYSTEM_ID, 10, severity::MEDIUM);
|
static constexpr Event I2C_UNAVAILABLE_REBOOT =
|
||||||
|
event::makeEvent(SUBSYSTEM_ID, 10, severity::MEDIUM);
|
||||||
|
|
||||||
CoreController(object_id_t objectId, const std::atomic_uint16_t& i2cErrors);
|
CoreController(object_id_t objectId, const std::atomic_uint16_t& i2cErrors);
|
||||||
virtual ~CoreController();
|
virtual ~CoreController();
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
#include <mission/tmtc/PersistentLogTmStoreTask.h>
|
#include <mission/tmtc/PersistentLogTmStoreTask.h>
|
||||||
#include <mission/tmtc/PusTmFunnel.h>
|
#include <mission/tmtc/PusTmFunnel.h>
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
class LinuxLibgpioIF;
|
class LinuxLibgpioIF;
|
||||||
class SerialComIF;
|
class SerialComIF;
|
||||||
|
@ -303,7 +303,7 @@ ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() {
|
|||||||
bool timeValid = false;
|
bool timeValid = false;
|
||||||
if (TIME_SET == (TIME_SET & gps.set)) {
|
if (TIME_SET == (TIME_SET & gps.set)) {
|
||||||
// To prevent totally incorrect times from being declared valid.
|
// To prevent totally incorrect times from being declared valid.
|
||||||
if(gpsSet.satInView.isValid() and gpsSet.satInView.value >= 1) {
|
if (gpsSet.satInView.isValid() and gpsSet.satInView.value >= 1) {
|
||||||
timeValid = true;
|
timeValid = true;
|
||||||
}
|
}
|
||||||
timeval time = {};
|
timeval time = {};
|
||||||
|
@ -10,9 +10,8 @@
|
|||||||
|
|
||||||
#include "fsfw/FSFW.h"
|
#include "fsfw/FSFW.h"
|
||||||
|
|
||||||
ImtqPollingTask::ImtqPollingTask(object_id_t imtqPollingTask,
|
ImtqPollingTask::ImtqPollingTask(object_id_t imtqPollingTask, std::atomic_uint16_t& i2cFatalErrors)
|
||||||
std::atomic_uint16_t& i2cFatalErrors): SystemObject(imtqPollingTask),
|
: SystemObject(imtqPollingTask), i2cFatalErrors(i2cFatalErrors) {
|
||||||
i2cFatalErrors(i2cFatalErrors) {
|
|
||||||
semaphore = SemaphoreFactory::instance()->createBinarySemaphore();
|
semaphore = SemaphoreFactory::instance()->createBinarySemaphore();
|
||||||
semaphore->acquire();
|
semaphore->acquire();
|
||||||
ipcLock = MutexFactory::instance()->createMutex();
|
ipcLock = MutexFactory::instance()->createMutex();
|
||||||
@ -429,7 +428,7 @@ ReturnValue_t ImtqPollingTask::performI2cFullRequest(uint8_t* reply, size_t repl
|
|||||||
if (ioctl(fd, I2C_SLAVE, i2cAddr) < 0) {
|
if (ioctl(fd, I2C_SLAVE, i2cAddr) < 0) {
|
||||||
sif::warning << "Opening IMTQ slave device failed with code " << errno << ": "
|
sif::warning << "Opening IMTQ slave device failed with code " << errno << ": "
|
||||||
<< strerror(errno) << std::endl;
|
<< strerror(errno) << std::endl;
|
||||||
if(errno == EBUSY) {
|
if (errno == EBUSY) {
|
||||||
i2cFatalErrors++;
|
i2cFatalErrors++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -440,7 +439,7 @@ ReturnValue_t ImtqPollingTask::performI2cFullRequest(uint8_t* reply, size_t repl
|
|||||||
<< ". Error description: " << strerror(errno) << std::endl;
|
<< ". Error description: " << strerror(errno) << std::endl;
|
||||||
// This is a weird issue which sometimes occurs on debug builds. All I2C buses are busy
|
// This is a weird issue which sometimes occurs on debug builds. All I2C buses are busy
|
||||||
// for all writes,
|
// for all writes,
|
||||||
if(errno == EBUSY) {
|
if (errno == EBUSY) {
|
||||||
i2cFatalErrors++;
|
i2cFatalErrors++;
|
||||||
}
|
}
|
||||||
return returnvalue::FAILED;
|
return returnvalue::FAILED;
|
||||||
|
@ -4,11 +4,12 @@
|
|||||||
#include <fsfw/tasks/SemaphoreIF.h>
|
#include <fsfw/tasks/SemaphoreIF.h>
|
||||||
#include <fsfw_hal/linux/i2c/I2cCookie.h>
|
#include <fsfw_hal/linux/i2c/I2cCookie.h>
|
||||||
|
|
||||||
|
#include <atomic>
|
||||||
|
|
||||||
#include "fsfw/devicehandlers/DeviceCommunicationIF.h"
|
#include "fsfw/devicehandlers/DeviceCommunicationIF.h"
|
||||||
#include "fsfw/objectmanager/SystemObject.h"
|
#include "fsfw/objectmanager/SystemObject.h"
|
||||||
#include "fsfw/tasks/ExecutableObjectIF.h"
|
#include "fsfw/tasks/ExecutableObjectIF.h"
|
||||||
#include "mission/devices/devicedefinitions/imtqHelpers.h"
|
#include "mission/devices/devicedefinitions/imtqHelpers.h"
|
||||||
#include <atomic>
|
|
||||||
|
|
||||||
class ImtqPollingTask : public SystemObject,
|
class ImtqPollingTask : public SystemObject,
|
||||||
public ExecutableObjectIF,
|
public ExecutableObjectIF,
|
||||||
|
@ -2147,13 +2147,13 @@ ReturnValue_t StarTrackerHandler::checkCommand(ActionId_t actionId) {
|
|||||||
case startracker::REQ_SUBSCRIPTION:
|
case startracker::REQ_SUBSCRIPTION:
|
||||||
case startracker::REQ_LOG_SUBSCRIPTION:
|
case startracker::REQ_LOG_SUBSCRIPTION:
|
||||||
case startracker::REQ_DEBUG_CAMERA:
|
case startracker::REQ_DEBUG_CAMERA:
|
||||||
if(getMode() == MODE_ON and getSubmode() != startracker::Program::FIRMWARE) {
|
if (getMode() == MODE_ON and getSubmode() != startracker::Program::FIRMWARE) {
|
||||||
return STARTRACKER_NOT_RUNNING_FIRMWARE;
|
return STARTRACKER_NOT_RUNNING_FIRMWARE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case startracker::FIRMWARE_UPDATE:
|
case startracker::FIRMWARE_UPDATE:
|
||||||
case startracker::FLASH_READ:
|
case startracker::FLASH_READ:
|
||||||
if(getMode() != MODE_ON or getSubmode() != startracker::Program::BOOTLOADER) {
|
if (getMode() != MODE_ON or getSubmode() != startracker::Program::BOOTLOADER) {
|
||||||
return STARTRACKER_NOT_RUNNING_BOOTLOADER;
|
return STARTRACKER_NOT_RUNNING_BOOTLOADER;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -263,6 +263,10 @@ ReturnValue_t StrHelper::performImageUpload() {
|
|||||||
return returnvalue::FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
std::ifstream file(uploadImage.uploadFile, std::ifstream::binary);
|
std::ifstream file(uploadImage.uploadFile, std::ifstream::binary);
|
||||||
|
if (file.bad()) {
|
||||||
|
return HasFileSystemIF::GENERIC_FILE_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
// Set position of next character to end of file input stream
|
// Set position of next character to end of file input stream
|
||||||
file.seekg(0, file.end);
|
file.seekg(0, file.end);
|
||||||
// tellg returns position of character in input stream
|
// tellg returns position of character in input stream
|
||||||
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
|||||||
Subproject commit b32a9273ae4186a440685ffde7618f017cfdb268
|
Subproject commit c9b269b01a419d0c636e373e09feef55aca27d66
|
Loading…
x
Reference in New Issue
Block a user