Skip to main content
warning

🚧 This document is still being actively worked on and is subject to change. 🚧

Responsible
  • Sebastian Pfeiler
Last Updated10/12/2025, 12:48:54 PM
Last AuthorKai Berszin

SPI during Redundancy Switchover

SignalsActive MCUSupervisor MCUAt peripheralNote
SCLKSCLK_ASCLK_SSCLK_P
NCSNCS_ANCS_SNCS_P
IO0IO0_AIO0_SIO0_PCOPI
IO1IO1_AIO1_SIO1_PCIPO
IO2IO2_AIO2_SIO2_P
IO3IO3_AIO3_SIO3_P
SPI ModeCPOLCPHA
000
101
210
311
CPHASample occurs
0CPOL -> !CPOL
1!CPOL -> CPOL

Assuming Supervisor SPI stays in Idle

Note:
This might not be a valid assumption as a malfuctioning active MCU will be switched to 'supervisor'
While this happens after a reset it might continue to malfunction for some time afterwards.
What is the exact failure model here?

Considering the SPI states for both Supervisor and Active during a RSO:

StatesSPI_A IdleSPI_A Transmitting
SPI_S IdleNo IssueMaybe a Problem
SPI_S TransmittingIllegalIllegal

The supervisor, because it is not connected to the SPI bus should really not be transmitting, the cases are included here for completeness.

SPI_S Idle, SPI_A Idle​

Both MCU's output the same signal on the BUS, a RSO does (likely) not change the Signal levels.

Note:
Likely because the switches actual behaviour during a RSO has not been classified yet.
TODO @spfeiler when FSTL Card is ready.

SPI_S Transmitting, SPI_A Idle​

SPI_P will see the tail end of a transaction.

SPI_S Idle, SPI_A Transmitting​

SPI_P will see the head end of a transaction.

Can an additional Data bit be sampled during an RSO?​

The NCS line will be asserted during the switchover. Likewise the SCLK line will also be returining to CPOL.

If SCLK_A != CPOL then the RSO results in a change in SCLK_P, because SCLK_S is held at CPOL. For CPHA = 1 this results in an additional sample triggering clock edge.

Depending on the arival/sampling of NCS_P this might be considered by the peripheral as an additional data bit being transmitted.

Note:
TODO @spfeiler tested on FSTL Card.

Relevance:
For the Flash QSPI interface 'one' additional sample means potentially introducing 4 incorrect bits. These are not detectable by the FLASH itself as the flash read them from the QSPI and calculates the ECC based on them. For software EDaC 4 error bits are detectable and correctable, which is made easier when we are aware that 4 lsb bits of the last word written to the flash might be incorrect.

SPI_S Transmitting, SPI_A Transmitting​

SPI_P will see a spliced Transaction, where the Head is from SPI_A and the tail is coming from SPI_S.