STM32H753 SPI6 Slave (H7 SPI v2) — Frame qualifies only with NSS-synchronised arming
Hi all,
I’m debugging a reproducible SPI6 slave issue on STM32H753ZI and would like feedback from anyone familiar with H7 SPI v2 behaviour.
Setup
- MCU: STM32H753ZI
- Peripheral: SPI6 slave
- Master: Raspberry Pi 5 (spidev)
- Pins:
- PA5 SCK
- PG8 NSS
- PG12 MISO
- PG14 MOSI
- SPI mode: CPOL=0, CPHA=1 (HAL SPI_PHASE_2EDGE)
- Pinmux verified as AF8 on live registers.
Important context about observed bytes
Initially master read 0xFF consistently; after removing pull-up resistors on the MISO path, reads became 0x00.
This was line-bias behaviour, not a functional fix:
- pull-up + Hi-Z -> 0xFF
- no pull-up/weak low bias + Hi-Z -> 0x00
So the core issue remained: slave not reliably driving/qualifying frames.
What I tested
I instrumented both HAL and LL test images (counters + CR1/CFG1/CFG2/SR + pin-level edge counters).
A/B tests that did not fix it
- NSSPolarity LOW vs HIGH
- AFCNTR 0 vs 1
- soft/hard NSS variants
- IOSwap variants
No meaningful MISO data recovery in continuous host bursts.
Decisive test (single-shot, HAL IT)
Using one-byte HAL_SPI_TransmitReceive_IT single-shot:
-
Unsynchronised arm (arm regardless of current NSS level)
-> irq=0, cplt=0 (no qualified frame) -
Synchronised arm (wait until NSS is inactive/high, then arm)
-> irq>0, cplt=1, expected SCK/NSS edge counts for one frame
This strongly indicates the failure is linked to NSS edge qualification timing in H7 SPI v2 slave:
- if arming occurs late relative to an already-active NSS window, frame is missed
- arming before a fresh inactive->active NSS transition works
Question to the forum
Is this expected/known behaviour on H7 SPI v2 slave, and is the recommended robust approach:
- only arm/re-arm when NSS is confirmed inactive, and
- avoid re-arming inside active CS-low windows (or gate re-arm via NSS edge handling)?
If needed, I can share concise register dumps and test logs.
