2025-01-07 02:38 PM
We need to continuously DMA a single 16-bit word to the SPI transmitter. (Neither the memory address nor the peripheral address would increment.) Can this be done without intervention? I.e. do we have to use a DMA Complete interrupt to set a flag and call HAL_SPI_Transmit_DMA whenever the flag gets set, or can we configure HAL_SPI_Transmit_DMA to set and forget it?
2025-01-07 02:49 PM
Should be doable. Set up a circular transfer where neither address increments. Length of the transfer is not relevant-any nonzero value will do. Disable interrupts after it starts if you don't want to service them.
2025-01-07 03:30 PM
2025-01-07 03:45 PM
That's what a continuous SPI stream looks like. Do you want something else?
2025-01-07 06:09 PM
Maybe I don't understand the SPI protocol well. How would the slave know where a frame/word ends and the next one begins?
2025-01-07 09:00 PM
Typically that's done with a separate chip select (CS) line. You can use NSS Pulse mode to have the CS line go high between words, if that's what you need.
2025-01-07 09:26 PM
2025-01-08 12:08 AM
Read out and check/post content of SPI and relevant GPIO registers.
JW
2025-01-08 03:44 AM
Hi SoCal,
Having a look at your file 2.png, NSS is definitely not right. Whats the scale of the NSS trace? It looks like a signal with a bit of ground bounce (very low voltage) - every time your data changes, you get a bounce on NSS. Its certainly not indicating end of word.
Whats the voltage of the ringing on NSS?
Regards,
Toneski
2025-01-08 07:38 AM
Seems okay to me, except there's a lot of cross-talk/bounce. You're only showing about 8 bits worth of data, so could just be missing where the pulse is. Did you enable NSS Pulse mode? Can you show your code?