diff --git a/bsp_q7s/boardtest/FileSystemTest.cpp b/bsp_q7s/boardtest/FileSystemTest.cpp index 1de5bb7a..92c4cf3d 100644 --- a/bsp_q7s/boardtest/FileSystemTest.cpp +++ b/bsp_q7s/boardtest/FileSystemTest.cpp @@ -4,6 +4,11 @@ #include #include +enum SdCard { + SDC0, + SDC1 +}; + FileSystemTest::FileSystemTest() { using namespace std; SdCard sdCard = SdCard::SDC0; diff --git a/bsp_q7s/boardtest/FileSystemTest.h b/bsp_q7s/boardtest/FileSystemTest.h index 907c86ca..256a0b36 100644 --- a/bsp_q7s/boardtest/FileSystemTest.h +++ b/bsp_q7s/boardtest/FileSystemTest.h @@ -1,11 +1,6 @@ #ifndef BSP_Q7S_BOARDTEST_FILESYSTEMTEST_H_ #define BSP_Q7S_BOARDTEST_FILESYSTEMTEST_H_ -enum SdCard { - SDC0, - SDC1 -}; - class FileSystemTest { public: FileSystemTest(); diff --git a/bsp_q7s/boardtest/Q7STestTask.cpp b/bsp_q7s/boardtest/Q7STestTask.cpp index 4e763641..f9439fc1 100644 --- a/bsp_q7s/boardtest/Q7STestTask.cpp +++ b/bsp_q7s/boardtest/Q7STestTask.cpp @@ -24,8 +24,8 @@ ReturnValue_t Q7STestTask::performOneShotAction() { //testScratchApi(); //testJsonLibDirect(); //testDummyParams(); - FsOpCodes opCode = FsOpCodes::ATTEMPT_DIR_REMOVAL_NON_EMPTY; - testFileSystemHandlerDirect(opCode); + //FsOpCodes opCode = FsOpCodes::ATTEMPT_DIR_REMOVAL_NON_EMPTY; + //testFileSystemHandlerDirect(opCode); return TestTask::performOneShotAction(); } diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index 847f6a52..b1ca47d9 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -23,8 +23,8 @@ CoreController::Chip CoreController::currentChip = Chip::NO_CHIP; CoreController::Copy CoreController::currentCopy = Copy::NO_COPY; CoreController::CoreController(object_id_t objectId): - ExtendedControllerBase(objectId, objects::NO_OBJECT, 5), - opDivider(5) { + ExtendedControllerBase(objectId, objects::NO_OBJECT, 5), + opDivider(5) { ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; try { result = initWatchdogFifo(); @@ -49,7 +49,7 @@ CoreController::CoreController(object_id_t objectId): } ReturnValue_t CoreController::handleCommandMessage(CommandMessage *message) { - return HasReturnvaluesIF::RETURN_OK; + return ExtendedControllerBase::handleCommandMessage(message); } void CoreController::performControlOperation() { @@ -74,7 +74,7 @@ ReturnValue_t CoreController::initialize() { "count failed" << std::endl; } - return HasReturnvaluesIF::RETURN_OK; + return ExtendedControllerBase::initialize(); } ReturnValue_t CoreController::checkModeCommand(Mode_t mode, Submode_t submode, @@ -462,6 +462,12 @@ ReturnValue_t CoreController::actionPerformReboot(const uint8_t *data, size_t si } bool rebootSameBootCopy = data[0]; if(rebootSameBootCopy) { +#if OBSW_VERBOSE_LEVEL >= 1 + sif::info << "CoreController::actionPerformReboot: Rebooting on current image" << std::endl; +#endif + // Attempt graceful shutdown by unmounting and switching off SD cards + SdCardManager::instance()->switchOffSdCard(sd::SdCard::SLOT_0); + SdCardManager::instance()->switchOffSdCard(sd::SdCard::SLOT_1); int result = std::system("xsc_boot_copy -r"); if(result != 0) { utility::handleSystemError(result, "CoreController::executeAction"); @@ -472,6 +478,10 @@ ReturnValue_t CoreController::actionPerformReboot(const uint8_t *data, size_t si if(size < 3) { return HasActionsIF::INVALID_PARAMETERS; } +#if OBSW_VERBOSE_LEVEL >= 1 + sif::info << "CoreController::actionPerformReboot: Rebooting on " << + static_cast(data[1]) << " " << static_cast(data[2]) << std::endl; +#endif // The second byte in data is the target chip, the third byte is the target copy std::string cmdString = "xsc_boot_copy " + std::to_string(data[1]) + " " + std::to_string(data[2]); diff --git a/bsp_q7s/memory/FileSystemHandler.cpp b/bsp_q7s/memory/FileSystemHandler.cpp index 159512a0..5a7895da 100644 --- a/bsp_q7s/memory/FileSystemHandler.cpp +++ b/bsp_q7s/memory/FileSystemHandler.cpp @@ -226,7 +226,7 @@ ReturnValue_t FileSystemHandler::removeDirectory(const char *repositoryPath, else { // Check error code. Most probably denied permissions because folder is not empty sif::warning << "FileSystemHandler::removeDirectory: Deleting directory failed with " - "code" << err.value() << ": " << strerror(err.value()) << std::endl; + "code " << err.value() << ": " << strerror(err.value()) << std::endl; if(err.value() == ENOTEMPTY) { return DIRECTORY_NOT_EMPTY; } @@ -242,7 +242,7 @@ ReturnValue_t FileSystemHandler::removeDirectory(const char *repositoryPath, } else { sif::warning << "FileSystemHandler::removeDirectory: Deleting directory failed with " - "code" << err.value() << ": " << strerror(err.value()) << std::endl; + "code " << err.value() << ": " << strerror(err.value()) << std::endl; // Check error code if(err.value() == ENOTEMPTY) { return DIRECTORY_NOT_EMPTY; diff --git a/common/config/commonConfig.h.in b/common/config/commonConfig.h.in index 2b0590c8..52b5dd45 100644 --- a/common/config/commonConfig.h.in +++ b/common/config/commonConfig.h.in @@ -5,6 +5,6 @@ // Use TCP instead of UDP for the TMTC bridge. This allows using the TMTC client locally // because UDP packets are not allowed in the VPN -#define OBSW_USE_TMTC_TCP_BRIDGE 0 +#define OBSW_USE_TMTC_TCP_BRIDGE 1 #endif /* COMMON_CONFIG_COMMONCONFIG_H_ */ diff --git a/fsfw b/fsfw index 0ff81294..296c587e 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 0ff81294e7e209bb4a26171b10d80fe522e65bcf +Subproject commit 296c587e3de10c579847e04af3176b3acaa2d701 diff --git a/tmtc b/tmtc index 477743f6..bc32472d 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 477743f6264689327528beb5344c39247af6c49e +Subproject commit bc32472d88a0d7a1566f53c05a1bc49f3c377985