2026-04-30 1:01 PM
I have a project where a STM32U575VGT must convert a SSI multiturn encoder value into a parallel single turn value for GPIO output. The SSI values are 3 bytes long, and it would be best if the CPU is only interrupted when the last 2 values differ. I have set up SPI2 to have GPDMA channels for TX and RX (although only RX is needed). DMA transfers work, but when I try to enable autonomous mode with LPTIM1 Channel 1 as a trigger, there are no interrupts for SPI2 or the DMA channels. How do I trigger the SPI read every ~1ms? Is this something only achievable with the LL libraries rather than HAL? Is it possible to interrupt the CPU only if the 3 bytes read from the SPI differ from the previous value?
2026-06-02 6:08 AM
I have found that the SPI can be triggered by the LPTIM if the LPTIM is started in PWM mode, however with circular linked lists for DMA channels, the SPI transactions are continuous and not based on the LPTIM interval. Standard linked lists will have one SPI transaction, and then stop. It would be better to have the transactions run at an interval around 1ms or 0.5ms to save power.
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.