Compare commits
49 Commits
Author | SHA1 | Date | |
---|---|---|---|
dea3077f29
|
|||
d687715bcb | |||
e2cd822e9c
|
|||
0e9035d6c1
|
|||
c80eff4922 | |||
a5c9e1481b
|
|||
e19ddcfbd8
|
|||
add079a7c6 | |||
9cdcd47b1a
|
|||
dd5270e974 | |||
56ea9af615 | |||
4fc999e102 | |||
04d24e74b1 | |||
8137c9ea25 | |||
723b4bba3f | |||
8cff2fd6f7 | |||
a1f7f77e01 | |||
f3aab775f3 | |||
59d542ab39 | |||
7b0285c4ce | |||
0a77ee0508 | |||
51cbe46cf5 | |||
26fc4b8add | |||
825de04f3b
|
|||
33985937b7
|
|||
ba36b5f091 | |||
4f5903227e
|
|||
2173d89047
|
|||
0a12dbf2be
|
|||
ad3c0e2a0e
|
|||
03e772246f
|
|||
25da131653
|
|||
4c6b098f42 | |||
b57283101b | |||
9dfdf38822 | |||
c6240285e2 | |||
87c05705ec | |||
c881b36630 | |||
a380ff5ac9 | |||
4d17184fba | |||
d8efd05a88 | |||
4c63fed69d | |||
eb27ab4bb0 | |||
b0a38136c1 | |||
b5cc430b5b | |||
27f77799a6 | |||
9080e7cbe4 | |||
6c39e7dd0c | |||
1cc62238c2 |
31
CHANGELOG.md
31
CHANGELOG.md
@ -16,11 +16,38 @@ will consitute of a breaking change warranting a new major release:
|
|||||||
|
|
||||||
# [unreleased]
|
# [unreleased]
|
||||||
|
|
||||||
# [v6.0.0] to be released
|
# [v6.0.0] 2023-07-02
|
||||||
|
|
||||||
|
- `q7s-package` version v3.2.0
|
||||||
- Important bugfixes for PTME. See `q7s-package` CHANGELOG.
|
- Important bugfixes for PTME. See `q7s-package` CHANGELOG.
|
||||||
|
|
||||||
# [v5.1.0] to be released
|
## Changed
|
||||||
|
|
||||||
|
- Added back PTME busy bit polling. This is necessary due to changes to the AXI APB interface
|
||||||
|
to the PTME core.
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- For the live channel (VC0), telemetry was still only dumped if the transmitter is active.
|
||||||
|
Please note that this fix will lead to crashes for FW versions below v3.2.
|
||||||
|
However, it might not be an issue for the oldest firmware on the satellite (v2.5.1).
|
||||||
|
|
||||||
|
# [v5.2.0] 2023-07-02
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- The firmware information event was not triggered even when possible because of an ordering
|
||||||
|
bug in the initializer function.
|
||||||
|
- Empty dumps (no TM in time range) will now correctly be completed immediately
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- PTME was always reset on submode changes. The reset will now only be performed if the actual data
|
||||||
|
rate changes.
|
||||||
|
- Add back ACS board code for the EM. Now that the radiation sensor was removed, the image switching
|
||||||
|
issue has disappeared and adding back the ACS board is worth it for the GPS timekeeping.
|
||||||
|
|
||||||
|
# [v5.1.0] 2023-06-28
|
||||||
|
|
||||||
- `eive-tmtc` version v5.1.0
|
- `eive-tmtc` version v5.1.0
|
||||||
|
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
# ##############################################################################
|
# ##############################################################################
|
||||||
cmake_minimum_required(VERSION 3.13)
|
cmake_minimum_required(VERSION 3.13)
|
||||||
|
|
||||||
set(OBSW_VERSION_MAJOR 5)
|
set(OBSW_VERSION_MAJOR 6)
|
||||||
set(OBSW_VERSION_MINOR 1)
|
set(OBSW_VERSION_MINOR 0)
|
||||||
set(OBSW_VERSION_REVISION 0)
|
set(OBSW_VERSION_REVISION 0)
|
||||||
|
|
||||||
# set(CMAKE_VERBOSE TRUE)
|
# set(CMAKE_VERBOSE TRUE)
|
||||||
@ -105,7 +105,7 @@ set(OBSW_ADD_THERMAL_TEMP_INSERTER
|
|||||||
${OBSW_Q7S_EM}
|
${OBSW_Q7S_EM}
|
||||||
CACHE STRING "Add thermal sensor temperature inserter")
|
CACHE STRING "Add thermal sensor temperature inserter")
|
||||||
set(OBSW_ADD_ACS_BOARD
|
set(OBSW_ADD_ACS_BOARD
|
||||||
${INIT_VAL}
|
1
|
||||||
CACHE STRING "Add ACS board module")
|
CACHE STRING "Add ACS board module")
|
||||||
set(OBSW_ADD_GPS_CTRL
|
set(OBSW_ADD_GPS_CTRL
|
||||||
${INIT_VAL}
|
${INIT_VAL}
|
||||||
|
@ -964,6 +964,12 @@ used by other software components to read the current chip and copy.
|
|||||||
This is a configuration scripts which runs after the Network Time Protocol has run. This script
|
This is a configuration scripts which runs after the Network Time Protocol has run. This script
|
||||||
currently sets the static IP address `192.168.133.10` and starts the `can` interface.
|
currently sets the static IP address `192.168.133.10` and starts the `can` interface.
|
||||||
|
|
||||||
|
## Initial boot delay
|
||||||
|
|
||||||
|
You can create a file named `boot_delays_secs.txt` inside the home folder to delay the OBSW boot
|
||||||
|
for 6 seconds if the file is empty of for the number of seconds specified inside the file. This
|
||||||
|
can be helpful if something inside the OBSW leads to an immediate crash of the OBC.
|
||||||
|
|
||||||
## PCDU
|
## PCDU
|
||||||
|
|
||||||
Connect to serial console of P60 Dock
|
Connect to serial console of P60 Dock
|
||||||
|
@ -85,13 +85,9 @@ static constexpr char EN_RW_4[] = "enable_rw_4";
|
|||||||
static constexpr char RAD_SENSOR_CHIP_SELECT[] = "rad_sensor_chip_select";
|
static constexpr char RAD_SENSOR_CHIP_SELECT[] = "rad_sensor_chip_select";
|
||||||
static constexpr char ENABLE_RADFET[] = "enable_radfet";
|
static constexpr char ENABLE_RADFET[] = "enable_radfet";
|
||||||
|
|
||||||
static constexpr char PAPB_BUSY_SIGNAL_VC0[] = "papb_busy_signal_vc0";
|
|
||||||
static constexpr char PAPB_EMPTY_SIGNAL_VC0[] = "papb_empty_signal_vc0";
|
static constexpr char PAPB_EMPTY_SIGNAL_VC0[] = "papb_empty_signal_vc0";
|
||||||
static constexpr char PAPB_BUSY_SIGNAL_VC1[] = "papb_busy_signal_vc1";
|
|
||||||
static constexpr char PAPB_EMPTY_SIGNAL_VC1[] = "papb_empty_signal_vc1";
|
static constexpr char PAPB_EMPTY_SIGNAL_VC1[] = "papb_empty_signal_vc1";
|
||||||
static constexpr char PAPB_BUSY_SIGNAL_VC2[] = "papb_busy_signal_vc2";
|
|
||||||
static constexpr char PAPB_EMPTY_SIGNAL_VC2[] = "papb_empty_signal_vc2";
|
static constexpr char PAPB_EMPTY_SIGNAL_VC2[] = "papb_empty_signal_vc2";
|
||||||
static constexpr char PAPB_BUSY_SIGNAL_VC3[] = "papb_busy_signal_vc3";
|
|
||||||
static constexpr char PAPB_EMPTY_SIGNAL_VC3[] = "papb_empty_signal_vc3";
|
static constexpr char PAPB_EMPTY_SIGNAL_VC3[] = "papb_empty_signal_vc3";
|
||||||
|
|
||||||
static constexpr char PTME_RESETN[] = "ptme_resetn";
|
static constexpr char PTME_RESETN[] = "ptme_resetn";
|
||||||
|
@ -170,9 +170,6 @@ ReturnValue_t CoreController::initialize() {
|
|||||||
|
|
||||||
sdStateMachine();
|
sdStateMachine();
|
||||||
|
|
||||||
triggerEvent(core::REBOOT_SW, CURRENT_CHIP, CURRENT_COPY);
|
|
||||||
announceCurrentImageInfo();
|
|
||||||
announceVersionInfo();
|
|
||||||
EventManagerIF *eventManager =
|
EventManagerIF *eventManager =
|
||||||
ObjectManager::instance()->get<EventManagerIF>(objects::EVENT_MANAGER);
|
ObjectManager::instance()->get<EventManagerIF>(objects::EVENT_MANAGER);
|
||||||
if (eventManager == nullptr or eventQueue == nullptr) {
|
if (eventManager == nullptr or eventQueue == nullptr) {
|
||||||
@ -189,17 +186,22 @@ ReturnValue_t CoreController::initialize() {
|
|||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
sif::warning << "Subscribing for GPS GPS_FIX_CHANGE event failed" << std::endl;
|
sif::warning << "Subscribing for GPS GPS_FIX_CHANGE event failed" << std::endl;
|
||||||
}
|
}
|
||||||
|
triggerEvent(core::REBOOT_SW, CURRENT_CHIP, CURRENT_COPY);
|
||||||
|
announceCurrentImageInfo();
|
||||||
|
// This has to come before the version announce because it might be required for retrieving
|
||||||
|
// the firmware version.
|
||||||
if (common::OBSW_VERSION_MAJOR >= 6 or common::OBSW_VERSION_MAJOR == 4) {
|
if (common::OBSW_VERSION_MAJOR >= 6 or common::OBSW_VERSION_MAJOR == 4) {
|
||||||
UioMapper sysRomMapper(q7s::UIO_SYS_ROM);
|
UioMapper sysRomMapper(q7s::UIO_SYS_ROM);
|
||||||
result = sysRomMapper.getMappedAdress(&mappedSysRomAddr, UioMapper::Permissions::READ_ONLY);
|
result = sysRomMapper.getMappedAdress(&mappedSysRomAddr, UioMapper::Permissions::READ_ONLY);
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
// TODO: This might be a reason to switch to another image..
|
// TODO: This might be a reason to switch to another image..
|
||||||
sif::error << "Getting mapped SYS ROM UIO address failed" << std::endl;
|
sif::error << "Getting mapped SYS ROM UIO address failed" << std::endl;
|
||||||
return ObjectManager::CHILD_INIT_FAILED;
|
result = ObjectManager::CHILD_INIT_FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return returnvalue::OK;
|
announceVersionInfo();
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t CoreController::initializeAfterTaskCreation() {
|
ReturnValue_t CoreController::initializeAfterTaskCreation() {
|
||||||
|
@ -731,20 +731,12 @@ ReturnValue_t ObjectFactory::createCcsdsComponents(CcsdsComponentArgs& args) {
|
|||||||
// GPIO definitions of signals connected to the virtual channel interfaces of the PTME IP Core
|
// GPIO definitions of signals connected to the virtual channel interfaces of the PTME IP Core
|
||||||
GpioCookie* gpioCookiePtmeIp = new GpioCookie;
|
GpioCookie* gpioCookiePtmeIp = new GpioCookie;
|
||||||
GpiodRegularByLineName* gpio = nullptr;
|
GpiodRegularByLineName* gpio = nullptr;
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_BUSY_SIGNAL_VC0, "PAPB VC0");
|
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC0_PAPB_BUSY, gpio);
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC0, "PAPB VC0");
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC0, "PAPB VC0");
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC0_PAPB_EMPTY, gpio);
|
gpioCookiePtmeIp->addGpio(gpioIds::VC0_PAPB_EMPTY, gpio);
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_BUSY_SIGNAL_VC1, "PAPB VC1");
|
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC1_PAPB_BUSY, gpio);
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC1, "PAPB VC1");
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC1, "PAPB VC1");
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC1_PAPB_EMPTY, gpio);
|
gpioCookiePtmeIp->addGpio(gpioIds::VC1_PAPB_EMPTY, gpio);
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_BUSY_SIGNAL_VC2, "PAPB VC2");
|
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC2_PAPB_BUSY, gpio);
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC2, "PAPB VC2");
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC2, "PAPB VC2");
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC2_PAPB_EMPTY, gpio);
|
gpioCookiePtmeIp->addGpio(gpioIds::VC2_PAPB_EMPTY, gpio);
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_BUSY_SIGNAL_VC3, "PAPB VC3");
|
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC3_PAPB_BUSY, gpio);
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC3, "PAPB VC3");
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC3, "PAPB VC3");
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC3_PAPB_EMPTY, gpio);
|
gpioCookiePtmeIp->addGpio(gpioIds::VC3_PAPB_EMPTY, gpio);
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PTME_RESETN, "PTME RESETN",
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PTME_RESETN, "PTME RESETN",
|
||||||
@ -753,19 +745,14 @@ ReturnValue_t ObjectFactory::createCcsdsComponents(CcsdsComponentArgs& args) {
|
|||||||
gpioChecker(args.gpioComIF.addGpios(gpioCookiePtmeIp), "PTME PAPB VCs");
|
gpioChecker(args.gpioComIF.addGpios(gpioCookiePtmeIp), "PTME PAPB VCs");
|
||||||
|
|
||||||
// Creating virtual channel interfaces
|
// Creating virtual channel interfaces
|
||||||
VirtualChannelIF* vc0 =
|
VirtualChannelIF* vc0 = new PapbVcInterface(&args.gpioComIF, gpioIds::VC0_PAPB_EMPTY,
|
||||||
new PapbVcInterface(&args.gpioComIF, gpioIds::VC0_PAPB_BUSY, gpioIds::VC0_PAPB_EMPTY,
|
q7s::UIO_PTME, q7s::uiomapids::PTME_VC0);
|
||||||
q7s::UIO_PTME, q7s::uiomapids::PTME_VC0);
|
VirtualChannelIF* vc1 = new PapbVcInterface(&args.gpioComIF, gpioIds::VC1_PAPB_EMPTY,
|
||||||
VirtualChannelIF* vc1 =
|
q7s::UIO_PTME, q7s::uiomapids::PTME_VC1);
|
||||||
new PapbVcInterface(&args.gpioComIF, gpioIds::VC1_PAPB_BUSY, gpioIds::VC1_PAPB_EMPTY,
|
VirtualChannelIF* vc2 = new PapbVcInterface(&args.gpioComIF, gpioIds::VC2_PAPB_EMPTY,
|
||||||
q7s::UIO_PTME, q7s::uiomapids::PTME_VC1);
|
q7s::UIO_PTME, q7s::uiomapids::PTME_VC2);
|
||||||
VirtualChannelIF* vc2 =
|
VirtualChannelIF* vc3 = new PapbVcInterface(&args.gpioComIF, gpioIds::VC3_PAPB_EMPTY,
|
||||||
new PapbVcInterface(&args.gpioComIF, gpioIds::VC2_PAPB_BUSY, gpioIds::VC2_PAPB_EMPTY,
|
q7s::UIO_PTME, q7s::uiomapids::PTME_VC3);
|
||||||
q7s::UIO_PTME, q7s::uiomapids::PTME_VC2);
|
|
||||||
VirtualChannelIF* vc3 =
|
|
||||||
new PapbVcInterface(&args.gpioComIF, gpioIds::VC3_PAPB_BUSY, gpioIds::VC3_PAPB_EMPTY,
|
|
||||||
q7s::UIO_PTME, q7s::uiomapids::PTME_VC3);
|
|
||||||
|
|
||||||
// Creating ptme object and adding virtual channel interfaces
|
// Creating ptme object and adding virtual channel interfaces
|
||||||
Ptme* ptme = new Ptme(objects::PTME);
|
Ptme* ptme = new Ptme(objects::PTME);
|
||||||
ptme->addVcInterface(ccsds::VC0, vc0);
|
ptme->addVcInterface(ccsds::VC0, vc0);
|
||||||
|
@ -84,9 +84,10 @@ void ObjectFactory::produce(void* args) {
|
|||||||
|
|
||||||
new CoreController(objects::CORE_CONTROLLER, enableHkSets);
|
new CoreController(objects::CORE_CONTROLLER, enableHkSets);
|
||||||
|
|
||||||
#if OBSW_ADD_ACS_BOARD == 1
|
// Initialize chip select to avoid SPI bus issues.
|
||||||
// Still initialize chip select to avoid SPI bus issues.
|
|
||||||
createRadSensorChipSelect(gpioComIF);
|
createRadSensorChipSelect(gpioComIF);
|
||||||
|
|
||||||
|
#if OBSW_ADD_ACS_BOARD == 1
|
||||||
createAcsBoardComponents(*spiMainComIF, gpioComIF, uartComIF, *pwrSwitcher, true,
|
createAcsBoardComponents(*spiMainComIF, gpioComIF, uartComIF, *pwrSwitcher, true,
|
||||||
adis1650x::Type::ADIS16507);
|
adis1650x::Type::ADIS16507);
|
||||||
#else
|
#else
|
||||||
|
@ -96,13 +96,9 @@ enum gpioId_t {
|
|||||||
|
|
||||||
SPI_MUX,
|
SPI_MUX,
|
||||||
VC0_PAPB_EMPTY,
|
VC0_PAPB_EMPTY,
|
||||||
VC0_PAPB_BUSY,
|
|
||||||
VC1_PAPB_EMPTY,
|
VC1_PAPB_EMPTY,
|
||||||
VC1_PAPB_BUSY,
|
|
||||||
VC2_PAPB_EMPTY,
|
VC2_PAPB_EMPTY,
|
||||||
VC2_PAPB_BUSY,
|
|
||||||
VC3_PAPB_EMPTY,
|
VC3_PAPB_EMPTY,
|
||||||
VC3_PAPB_BUSY,
|
|
||||||
PTME_RESETN,
|
PTME_RESETN,
|
||||||
|
|
||||||
PDEC_RESET,
|
PDEC_RESET,
|
||||||
|
@ -16,9 +16,9 @@ AxiPtmeConfig::AxiPtmeConfig(object_id_t objectId, std::string axiUio, int mapNu
|
|||||||
AxiPtmeConfig::~AxiPtmeConfig() {}
|
AxiPtmeConfig::~AxiPtmeConfig() {}
|
||||||
|
|
||||||
ReturnValue_t AxiPtmeConfig::initialize() {
|
ReturnValue_t AxiPtmeConfig::initialize() {
|
||||||
ReturnValue_t result = returnvalue::OK;
|
|
||||||
UioMapper uioMapper(axiUio, mapNum);
|
UioMapper uioMapper(axiUio, mapNum);
|
||||||
result = uioMapper.getMappedAdress(&baseAddress, UioMapper::Permissions::READ_WRITE);
|
ReturnValue_t result =
|
||||||
|
uioMapper.getMappedAdress(&baseAddress, UioMapper::Permissions::READ_WRITE);
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -26,8 +26,7 @@ ReturnValue_t AxiPtmeConfig::initialize() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t AxiPtmeConfig::writeCaduRateReg(uint8_t rateVal) {
|
ReturnValue_t AxiPtmeConfig::writeCaduRateReg(uint8_t rateVal) {
|
||||||
ReturnValue_t result = returnvalue::OK;
|
ReturnValue_t result = mutex->lockMutex(timeoutType, mutexTimeout);
|
||||||
result = mutex->lockMutex(timeoutType, mutexTimeout);
|
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
sif::warning << "AxiPtmeConfig::writeCaduRateReg: Failed to lock mutex" << std::endl;
|
sif::warning << "AxiPtmeConfig::writeCaduRateReg: Failed to lock mutex" << std::endl;
|
||||||
return returnvalue::FAILED;
|
return returnvalue::FAILED;
|
||||||
@ -41,6 +40,11 @@ ReturnValue_t AxiPtmeConfig::writeCaduRateReg(uint8_t rateVal) {
|
|||||||
return returnvalue::OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8_t AxiPtmeConfig::readCaduRateReg() {
|
||||||
|
MutexGuard mg(mutex);
|
||||||
|
return static_cast<uint8_t>(*(baseAddress + CADU_BITRATE_REG));
|
||||||
|
}
|
||||||
|
|
||||||
void AxiPtmeConfig::enableTxclockManipulator() {
|
void AxiPtmeConfig::enableTxclockManipulator() {
|
||||||
writeBit(COMMON_CONFIG_REG, true, BitPos::EN_TX_CLK_MANIPULATOR);
|
writeBit(COMMON_CONFIG_REG, true, BitPos::EN_TX_CLK_MANIPULATOR);
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,7 @@ class AxiPtmeConfig : public SystemObject {
|
|||||||
* frequency of the clock connected to the bit clock input of PTME.
|
* frequency of the clock connected to the bit clock input of PTME.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t writeCaduRateReg(uint8_t rateVal);
|
ReturnValue_t writeCaduRateReg(uint8_t rateVal);
|
||||||
|
uint8_t readCaduRateReg();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Next to functions control the tx clock manipulator component
|
* @brief Next to functions control the tx clock manipulator component
|
||||||
|
@ -7,20 +7,16 @@
|
|||||||
|
|
||||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||||
|
|
||||||
PapbVcInterface::PapbVcInterface(LinuxLibgpioIF* gpioComIF, gpioId_t papbBusyId,
|
PapbVcInterface::PapbVcInterface(LinuxLibgpioIF* gpioComIF, gpioId_t papbEmptyId,
|
||||||
gpioId_t papbEmptyId, std::string uioFile, int mapNum)
|
std::string uioFile, int mapNum)
|
||||||
: gpioComIF(gpioComIF),
|
: gpioComIF(gpioComIF), papbEmptyId(papbEmptyId), uioFile(std::move(uioFile)), mapNum(mapNum) {}
|
||||||
papbBusyId(papbBusyId),
|
|
||||||
papbEmptyId(papbEmptyId),
|
|
||||||
uioFile(std::move(uioFile)),
|
|
||||||
mapNum(mapNum) {}
|
|
||||||
|
|
||||||
PapbVcInterface::~PapbVcInterface() {}
|
PapbVcInterface::~PapbVcInterface() {}
|
||||||
|
|
||||||
ReturnValue_t PapbVcInterface::initialize() {
|
ReturnValue_t PapbVcInterface::initialize() {
|
||||||
UioMapper uioMapper(uioFile, mapNum);
|
UioMapper uioMapper(uioFile, mapNum);
|
||||||
ReturnValue_t result = uioMapper.getMappedAdress(const_cast<uint32_t**>(&vcBaseReg),
|
ReturnValue_t result = uioMapper.getMappedAdress(const_cast<uint32_t**>(&vcBaseReg),
|
||||||
UioMapper::Permissions::WRITE_ONLY);
|
UioMapper::Permissions::READ_WRITE);
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -32,63 +28,27 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size) {
|
|||||||
if (size < 4) {
|
if (size < 4) {
|
||||||
return returnvalue::FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
if (pollInterfaceReadiness(0, true) == returnvalue::OK) {
|
if (pollReadyForPacket()) {
|
||||||
startPacketTransfer(ByteWidthCfg::ONE);
|
startPacketTransfer(ByteWidthCfg::ONE);
|
||||||
} else {
|
} else {
|
||||||
return DirectTmSinkIF::IS_BUSY;
|
return DirectTmSinkIF::IS_BUSY;
|
||||||
}
|
}
|
||||||
// TODO: This should work but does not.. :(
|
if (not pollReadyForOctet(MAX_BUSY_POLLS)) {
|
||||||
// size_t idx = 0;
|
|
||||||
// while (idx < size) {
|
|
||||||
//
|
|
||||||
// nanosleep(&BETWEEN_POLL_DELAY, &remDelay);
|
|
||||||
// if ((size - idx) < 4) {
|
|
||||||
// *vcBaseReg = CONFIG_DATA_INPUT | (size - idx - 1);
|
|
||||||
// usleep(1);
|
|
||||||
// }
|
|
||||||
// if (pollPapbBusySignal(2) == returnvalue::OK) {
|
|
||||||
// // vcBaseReg + DATA_REG_OFFSET + 3 = static_cast<uint8_t>(data + idx);
|
|
||||||
// // vcBaseReg + DATA_REG_OFFSET + 2 = static_cast<uint8_t>(data + idx + 1);
|
|
||||||
// // vcBaseReg + DATA_REG_OFFSET + 1 = static_cast<uint8_t>(data + idx + 2);
|
|
||||||
// // vcBaseReg + DATA_REG_OFFSET = static_cast<uint8_t>(data + idx + 3);
|
|
||||||
//
|
|
||||||
// // std::memcpy((vcBaseReg + DATA_REG_OFFSET), data + idx , nextWriteSize);
|
|
||||||
// *(vcBaseReg + DATA_REG_OFFSET) = *reinterpret_cast<const uint32_t*>(data + idx);
|
|
||||||
// //uint8_t* byteReg = reinterpret_cast<uint8_t*>(vcBaseReg + DATA_REG_OFFSET);
|
|
||||||
//
|
|
||||||
// //byteReg[0] = data[idx];
|
|
||||||
// //byteReg[1] = data[idx];
|
|
||||||
// } else {
|
|
||||||
// abortPacketTransfer();
|
|
||||||
// return returnvalue::FAILED;
|
|
||||||
// }
|
|
||||||
// // TODO: Change this after the bugfix. Right now, the PAPB ignores the content of the byte
|
|
||||||
// // width configuration.5
|
|
||||||
// // It's okay to increment by a larger amount for the last segment here, loop will be over
|
|
||||||
// // in any case.
|
|
||||||
// idx += 4;
|
|
||||||
// }
|
|
||||||
for (size_t idx = 0; idx < size; idx++) {
|
|
||||||
// This delay is super-important, DO NOT REMOVE!
|
|
||||||
// Polling the GPIO or the config register too often messes up the scheduler.
|
|
||||||
// TODO: Maybe this should not be done like this. It would be better if there was a custom
|
|
||||||
// FPGA module which can accept packets and then takes care of dumping that packet into
|
|
||||||
// the PTME. DMA would be an ideal solution for this.
|
|
||||||
nanosleep(&BETWEEN_POLL_DELAY, &remDelay);
|
|
||||||
if (pollInterfaceReadiness(2, false) == returnvalue::OK) {
|
|
||||||
*(vcBaseReg + DATA_REG_OFFSET) = static_cast<uint32_t>(data[idx]);
|
|
||||||
} else {
|
|
||||||
abortPacketTransfer();
|
|
||||||
return returnvalue::FAILED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
nanosleep(&BETWEEN_POLL_DELAY, &remDelay);
|
|
||||||
if (pollInterfaceReadiness(2, false) == returnvalue::OK) {
|
|
||||||
completePacketTransfer();
|
|
||||||
} else {
|
|
||||||
abortPacketTransfer();
|
abortPacketTransfer();
|
||||||
return returnvalue::FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
|
for (size_t idx = 0; idx < size; idx++) {
|
||||||
|
if (not pollReadyForOctet(MAX_BUSY_POLLS)) {
|
||||||
|
abortPacketTransfer();
|
||||||
|
return returnvalue::FAILED;
|
||||||
|
}
|
||||||
|
*(vcBaseReg + DATA_REG_OFFSET) = static_cast<uint32_t>(data[idx]);
|
||||||
|
}
|
||||||
|
if (not pollReadyForOctet(MAX_BUSY_POLLS)) {
|
||||||
|
abortPacketTransfer();
|
||||||
|
return returnvalue::FAILED;
|
||||||
|
}
|
||||||
|
completePacketTransfer();
|
||||||
return returnvalue::OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,63 +58,49 @@ void PapbVcInterface::startPacketTransfer(ByteWidthCfg initWidth) {
|
|||||||
|
|
||||||
void PapbVcInterface::completePacketTransfer() { *vcBaseReg = CONFIG_END; }
|
void PapbVcInterface::completePacketTransfer() { *vcBaseReg = CONFIG_END; }
|
||||||
|
|
||||||
ReturnValue_t PapbVcInterface::pollInterfaceReadiness(uint32_t maxPollRetries,
|
bool PapbVcInterface::pollReadyForPacket() const {
|
||||||
bool checkReadyState) const {
|
// Check if PAPB interface is ready to receive data. Use the configuration register for this.
|
||||||
uint32_t busyIdx = 0;
|
// Bit 5, see PTME ptme_001_01-0-7-r2 Table 31.
|
||||||
nextDelay.tv_nsec = FIRST_DELAY_PAPB_POLLING_NS;
|
uint32_t reg = *vcBaseReg;
|
||||||
|
return (reg >> 6) & 0b1;
|
||||||
while (true) {
|
|
||||||
// Check if PAPB interface is ready to receive data. Use the configuration register for this.
|
|
||||||
// Bit 5, see PTME ptme_001_01-0-7-r2 Table 31.
|
|
||||||
uint32_t reg = *vcBaseReg;
|
|
||||||
bool busy = (reg >> 5) & 0b1;
|
|
||||||
bool ready = (reg >> 6) & 0b1;
|
|
||||||
if (not busy) {
|
|
||||||
return returnvalue::OK;
|
|
||||||
}
|
|
||||||
if (checkReadyState and not ready) {
|
|
||||||
return PAPB_BUSY;
|
|
||||||
}
|
|
||||||
|
|
||||||
busyIdx++;
|
|
||||||
if (busyIdx >= maxPollRetries) {
|
|
||||||
return PAPB_BUSY;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ignore signal handling here for now.
|
|
||||||
nanosleep(&nextDelay, &remDelay);
|
|
||||||
// Adaptive delay.
|
|
||||||
if (nextDelay.tv_nsec * 2 <= MAX_DELAY_PAPB_POLLING_NS) {
|
|
||||||
nextDelay.tv_nsec *= 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return returnvalue::OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PapbVcInterface::isVcInterfaceBufferEmpty() {
|
bool PapbVcInterface::isVcInterfaceBufferEmpty() {
|
||||||
ReturnValue_t result = returnvalue::OK;
|
ReturnValue_t result = returnvalue::OK;
|
||||||
gpio::Levels papbEmptyState = gpio::Levels::HIGH;
|
gpio::Levels papbEmptyState = gpio::Levels::HIGH;
|
||||||
|
|
||||||
result = gpioComIF->readGpio(papbEmptyId, papbEmptyState);
|
result = gpioComIF->readGpio(papbEmptyId, papbEmptyState);
|
||||||
|
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
sif::warning << "PapbVcInterface::isVcInterfaceBufferEmpty: Failed to read papb empty signal"
|
sif::error << "PapbVcInterface::isVcInterfaceBufferEmpty: Failed to read papb empty signal"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
return;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (papbEmptyState == gpio::Levels::HIGH) {
|
if (papbEmptyState == gpio::Levels::HIGH) {
|
||||||
sif::debug << "PapbVcInterface::isVcInterfaceBufferEmpty: Buffer is empty" << std::endl;
|
return true;
|
||||||
} else {
|
|
||||||
sif::debug << "PapbVcInterface::isVcInterfaceBufferEmpty: Buffer is not empty" << std::endl;
|
|
||||||
}
|
}
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PapbVcInterface::isBusy() const { return pollInterfaceReadiness(0, true) == PAPB_BUSY; }
|
bool PapbVcInterface::isBusy() const { return not pollReadyForPacket(); }
|
||||||
|
|
||||||
void PapbVcInterface::cancelTransfer() { abortPacketTransfer(); }
|
void PapbVcInterface::cancelTransfer() { abortPacketTransfer(); }
|
||||||
|
|
||||||
|
inline bool PapbVcInterface::pollReadyForOctet(uint32_t maxCycles) const {
|
||||||
|
uint32_t reg;
|
||||||
|
uint32_t idx = 0;
|
||||||
|
while (idx < maxCycles) {
|
||||||
|
reg = *vcBaseReg;
|
||||||
|
// Busy bit.
|
||||||
|
if (not((reg >> 5) & 0b1)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
idx++;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
ReturnValue_t PapbVcInterface::sendTestFrame() {
|
ReturnValue_t PapbVcInterface::sendTestFrame() {
|
||||||
/** Size of one complete transfer frame data field amounts to 1105 bytes */
|
/** Size of one complete transfer frame data field amounts to 1105 bytes */
|
||||||
uint8_t testPacket[1105];
|
uint8_t testPacket[1105];
|
||||||
|
@ -30,8 +30,7 @@ class PapbVcInterface : public VirtualChannelIF {
|
|||||||
* @param uioFile UIO file providing access to the PAPB bus
|
* @param uioFile UIO file providing access to the PAPB bus
|
||||||
* @param mapNum Map number of UIO map associated with this virtual channel
|
* @param mapNum Map number of UIO map associated with this virtual channel
|
||||||
*/
|
*/
|
||||||
PapbVcInterface(LinuxLibgpioIF* gpioComIF, gpioId_t papbBusyId, gpioId_t papbEmptyId,
|
PapbVcInterface(LinuxLibgpioIF* gpioComIF, gpioId_t papbEmptyId, std::string uioFile, int mapNum);
|
||||||
std::string uioFile, int mapNum);
|
|
||||||
virtual ~PapbVcInterface();
|
virtual ~PapbVcInterface();
|
||||||
|
|
||||||
bool isBusy() const override;
|
bool isBusy() const override;
|
||||||
@ -81,11 +80,9 @@ class PapbVcInterface : public VirtualChannelIF {
|
|||||||
|
|
||||||
static constexpr long int FIRST_DELAY_PAPB_POLLING_NS = 10;
|
static constexpr long int FIRST_DELAY_PAPB_POLLING_NS = 10;
|
||||||
static constexpr long int MAX_DELAY_PAPB_POLLING_NS = 40;
|
static constexpr long int MAX_DELAY_PAPB_POLLING_NS = 40;
|
||||||
|
static constexpr uint32_t MAX_BUSY_POLLS = 1000;
|
||||||
|
|
||||||
LinuxLibgpioIF* gpioComIF = nullptr;
|
LinuxLibgpioIF* gpioComIF = nullptr;
|
||||||
|
|
||||||
/** Pulled to low when virtual channel not ready to receive data */
|
|
||||||
gpioId_t papbBusyId = gpio::NO_GPIO;
|
|
||||||
/** High when external buffer memory of virtual channel is empty */
|
/** High when external buffer memory of virtual channel is empty */
|
||||||
gpioId_t papbEmptyId = gpio::NO_GPIO;
|
gpioId_t papbEmptyId = gpio::NO_GPIO;
|
||||||
|
|
||||||
@ -120,13 +117,15 @@ class PapbVcInterface : public VirtualChannelIF {
|
|||||||
*
|
*
|
||||||
* @return returnvalue::OK when ready to receive data else PAPB_BUSY.
|
* @return returnvalue::OK when ready to receive data else PAPB_BUSY.
|
||||||
*/
|
*/
|
||||||
inline ReturnValue_t pollInterfaceReadiness(uint32_t maxPollRetries, bool checkReadyState) const;
|
inline bool pollReadyForPacket() const;
|
||||||
|
|
||||||
|
inline bool pollReadyForOctet(uint32_t maxCycles) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This function can be used for debugging to check whether there are packets in
|
* @brief This function can be used for debugging to check whether there are packets in
|
||||||
* the packet buffer of the virtual channel or not.
|
* the packet buffer of the virtual channel or not.
|
||||||
*/
|
*/
|
||||||
void isVcInterfaceBufferEmpty();
|
bool isVcInterfaceBufferEmpty();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This function sends a complete telemetry transfer frame data field (1105 bytes)
|
* @brief This function sends a complete telemetry transfer frame data field (1105 bytes)
|
||||||
|
@ -26,6 +26,11 @@ ReturnValue_t PtmeConfig::setRate(uint32_t bitRate) {
|
|||||||
return axiPtmeConfig->writeCaduRateReg(static_cast<uint8_t>(rateVal));
|
return axiPtmeConfig->writeCaduRateReg(static_cast<uint8_t>(rateVal));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t PtmeConfig::getRate() {
|
||||||
|
uint8_t rateReg = axiPtmeConfig->readCaduRateReg();
|
||||||
|
return (BIT_CLK_FREQ / (rateReg + 1));
|
||||||
|
}
|
||||||
|
|
||||||
void PtmeConfig::invertTxClock(bool invert) {
|
void PtmeConfig::invertTxClock(bool invert) {
|
||||||
if (invert) {
|
if (invert) {
|
||||||
axiPtmeConfig->enableTxclockInversion();
|
axiPtmeConfig->enableTxclockInversion();
|
||||||
|
@ -32,6 +32,7 @@ class PtmeConfig : public SystemObject {
|
|||||||
* of the CADU clock due to the convolutional code added by the s-Band transceiver.
|
* of the CADU clock due to the convolutional code added by the s-Band transceiver.
|
||||||
*/
|
*/
|
||||||
ReturnValue_t setRate(uint32_t bitRate);
|
ReturnValue_t setRate(uint32_t bitRate);
|
||||||
|
uint32_t getRate();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Will change the time the tx data signal is updated with respect to the tx clock
|
* @brief Will change the time the tx data signal is updated with respect to the tx clock
|
||||||
|
@ -246,7 +246,13 @@ ReturnValue_t CcsdsIpCoreHandler::checkModeCommand(Mode_t mode, Submode_t submod
|
|||||||
void CcsdsIpCoreHandler::startTransition(Mode_t mode, Submode_t submode) {
|
void CcsdsIpCoreHandler::startTransition(Mode_t mode, Submode_t submode) {
|
||||||
triggerEvent(CHANGING_MODE, mode, submode);
|
triggerEvent(CHANGING_MODE, mode, submode);
|
||||||
if (mode == HasModesIF::MODE_ON) {
|
if (mode == HasModesIF::MODE_ON) {
|
||||||
if (this->submode != submode) {
|
uint32_t currentRate = ptmeConfig.getRate();
|
||||||
|
// Check whether the rate actually changes.
|
||||||
|
if ((this->submode != submode) and
|
||||||
|
(((submode == static_cast<Submode_t>(com::CcsdsSubmode::DATARATE_LOW) and
|
||||||
|
(currentRate != RATE_100KBPS))) or
|
||||||
|
((submode == static_cast<Submode_t>(com::CcsdsSubmode::DATARATE_HIGH) and
|
||||||
|
(currentRate != RATE_500KBPS))))) {
|
||||||
initPtmeUpdateAfterXCycles();
|
initPtmeUpdateAfterXCycles();
|
||||||
updateContext.enableTransmitAfterPtmeUpdate = true;
|
updateContext.enableTransmitAfterPtmeUpdate = true;
|
||||||
updateContext.updateClockRate = true;
|
updateContext.updateClockRate = true;
|
||||||
|
@ -19,13 +19,8 @@ LiveTmTask::LiveTmTask(object_id_t objectId, PusTmFunnel& pusFunnel, CfdpTmFunne
|
|||||||
ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) {
|
ReturnValue_t LiveTmTask::performOperation(uint8_t opCode) {
|
||||||
readCommandQueue();
|
readCommandQueue();
|
||||||
while (true) {
|
while (true) {
|
||||||
bool performWriteOp = true;
|
|
||||||
if (mode == MODE_OFF or ptmeLocked) {
|
|
||||||
performWriteOp = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The funnel tasks are scheduled here directly as well.
|
// The funnel tasks are scheduled here directly as well.
|
||||||
ReturnValue_t result = channel.handleNextTm(performWriteOp);
|
ReturnValue_t result = channel.handleNextTm(!ptmeLocked);
|
||||||
if (result == DirectTmSinkIF::IS_BUSY) {
|
if (result == DirectTmSinkIF::IS_BUSY) {
|
||||||
sif::error << "Lost live TM, PAPB busy" << std::endl;
|
sif::error << "Lost live TM, PAPB busy" << std::endl;
|
||||||
}
|
}
|
||||||
|
@ -42,13 +42,7 @@ ReturnValue_t PersistentLogTmStoreTask::performOperation(uint8_t opCode) {
|
|||||||
if (not someonesBusy) {
|
if (not someonesBusy) {
|
||||||
TaskFactory::delayTask(100);
|
TaskFactory::delayTask(100);
|
||||||
} else if (vcBusyDuringDump) {
|
} else if (vcBusyDuringDump) {
|
||||||
// TODO: Might not be necessary
|
|
||||||
sif::debug << "VC busy, delaying" << std::endl;
|
|
||||||
TaskFactory::delayTask(10);
|
TaskFactory::delayTask(10);
|
||||||
} else {
|
|
||||||
// TODO: Would be best to remove this, but not delaying here can lead to evil issues.
|
|
||||||
// Polling the PAPB of the PTME core too often leads to scheuduling issues.
|
|
||||||
TaskFactory::delayTask(2);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,13 +24,7 @@ ReturnValue_t PersistentSingleTmStoreTask::performOperation(uint8_t opCode) {
|
|||||||
if (not busy) {
|
if (not busy) {
|
||||||
TaskFactory::delayTask(100);
|
TaskFactory::delayTask(100);
|
||||||
} else if (dumpContext.vcBusyDuringDump) {
|
} else if (dumpContext.vcBusyDuringDump) {
|
||||||
sif::debug << "VC busy, delaying" << std::endl;
|
|
||||||
// TODO: Might not be necessary
|
|
||||||
TaskFactory::delayTask(10);
|
TaskFactory::delayTask(10);
|
||||||
} else {
|
|
||||||
// TODO: Would be best to remove this, but not delaying here can lead to evil issues.
|
|
||||||
// Polling the PAPB of the PTME core too often leads to scheuduling issues.
|
|
||||||
TaskFactory::delayTask(2);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,13 +45,19 @@ bool TmStoreTaskBase::handleOneStore(PersistentTmStoreWithTmQueue& store,
|
|||||||
} else {
|
} else {
|
||||||
Command_t execCmd;
|
Command_t execCmd;
|
||||||
// Handle TC requests, for example deletion or retrieval requests.
|
// Handle TC requests, for example deletion or retrieval requests.
|
||||||
|
// TODO: Not really clean here.. would be better if the executed command is returns as an
|
||||||
|
// enumeration.
|
||||||
result = store.handleCommandQueue(ipcStore, execCmd);
|
result = store.handleCommandQueue(ipcStore, execCmd);
|
||||||
if (result == returnvalue::OK) {
|
if (execCmd == TmStoreMessage::DOWNLINK_STORE_CONTENT_TIME) {
|
||||||
if (execCmd == TmStoreMessage::DOWNLINK_STORE_CONTENT_TIME) {
|
if (result == PersistentTmStore::DUMP_DONE) {
|
||||||
|
dumpDoneHandler(store, dumpContext);
|
||||||
|
} else if (result == returnvalue::OK) {
|
||||||
cancelDumpCd.resetTimer();
|
cancelDumpCd.resetTimer();
|
||||||
tmSinkBusyCd.resetTimer();
|
tmSinkBusyCd.resetTimer();
|
||||||
dumpContext.reset();
|
dumpContext.reset();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (execCmd != CommandMessageIF::CMD_NONE) {
|
||||||
tcRequestReceived = true;
|
tcRequestReceived = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -119,21 +125,13 @@ ReturnValue_t TmStoreTaskBase::performDump(PersistentTmStoreWithTmQueue& store,
|
|||||||
DumpContext& dumpContext, bool& dumpPerformed) {
|
DumpContext& dumpContext, bool& dumpPerformed) {
|
||||||
size_t dumpedLen = 0;
|
size_t dumpedLen = 0;
|
||||||
|
|
||||||
auto dumpDoneHandler = [&]() {
|
|
||||||
uint32_t startTime;
|
|
||||||
uint32_t endTime;
|
|
||||||
store.getStartAndEndTimeCurrentOrLastDump(startTime, endTime);
|
|
||||||
triggerEvent(dumpContext.eventIfDone, dumpContext.numberOfDumpedPackets,
|
|
||||||
dumpContext.dumpedBytes);
|
|
||||||
dumpContext.reset();
|
|
||||||
};
|
|
||||||
// Dump the next packet into the PTME.
|
// Dump the next packet into the PTME.
|
||||||
dumpContext.ptmeBusyCounter = 0;
|
dumpContext.ptmeBusyCounter = 0;
|
||||||
tmSinkBusyCd.resetTimer();
|
tmSinkBusyCd.resetTimer();
|
||||||
ReturnValue_t result = store.getNextDumpPacket(tmReader, fileHasSwapped);
|
ReturnValue_t result = store.getNextDumpPacket(tmReader, fileHasSwapped);
|
||||||
if (fileHasSwapped and result == PersistentTmStore::DUMP_DONE) {
|
if (fileHasSwapped and result == PersistentTmStore::DUMP_DONE) {
|
||||||
// This can happen if a file is corrupted and the next file swap completes the dump.
|
// This can happen if a file is corrupted and the next file swap completes the dump.
|
||||||
dumpDoneHandler();
|
dumpDoneHandler(store, dumpContext);
|
||||||
return returnvalue::OK;
|
return returnvalue::OK;
|
||||||
} else if (result != returnvalue::OK) {
|
} else if (result != returnvalue::OK) {
|
||||||
sif::error << "PersistentTmStore: Getting next dump packet failed" << std::endl;
|
sif::error << "PersistentTmStore: Getting next dump packet failed" << std::endl;
|
||||||
@ -157,7 +155,7 @@ ReturnValue_t TmStoreTaskBase::performDump(PersistentTmStoreWithTmQueue& store,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (result == PersistentTmStore::DUMP_DONE) {
|
if (result == PersistentTmStore::DUMP_DONE) {
|
||||||
dumpDoneHandler();
|
dumpDoneHandler(store, dumpContext);
|
||||||
}
|
}
|
||||||
return returnvalue::OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
@ -198,6 +196,14 @@ ReturnValue_t TmStoreTaskBase::connectModeTreeParent(HasModeTreeChildrenIF& pare
|
|||||||
return modetree::connectModeTreeParent(parent, *this, nullptr, modeHelper);
|
return modetree::connectModeTreeParent(parent, *this, nullptr, modeHelper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TmStoreTaskBase::dumpDoneHandler(PersistentTmStore& store, DumpContext& dumpContext) {
|
||||||
|
uint32_t startTime;
|
||||||
|
uint32_t endTime;
|
||||||
|
store.getStartAndEndTimeCurrentOrLastDump(startTime, endTime);
|
||||||
|
triggerEvent(dumpContext.eventIfDone, dumpContext.numberOfDumpedPackets, dumpContext.dumpedBytes);
|
||||||
|
dumpContext.reset();
|
||||||
|
}
|
||||||
|
|
||||||
ModeTreeChildIF& TmStoreTaskBase::getModeTreeChildIF() { return *this; }
|
ModeTreeChildIF& TmStoreTaskBase::getModeTreeChildIF() { return *this; }
|
||||||
|
|
||||||
void TmStoreTaskBase::readCommandQueue(void) {
|
void TmStoreTaskBase::readCommandQueue(void) {
|
||||||
|
@ -96,6 +96,8 @@ class TmStoreTaskBase : public SystemObject,
|
|||||||
|
|
||||||
ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode,
|
ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode,
|
||||||
uint32_t* msToReachTheMode) override;
|
uint32_t* msToReachTheMode) override;
|
||||||
|
void dumpDoneHandler(PersistentTmStore& store, DumpContext& dumpContext);
|
||||||
|
|
||||||
void announceMode(bool recursive) override;
|
void announceMode(bool recursive) override;
|
||||||
object_id_t getObjectId() const override;
|
object_id_t getObjectId() const override;
|
||||||
const HasHealthIF* getOptHealthIF() const override;
|
const HasHealthIF* getOptHealthIF() const override;
|
||||||
|
@ -128,6 +128,7 @@ ReturnValue_t PersistentTmStore::assignAndOrCreateMostRecentFile() {
|
|||||||
|
|
||||||
ReturnValue_t PersistentTmStore::handleCommandQueue(StorageManagerIF& ipcStore,
|
ReturnValue_t PersistentTmStore::handleCommandQueue(StorageManagerIF& ipcStore,
|
||||||
Command_t& execCmd) {
|
Command_t& execCmd) {
|
||||||
|
execCmd = CommandMessageIF::CMD_NONE;
|
||||||
CommandMessage cmdMessage;
|
CommandMessage cmdMessage;
|
||||||
ReturnValue_t result = tcQueue->receiveMessage(&cmdMessage);
|
ReturnValue_t result = tcQueue->receiveMessage(&cmdMessage);
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
@ -162,9 +163,9 @@ ReturnValue_t PersistentTmStore::handleCommandQueue(StorageManagerIF& ipcStore,
|
|||||||
result = startDumpFromUpTo(dumpFromUnixSeconds, dumpUntilUnixSeconds);
|
result = startDumpFromUpTo(dumpFromUnixSeconds, dumpUntilUnixSeconds);
|
||||||
if (result == BUSY_DUMPING) {
|
if (result == BUSY_DUMPING) {
|
||||||
triggerEvent(persTmStore::BUSY_DUMPING_EVENT);
|
triggerEvent(persTmStore::BUSY_DUMPING_EVENT);
|
||||||
} else {
|
return result;
|
||||||
execCmd = cmd;
|
|
||||||
}
|
}
|
||||||
|
execCmd = cmd;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@ -359,7 +360,10 @@ ReturnValue_t PersistentTmStore::loadNextDumpFile() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t PersistentTmStore::getNextDumpPacket(PusTmReader& reader, bool& fileHasSwapped) {
|
ReturnValue_t PersistentTmStore::getNextDumpPacket(PusTmReader& reader, bool& fileHasSwapped) {
|
||||||
if (state == State::IDLE or dumpParams.pendingPacketDump) {
|
if (state == State::IDLE) {
|
||||||
|
return DUMP_DONE;
|
||||||
|
}
|
||||||
|
if (dumpParams.pendingPacketDump) {
|
||||||
return returnvalue::FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
fileHasSwapped = false;
|
fileHasSwapped = false;
|
||||||
|
Reference in New Issue
Block a user