Skip to main content
rich.g.williams
Senior
Oct 19, 2026 11:28 PM UTC
Solved

STM32H5E5 SPI slave: TX shift register width and Tx FIFO to Tx shift register transfer width

I'm using SPI1 on an STM32H5E5 in slave mode, with DSIZE = 32 bits, TSIZE=0 and `FTHLV` configured for four 32-bit frames.

I'm trying to understand the internal transmit pipeline more precisely.

Is the internal TX shift-register width (in bits) or transfer granularity documented anywhere for the STM32H5E5 please?

What is the effective width of the TX shift register, and how does data move from the byte-organised TX FIFO into it?

I would appreciate clarification of the internal TX FIFO to TX shift register data flow please?

For a 16 byte Tx FIFO, assume the TX FIFO is pre filled and full, as transmission begins, data transfers from the TX FIFO into the TX shift register so the Tx FIFO has new space immediately. So the TX FIFO becomes empty before the RX FIFO becomes full. What I'm trying to discover is how many SCLK pulses occur between TX FIFO empty and RX FIFO full. I expected it to be around 32 SCLK's (32 bit) but its closer to 8 SCLK's closer to one byte rather than one word.

Any information explaining this much appreciated.

rich.g.williams
rich.g.williamsBest answer
Senior
Oct 23, 2026 3:20 PM UTC

​@FBL 

In a spirit of Friday afternoon camaraderie - your expert has missed this.

Its actually useful for you ST people to think about this. So please get you expert to have a read through my explanation on Bill’s Notes  billsnotes.co.uk

Yes I thought it would be a 32 bit shift register but it is not.

Starting from:-

  • slave mode
  • full TX FIFO (SPI1 16 bytes)
  • empty RX FIFO
  • when clocking starts TX and RX are tied in that clocking is common to both
  • TX FIFO becomes empty exactly 6.5 SCLK before RX FIFO becomes full

 

So it is not “a delay of 32 bit frame “or 32 SCLK pulses” between these events”

It is a delay of 6.5 SCLK pulses between these events.

Seriously this method I outline could be useful to ST customers.

Please encourage your expert to read my writeup, he or she will have a real eureka moment as the penny drops.

Have a good weekend

Richard

Bill's Notes

13 replies

ST Technical Moderator
Oct 26, 2026 12:22 PM UTC

Hi ​@rich.g.williams 

Thank you for sharing the detailed notes and code. We couldn’t access the link as the source was not trusted.  

The distinction is clear: the TX FIFO and the serial transmit stage are separate, so the TX FIFO status does not indicate that the final data has finished shifting out. The observed interval between TXP and RXP is specific to the configuration and flag timing you describe;

TXP is defined as indicating that at least one complete data packet can be written to the TxFIFO. So TXP guarantees room for one frame. It does not mean FIFO can accept the full 16 byte packet.

 

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.Best regards,FBL
rich.g.williams
Senior
Oct 26, 2026 2:21 PM UTC

​@FBL  Thank you for your patience.

Your answer is consistent with what I have found experimentally.  

For my setup as I have explained it, I know that RXP coincides with exactly 128 SCLK pulses TXP occurs 6.5 SCLK pulses early.

I accept that the TX FIFO and the serial transmit stage are separate. I was trying to discover how many bits are held in the serial transmit stage. My latest tests show that the serial transmit stage is still holding 7 or 8 bits when TXP is asserted. That’s because the TX FIFO becomes empty just after the 123rd SCLK pulse and as mentioned RXP asserts just after the 128th SCLK pulse.

Best regards,

Richard

Bill's Notes
ST Technical Moderator
Oct 28, 2026 4:20 PM UTC

Hi ​@rich.g.williams 

For better performances it is recommended to apply the FTHLV  not taking more than half fifo size(8 bytes)

This means at most two frames 8 bytes per packet. This gives software more time to service the TX and RX FIFOs and helps reduce the risk of underrun or overrun.

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.Best regards,FBL