An5543 Guidelines For Enhanced Spi Communication On stm32 Mcus and Mpus Stmicroelectronics en
An5543 Guidelines For Enhanced Spi Communication On stm32 Mcus and Mpus Stmicroelectronics en
Application note
Introduction
The serial peripheral interface (SPI) enables easy data transfer between peripherals and the microcontroller. It has a wide range
of specific modes and possible configurations, hence the need for specific handling and settings. An optimized peripheral
handling decreases the overall system load.
This document provides useful information to users targeting specific configurations, and provides tips on how to prevent and
manage the most frequent difficulties encountered when handling SPI communication.
The comparison of different versions implemented on STM32 products can help users considering migration to a new MCU/
MPU.
The reader must be already familiar with the basic SPI principles and peripheral configuration options.
The information given here does not replace that in reference manuals and datasheets available at www.st.com, but rather
complements it. The available SPI features are product dependent, refer to reference manuals and datasheets for their detailed
description.
1 General information
2 Released versions
The SPI peripheral for STM32 devices has evolved over time. The following table summarizes the main
differences between active versions.
1. Derivative instances exist where data size configuration or some other features can be limited. Size of the FIFOs and I2S
audio specific protocol support always depend on the instance implementation.
2. Limited capability; not fully supported.
3. Dependent upon implementation, not available on all products.
Data size
Data size can be fixed and multiply by 8-bit or it can be adjustable by bit.
Dual-clock domain
The older versions use a single-peripheral clock source, which feeds both the peripheral interface and the kernel.
More recent versions feature an autonomous run at low-power mode under kernel or also under external clock in
the cases where the system peripheral interface clock is stopped (refer to Figure 1). This capability is enabled
because in recent versions the kernel clock is separated from the clock feeding the system peripheral bus (APB)
interface.
The SPI hardware interface is based on a pair of physically separated internal shift registers, which handle the
input and output serial bit streams on MOSI and MISO pins, synchronously clocked by the SCK signal.
The SPI configuration (if it operates as a slave or a master) determines which pin works as input or as output, and
whether the SCK clock source is external or internal. As shown in the figure below, data are clocked in and out
through the MISO and MOSI pins via shift registers associated with the RAM storage area providing separated Tx
and Rx buffers. In early SPI versions, each of these buffers is made by a single-data register. More recent SPI
versions feature an extended set of registers, which work under the FIFO principle. The content of the buffers is
accessible via read or write accesses to physically doubled SPI data registers allocated under a sigle common
address in the APB (PCLK) clock domain. All the other peripheral configurations and status registers are allocated
to this domain.
During transmission, once the content of the Tx shift register dedicated to data output is shifted out completely,
the oldest data is moved into it from the associated Tx buffer. The space formerly occupied is released, and the
buffer is ready to accept new data.
During reception, once the Rx shift register dedicated to data input is clocked in completely, the new data frame is
moved from it into the associated Rx buffer.
When the peripheral is configured as slave, the SCK clock is always provided by an external source. When
configured as master, the SCK clock is sourced internally from kernel (providing either the peripheral interface
APB bus clock or a specific separated kernel clock). This clock signal divided by embedded clock baud rate
generator feeds the outer serial interface of the SCK signal mastering communication with the slave nodes.
Config regs
APB bus
Data reg
SCK logic SCK source SCK
Rx buffer
In full-duplex communication, the data handshake for transmission and reception is done in parallel. Each new
data frame write access precedes reading of the corresponding pattern transferred at the same time, because the
transmitted data frame must be available at the Tx buffer before its transfer begins. When no new data are
available, SPI master suspends the communication, but the slave forced to continue operation faces data
underrun. It provides invalid data even without any detection if underrun fetaure is not supported. The next data
can be written into the buffer once there is enough space to store them.
The first bit is always provided out from the Tx buffer, and the data buffered for transmission are moved into to
internal Tx shift register after its first bit is fully transferred out. That is why the value of the first transferred bit is
always dependent on the actual buffer content, while the rest of the data-frame already provided from the
associated shift register is fixed. As a consequence, data output signal can toggle independently on SCK signal
prior and during the first bit transfer period, depending upon the Tx buffer access and its content, and upon clock
configuration.
The transfer between the buffer and the shift register can take place almost immediately after the initial data is
written into the buffer at transfer start, because the buffer becomes empty as soon as the first bit of the data is
transferred. When the buffer has a FIFO with sufficient capacity, it can accept the next data almost immediately.
The receive buffer initially is always empty, as all data are copied into it after the ongoing data frames are
completed.
The following figure provides a simplified example of a continuous SPI communication handled by DMA: the size
of the data corresponds to a single DMA access of the SPI data register. The DMA write stream is completed
earlier than the read stream, while the transfer on the bus can continue after both read and write DMA streams
are completed (if CRC is applied).
Even if not necessary, it is advised to monitor the BSY or EOT/TXC flags at the end of the transfer to prevent
either a premature SPI disable or the kernel clock-source removal. In this case the ongoing flow can be corrupted
or wrongly terminated. The BSY flag becomes low between data frames if the flow is not continuous and it always
drops at slave for a single SCK clock-period between data frames (even if the SCK flow is continuous). The latest
SPI versions replace the BSY signal by the EOT and TXC flags. Single-data handling events signalized by TXE
and RXNE flags are replaced by TXP and RXP or DXP flags, which handle the data packets events. The timing of
these signals is almost the same across all versions. BSY flag monitoring is not suggested to handle the data
flow.
Figure 2. Timing of SPI data events and DMA transfer complete flags during a transfer
MOSI/MISO b0 D1 b0 D2 CRC
TXE/TXP
RXNE/RXP
DMA write HT
DMA write TC
DMA read HT
DMA read TC
BSY/TXC
Even a simplified loop of code like this cannot be executed within eight CPU cycles, despite the C-compiler is
configured for code speed optimization on this Cortex® M3 example. The execution of this loop is critical even
within 16 cycles available with a standard 8-bit data-frame configuration.
If the SPI events are handled by interrupts, the system must perform the same number of cycles to detect the
pending event and for the required memory transfer inside the interrupt service execution as in polling loop. It
spends additional cycles for service entry and return, necessary to safe and restore the interrupted main
execution context at stack. That is why a solution based on interrupts is not useful in this case.
A possible solution is to implement DMA, but the user must not overestimate the bandwidth to provide a real
solution to the problem. DMA still needs a few system cycles to perform the required data transfer, while the
execution of the related service can be postponed because another system operation is ongoing. Each DMA
transfer must first go through the bus matrix arbitration process (winner takes the matrix path to make the
transfer), hence the transfer and the associated arbitration takes up to seven system-clock cycles.
Note that due to a round-robin scheme principle applied to share the bus matrix bandwidth, the transfer request
addressed to DMA can have significant latency after it is raised by the peripheral. The latency can be caused by a
simultaneous request from another DMA channel or by the execution of a non-interruptible data-transfer
sequence performed by the CPU. Examples of such sequences are the stack context handling (either at entry to
or at return from an interrupt service, which normally takes eight cycles), or a simultaneous data-batch transfer
such as a LDMIA instruction execution, which can take up to fourteen consecutive cycles. If all these factors add
up, the delay to serve a pending DMA request can exceed few tens of system-clock cycles, and multiple 4-bit data
frames can be missed on the SPI bus.
In the SPI slave configuration, when a last valid data bit is processed out and the data register of the TxFIFO is
empty (node does not have next data to transfer), the value of the first underrun bit is taken from a previously
transferred pattern. The data correctness is unsure, as the behaviour of the MISO slave output depends on many
factors (clock-phase setting, timing between an occasional late-data write versus the beginning of the next
transfer handled by the SCK signal, value of the underrun candidate bit versus the first new valid one to transmit).
If the CPHA bit is set, the MISO keeps the level of the last valid bit transferred, and the first underrun bit appears
on the bus with the leading SCK edge of the next transaction if no new data are applied. If the CPHA bit is
cleared, the value of potential underrun bit appears on the bus right after the last data transfer is completed, even
if the underrun condition is not yet filled (valid data can still be written in time before the next data-frame
transaction starts). In this case, the MISO line propagates (with possible toggle) the correct level immediately
once the valid data is written into the data register and propagated into the empty SPI Tx buffer while node
becomes ready for the data transfer in this configuration.
A typical observation of a late data-write correlated with the next data frame transfer start is the slave output peak
toggle. This output is present prior or during the transfer of the first bit of a frame still provided by the buffer. This
situation supposes that the value of the adept underrun bit and the corresponding bit at the new data are different,
else there is no toggle and the switch between the underrun and the valid data source is not visible.
The following figure shows a typical deformation of the first bit when the software or the DMA writes late the new
data to be transmitted, while the transfer of the first bit is already ongoing (or close to the moment when the data
transfer starts). For illustration purposes, the valid bit of the next-data frame has opposite value than the underrun
candidate to highlight the change of the MISO signal. The valid bit value is sampled correctly only if the write of
the valid data preceeds the bit sampling edge, else, the underrun adept bit value is wrongly sampled. Wrong
sampling is performed at configuration of CPHA = 0 when the data write comes too late after the sampling is
performed at the beginning of the period.
NO DATA TO TRASMIT (slave LATE VALID DATA WRITE VALID DATA CONTINUES
provides adept of the first (slave starts to apply first bit of (slave provides next bits of
underrun bit) valid data) valid data correctly)
SCK
MISO
(CPHA=0)
MISO
(CPHA=1)
A correct management of value sampling is observed when CPHA = 1, despite the data are written with significant
delay. This is possible due to the fact that sampling is provided later at the middle of the bit period. Correct data
transaction continues for the rest of the data frame at both configuration cases because data is written at the first-
bit transaction period, so the transfer between Tx buffer and Tx shift register is still accepted.
Some effective actions to improve the management of frequent SPI and DMA events are:
• Decrease the bus rate: the ratio between the system and the kernel clock increases.
• Increase the data size.
• Collect data into packets when the software fills in and reads out the data.
• Balance the data register access with the data size and the threshold level of the FIFOs or of the data
configuration setting. More information is detailed in the following section.
• Slow down the data rate leading to discontinuous clock by using fixed or enhanced adaptable methods of
the temporal communication suspension between provided data frames or sessions.
These actions decrease the frequency and the number of data handling events. The system performance
improves, thanks to a better management of their detection.
To decrease the latency when serving the raised events, temporarily disable interrupts or DMA channels from
other peripherals, and set up and order priorities of the DMA channels.
Suppressing interrupts minimizes the CPU contribution in the round-robin bus matrix distribution scheme. The
user must avoid automatic register refresh or memory dump windows during debug to avoid decreasing the BUS
matrix throughput. When DMA interrupts are enabled, the half DMA transfer-completion interrupt must be
suppressed if not used. Servicing this event becomes critical when a small number of continuous data is
transferred by the DMA session or when frequent DMA data-handling services face a bad system performance
(refer to the DMA HT and TC events on Figure 2).
At master side, the data rate flow can be slowed down by opting out from a continuous SCK flow (if applicable).
The latest SPI versions feature optional programmable fixed interleaving gaps between frames, or between the
SS signal that becomes active and first data transfer at session begin, and they can also implement an automatic
suspension of the master. This temporary suspension of the master’s transfers prevents data underflow and
overflow, and can be achieved by monitoring the RxFIFO occupancy (MASRX feature) or by monitoring additional
specific status-ready signal (RDY), which can be optionally provided by the slave. In oldest designs, the handling
of master continuous simplex receiver mode is problematic. It can be replaced by full duplex mode with ignored
data output when communication timing control is done by filling dummy transmission data.
Other features present in latest SPI designs, which simplify the data-handling processes are:
• Capability to set up data counters
• Capability to use an optional coupled dual-flag event to control both transmission and reception of a
common event with a single software service
A dual flag puts in evidence that both transmission and reception flags are active. When a double event like this
one is handled at master level, there is a risk that the flow becomes discontinuous. Discontinuity may occur when
new data is written and its corresponding transfer is started after the previous one is finished, hence the bus
becomes idle.
The dual-flag handling must be avoided in slave mode when the master is continuously providing a clock signal
and the packet size is set close to half of FIFO space. There is a high risk of data underrun, due to a postponed
service of the pending TXP event (which always precedes a RXP event).
The main sense of the DXP appears when targeting low-power applications, especially when the data-handling
services are cumulated and their number is decreased to minimum, which prevents system from its frequent wake
ups. The counterpart for that is slowing down the data rate.
In recent devices, the user can additionally define longer data packets and cumulate series of data-register
accesses on a single event. The number of accesses must correspond to defined threshold of the FIFO. The
events then signal that just the packet service is available and a next sequence of repeated data accesses is
expected. For example, if a 32-bit access is applied to data register, a sequence of three of them must be applied
upon a single packet event when data packet is defined as 12x 8-bit data. This feature helps to limit the number of
data handling events and decreases the system's load in a significant way as data batch is always serviced in a
single run. Internal data exchange between data buffer and shift register is automatically handled based on one
by one data access sequences.
A TXE corresponding to a TXP event is raised once the buffer for transmission can accept the next data
respective to the complete data packet. The transmission buffer is ready once the first bit of the data which is
releasing the necessary space is transferred out.
The Tx buffer may become empty and the SCK clock signal can stop and become non continuous if the master
faces a significant latency when servicing a raised event that releases space in the transmission buffer. When the
same situation happens while the master continues the transfer, the slave faces a data underrun condition.
There is a risk of first-bit corruption whenever the service latency is close to the time needed for a single packed
data transfer, where the next data are written to the empty buffer of the slave when its first bit is already sampled.
Refer to Figure 3 for a related example. This case can also be observed at MISO toggle.
Ideally the packet size should not exceed half of the FIFO space. This configuration allows that a subsequent
additional packet to be applied early after the current packet transfer starts. This allows a big potential margin for
servicing next packet close to a whole single-packet transfer duration.
If the data packet size configuration is equal or almost equal to the overall FIFO space and if there is a continuous
flow on the bus, the available time to store next data or to read the received data becomes similar to a single-data
transfer duration. In this situation, the user must wait until the space corresponding to a complete packet is either
released at the TxFIFO during a transfer or that the space corresponding to a complete packet is fully completed
at receive data side at RxFIFO.
Under the above configuration, even a small service latency may generate a transfer problem and data packing
becomes useless. That type of configuration makes sense for interleaved SPI batches with a number of data to
be completely accommodated at FIFO space. In that case, the application has enough room to handle data once
a batch is completed before the next batch starts.
When the Full-duplex mode is applied, the number of the overall data transferred (transmitted and received) is
balanced. The transferred data goes in parallel with the common clock signal and the handling of both data
directions is shifted each time. Transmission handling must precede the reception handling, otherwise the master
does not start or continue any transaction, and the slave faces underrun whenever there is not available data
ready at the Tx buffer while a transfer is ongoing.
In recent devices, a specific dual flag DXP is applied to enable common services to handle both transmission and
reception flows together. This functionality is especially useful in low-power modes.
Some actions to cope with different timing of the both data flows are:
• Store some data for transmission in advance
• Handle the middle of the transfer by common DXP events
• Finish the session by handling the remaining received data at the end of the session (for example by an
EOT event).
Note: A DXP event interrupt is suppressed by hardware once all the data for transmission is submitted.
The following figure is an example of a TXE/TXP event service latency limit available at slave for DMA. The
example shows a continuous transfer of two consequent data configured with respect to available buffer size what
involves to write D2 in time after D1 data is released from the buffer. The data is released from the buffer once its
first bit is transferred on the bus. If D1 is a data packet, TXP signal (replacing the TXE one then) can raise later
during D1 transfer once a space large enough to accommodate a full D2 packet is released and available at the
buffer to accept new data.
MOSI/MISO b0 D1 b0 D2
DMA writes D1 b0/D2 sampling DMA writes D2 late and too close to the
sampling of the b0/D2 bit
TXE
DMA write TC
Another problem related to peripheral disable is the control of the associated GPIOs:
• Versions 1.x.x: the peripheral takes no control of the associated GPIOs when it is disabled. If the SPI
signals are kept in alternate function configuration, they float if not supported by external resistors.
• Versions 2.x.x and higher: the peripheral can keep the GPIO control even when it is disabled (depending
on IOs alternate function configuration managed by the AFCNTR bit) to prevent unexpected changes of the
associated master outputs especially. In the contrary, when user apply SPI configurations affecting the IOs
configured in the control keeping mode (such as change of the SCK signal polarity), new default levels are
propagated out immediately despite SPI is still disabled. Be careful with desynchronization between master
and slave, and perform the configuration change exclusively when no slave is selected.
SPI must be disabled before the system entries into Halt mode and between the transactions when SPI must be
reconfigured or to restart the internal state machine properly. Even if SPI disable between sessions is not
mandatory when configuration is not changed, it is recommended to ensure correct functionality, especially when
reconfiguration or complex functionalities (CRC calculation, counting data configured to a non standard data size,
counting data whose number is not aligned with a configured data packet, recovery from transaction suspension
done by software) are applied.
The SPI must not be disabled before the communication is fully completed, and it should be as short as possible
at slave, especially between sessions, to prevent missing the next communication start.
The most recent SPI designs are edge sensitive for hardware SS signal detection; if the master provides an active
edge of the SS while the SPI is still temporarily disabled, the slave might miss the start of the slave select-signal
and the following session. This is not the case on older SPI design where the NSS detection is level sensitive.
Figure 5. Examples of window available to perform specific control at the end of a transfer
Control window
Sampling first bit of The transfer ends and optional
the D(n) data CRC upend is done correctly
Sampling first bit of the last Control window The rest of not aligned data is handled
data in the packet correctly under different threshold
RXNE
If the device features programmable data counters, a specific control is done autonomously at the end of each
transfer. In these cases, the user can operate with the last not-complete packet or with a standard complete
packet. Only consistent data are applied (redundant reads give zero data, redundant writes are ignored). If the
number of data is not known, it is better to use a single-data threshold (packet), assuming that the system has
enough performance to handle on time all the data flow one by one. No packet event appears until the complete
packet is received. The user must check the FIFO occupancy flags at the end of the transfer if a not aligned
number of data is received.
As older devices does not feature embedded data counters, it is advised to use DMA and data counters instead.
DMA performs the required control action autonomously at hardware level, hence the risk to miss the available
control window is lower compared to an action performed by software. User must correctly set up the data or
DMA counters to ensure handling of proper number of data on Tx and Rx side (especially when a CRC pattern
has to be added). The size of the CRC pattern must be excluded from the data counting number and the CRC
pattern is received to RxFIFO from which it must be always flushed out by software after the transfer upended by
CRC is finished.
The following table provides an overview of the differences at the CRC settings and capabilities. More details can
be found on the corresponding product's reference manual.
1. In Full duplex mode, DMA Rx counter can be set to include the number of the CRC patterns (1 or 2), as DMA Tx counter
setting prevails to handle the pattern CRC transfer. The pattern is read out from the RxFIFO by DMA. This method cannot
be used in Rx-only mode, where the CRC pattern flushing is handled exclusively by software.
2. The size of the CRC pattern is defined independently from the data size, but it must be either equal to the data size, or an
integer multiple of it. It cannot exceed the maximum data size of the instance. The CRC polynomial size should be greater
than the CRC pattern size to benefit from the CRC calculator capability, otherwise the pattern is upended by some invalid
bits. To achieve full polynomial size coverage, specific additional CRC33_17 bit must be set when maximum data size is
configured for 32- or 16-bit instances. TSIZE can never be set to its maximum value when CRC is enabled.
When SPI is temporarily disabled, the associated GPIOs configured in alternate function output-mode at master
side must remain at defined inactive levels. This need creates a problem on old SPI versions, as the peripheral
leaves them undefined and floating.
Once the SPI is enabled, it may propagate active internal signal levels (such as empty transmit buffer status).
This propagation may force a premature DMA stream request or create a series of initial interrupt services (if
enabled in the configuration). Even a system without any FIFO could raise two consequent data requests when
SPI is enabled and data is released from the buffer once the first bit is transferred out. The buffer raises the next
data write request immediately after the transfer starts (refer to Figure 2).
The SPI enable sequence described in the product reference manual must be followed to ensure a proper events
processing and to avoid missing any event service or a dysfunctional initialization of DMA streams.
Some signals can be evaluated even with significant latency if dual-clock domain is supported. For example, data
underrun at slave side is evaluated under peripheral SCK clock domain, in consequence some traffic on the bus
is necessary to evaluate the status (few additional SCK clock signal cycles are needed). This additional traffic
makes the event to appear considerably later. Undesirable effects like unexpected data insertion may then occur
once the underrrun flag is detected or cleared.
There is an internal synchronization between the APB bus clock and the kernel clock. If there is a big difference
between them, some system responses may be processed with significant delay, causing unavailability of some
features (refer to Section 2.2: SPI frequency constraints).
Most of the SPI instances can wake up the system from low-power modes. If dual-clock domain is available, SPI
can autonomously communicate at low-power mode while all the necessary internal clock requests are
automatically provided at dependency on applied SPI configuration and actual FIFO status.
Recent SPI versions can autonomously initialize transfers by system triggers. This action enables a data transfer
synchronization with other peripheral events without system wake-up. The functionality and wake-up capabilities
are product-dependent, refer to the reference manual for more details.
Revision history
Table 3. Document revision history
Contents
1 General information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2 Released versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
2.1 Differences between SPI versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 SPI frequency constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3 Data flow handling principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
4 Data flow potential problems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.1 System performance and data flow issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.1.1 Recommended methods to handle frequent SPI and DMA events . . . . . . . . . . . . . . . . . . 10
4.1.2 Balanced handling of communication events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.2 Handling specific SPI modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.2.1 End of the bus activity detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.2.2 Specific aspects when SPI is disabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.2.3 Time-critical control at the end of transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.2.4 Handling the Half-duplex mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.3 Handling specific SPI signals. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.3.1 Handling specific internal signals and interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.3.2 Handling optional signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.4 SPI instances with different features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.5 SPI synchronization between nodes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20
List of tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22
List of figures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23
List of tables
Table 1. Main SPI features on STM32 devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Table 2. Differences of CRC control between active SPI versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Table 3. Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
List of figures
Figure 1. Simplified data flow scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Figure 2. Timing of SPI data events and DMA transfer complete flags during a transfer . . . . . . . . . . . . . . . . . . . . . . . . . 6
Figure 3. A late write (underrun) of data while first-bit transfer is ongoing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Figure 4. DMA late service of TXE/TXP event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Figure 5. Examples of window available to perform specific control at the end of a transfer . . . . . . . . . . . . . . . . . . . . . 15