SPI Slave NSS Interrupt
We are using STM32H743 to implement SPI Slave. We would like to use NSS pin to hardware synchronize the beginning and end of our data packet, which is about 100 bytes long. The reason for that - the SPI wires are long and noisy and we would like to push the speed to the limits. So errors like lost/inserted clock and hence frame bit are possible. Rather than timing out on the entire data packet integrity, NSS wire comes very handy. Many hardware manufactures use NSS for exactly same purpose: to signal the beginning and/or end of the command packet.
Is there any way to generate an interrupt when NSS wire changes its state? We would like to keep GPIO in the Alternative Function NSS for the SPI slave so it will synchronize the beginning of the byte frame if clocks are lost, and at the same time use NSS level to signal the upper-level protocol end-of-packet event.
Receive interrupt will not work in such case: if one clock is lost, the last byte will not be received. However, the NSS will go high and we would like to catch this event promptly.
Thank you.