I have an application with a STM32F337 which should implement an SPI slave protocol.
Each of the SPI transaction packets or frames, whatever you want to call them, is supposed to have, say, exactly 100 bytes.
The master uses the NSS line to make sure that the frames are synchronized, as it is done in any good SPI application.
So in order to transmit 100 bytes, the master pulls NSS low (asserts it), clocks the 800 bits to the slave in the usual way and pulls NSS high again (de-asserts it).
Whenever one transaction goes wrong, the next one is supposed to be ok again by means of the synchronization, so during the "high time" of NSS the transaction is supposed to be evaluated and re-established. In order for this to happen, I need an interrupt signal for the NSS line which even should fire if the number of bytes transmitted was less than 100. (Tests show that the DMA interrupt is only fired as soon as 100 bytes are transmitted, no matter how often NSS is de-asserted and asserted again.)
I have found out that the SPI slave peripheral in the µC unit only uses the NSS line to control the MISO line's state (High Z or not), but does not control the communication using it, i. e. it doesn't reset any DMA state or whatever.
Thus, I have to find a way to mulitplex the line between NSS functionality and EXTI in order to have an interrupt ehenver the line state changes. But I don't see a way to be able to do so – at least, STM32Cube won't let me use the same pin for NSS and EXTI.
Is this a restriction of Cube or of the µC unit? Do I have other alternatives (except connecting the signal to several pins at once)?