STM32H7 Silicon errata for SPI peripheral

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
dynfer
Posts: 14
Joined: Sun Aug 25, 2024 6:11 pm
Has thanked: 2 times
Been thanked: 5 times

STM32H7 Silicon errata for SPI peripheral

Post by dynfer »

The STM32H7 suffers a silicon bug in the SPI peripheral which results in a garbage byte being read by the peripheral when using DMA.
The ST Errata sheet provides a workaround for this issue in the form of a reset of the peripheral before continuing.

We got a proof of concept fix for the issue below

https://github.com/FOME-Tech/ChibiOS/co ... 8812f52fe7

https://github.com/ChibiOS/ChibiOS/comm ... e45be30b24
Attachments
image.png
Last edited by dynfer on Wed Feb 04, 2026 9:31 am, edited 1 time in total.
mck1117
Posts: 37
Joined: Wed Nov 11, 2020 6:41 am
Has thanked: 1 time
Been thanked: 9 times

Re: STM32H7 Silicon errata for SPI peripheral

Post by mck1117 »

We do it there before a send as well, but I'm pretty sure it's only required before receive or exchange (and should get moved to the spi lld).
User avatar
FXCoder
Posts: 403
Joined: Sun Jun 12, 2016 4:10 am
Has thanked: 188 times
Been thanked: 134 times

Re: STM32H7 Silicon errata for SPI peripheral

Post by FXCoder »

Hi,
The errata states that issue occurs only after a simplex SPI transmission.
ChibiOS SPIv3 driver uses duplex for send and receive with DMA (the receive side acts to terminate a send transaction).
For polled a simple direct write of transmit register is followed by waiting on receive.

So it seems this errata should not apply to ChibiOS SPIv3 (unless there is external use of SPI doing a simplex transmission independently).

--
Bob
mck1117
Posts: 37
Joined: Wed Nov 11, 2020 6:41 am
Has thanked: 1 time
Been thanked: 9 times

Re: STM32H7 Silicon errata for SPI peripheral

Post by mck1117 »

The unmodified SPI MMC driver runs in to this on H7. Here's the github issue where I debugged it and followed it back to the errata sheet: https://github.com/rusefi/rusefi/issues ... -785337711
mck1117
Posts: 37
Joined: Wed Nov 11, 2020 6:41 am
Has thanked: 1 time
Been thanked: 9 times

Re: STM32H7 Silicon errata for SPI peripheral

Post by mck1117 »

If I had to guess, that means the bug isn't exactly "simplex TX followed by DMA RX" but is actually something like "any operation without RX MINC set, followed by an operation with RX MINC set"
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32H7 Silicon errata for SPI peripheral

Post by Giovanni »

Hi,

So, you are running the plain SPI driver and you are still affected by the errata?

I think "RX MINC" is a DMA-level thing, why should the SPI be affected by that?

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32H7 Silicon errata for SPI peripheral

Post by Giovanni »

Probably the best approach would be creating a very simple test applications, using just SPI functions, triggering the problem.

Giovanni
Post Reply