mbed-ce / mbed-os

Arm Mbed OS is a platform operating system designed for the internet of things
https://mbed.com
Other
37 stars 12 forks source link

STM32U5 DMA SPI not working yet #196

Open multiplemonomials opened 8 months ago

multiplemonomials commented 8 months ago

DMA SPI is currently not functional on this device family. Need to test things out some more...

wdx04 commented 2 months ago

I have used the DMA SPI to drive an ILI9341 240x320 SPI display on a custom STM32U575RI board without a problem. It takes 35ms to refresh the whole display in RGB565 format, compared to 103ms when DMA is turned off.

wdx04 commented 1 month ago

@multiplemonomials Hi Jamie, I found a bug(typo?) in stm_dma_utils.c, line 691 and line 709, when data alignment is 4, DestDataWidth should be set to DMA_DEST_DATAWIDTH_WORD instead of DMA_DEST_DATAWIDTH_BYTE:

https://github.com/mbed-ce/mbed-os/blob/87bc6de65a3943d2f1cdba22da70af6b592e2ec7/targets/TARGET_STM/stm_dma_utils.c#L689

This bug only affects STM32U5 with 32bit data transfer.

wdx04 commented 1 month ago

Also, I noticed the meaning of "Length" parameter of some DMA APIs (e.g. HAL_TIM_PWM_Start_DMA) has been changed in STM32U5. In STM32 series before STM32U5, "Length" means the number of data items to be processed, but in STM32U5, "Length" means the number of data bytes (number of data items * data width in bytes) to be processed.