Merge pull request 'Updates for new firmware' (#721) from complete-fw-tests into main-v6
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

Reviewed-on: #721
This commit is contained in:
Robin Müller 2023-07-01 13:30:26 +02:00
commit add079a7c6
4 changed files with 40 additions and 2 deletions

View File

@ -21,6 +21,11 @@ will consitute of a breaking change warranting a new major release:
- `q7s-package` version v3.2.0 - `q7s-package` version v3.2.0
- Important bugfixes for PTME. See `q7s-package` CHANGELOG. - Important bugfixes for PTME. See `q7s-package` CHANGELOG.
## Changed
- Added back PTME busy bit polling. This is necessary due to changes to the AXI APB interface
to the PTME core.
## Fixed ## Fixed
- For the live channel (VC0), telemetry was still only dumped if the transmitter is active. - For the live channel (VC0), telemetry was still only dumped if the transmitter is active.

View File

@ -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

View File

@ -33,10 +33,21 @@ ReturnValue_t PapbVcInterface::write(const uint8_t* data, size_t size) {
} else { } else {
return DirectTmSinkIF::IS_BUSY; return DirectTmSinkIF::IS_BUSY;
} }
if (not pollReadyForOctet(MAX_BUSY_POLLS)) {
abortPacketTransfer();
return returnvalue::FAILED;
}
for (size_t idx = 0; idx < size; idx++) { for (size_t idx = 0; idx < size; idx++) {
// if (pollInterfaceReadiness(2, false) == returnvalue::OK) { if (not pollReadyForOctet(MAX_BUSY_POLLS)) {
abortPacketTransfer();
return returnvalue::FAILED;
}
*(vcBaseReg + DATA_REG_OFFSET) = static_cast<uint32_t>(data[idx]); *(vcBaseReg + DATA_REG_OFFSET) = static_cast<uint32_t>(data[idx]);
} }
if (not pollReadyForOctet(MAX_BUSY_POLLS)) {
abortPacketTransfer();
return returnvalue::FAILED;
}
completePacketTransfer(); completePacketTransfer();
return returnvalue::OK; return returnvalue::OK;
} }
@ -51,7 +62,6 @@ bool PapbVcInterface::pollReadyForPacket() const {
// Check if PAPB interface is ready to receive data. Use the configuration register for this. // 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. // Bit 5, see PTME ptme_001_01-0-7-r2 Table 31.
uint32_t reg = *vcBaseReg; uint32_t reg = *vcBaseReg;
// bool busy = (reg >> 5) & 0b1;
return (reg >> 6) & 0b1; return (reg >> 6) & 0b1;
} }
@ -77,6 +87,20 @@ 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];

View File

@ -80,6 +80,7 @@ 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;
/** High when external buffer memory of virtual channel is empty */ /** High when external buffer memory of virtual channel is empty */
@ -118,6 +119,8 @@ class PapbVcInterface : public VirtualChannelIF {
*/ */
inline bool pollReadyForPacket() 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.