Open pieterconradie opened 1 year ago
hello @pieterconradie
Thank you for this report. We will get back to you as soon as we analyze it further. This may take some time. Thank you for your comprehension.
With regards, Rania
ST internal Reference: 190600
Here is an example implementation for free :). For small SPI packets regular polling is used and for large SPI packets DMA is used.
Hi there!
I have measured the SPI comms using a logic analyzer:
As you can see there is plenty room for improvement using DMA instead of polling. I'm referring to stm32wlxx_hal_subghz.c SUBGHZSPI_Transmit() and SUBGHZSPI_Receive(): https://github.com/STMicroelectronics/STM32CubeWL/blob/main/Drivers/STM32WLxx_HAL_Driver/Src/stm32wlxx_hal_subghz.c#L1626-L1735
It would be better to formulate the SPI packet for transfer and then use DMA. This means that a HAL_SUBGHZ_ReadRegisters() would have to be rewritten: https://github.com/STMicroelectronics/STM32CubeWL/blob/main/Drivers/STM32WLxx_HAL_Driver/Src/stm32wlxx_hal_subghz.c#L863-L917
These unnecessary delays between each SPI byte will impact battery life. It is most notable when transmitting or receiving a large packet.
Best regards, Pieter https://piconomix.com