2023-12-30 12:03 AM
I'm trying to implement a SPI transfer between flash and SPI2 - a simple display. I'm using LL everywhere.
No problem with M3 and M4 - But GPDMA is completely different. "Normal" SPI work but no way to enable DMA.
Based on the only example with LL (All the examples are flash to ram only!). I wrote this:
LL_DMA_SetSrcAddress(GPDMA1, LL_DMA_CHANNEL_0, (uint32_t)&icon1);
LL_DMA_SetDestAddress(GPDMA1, LL_DMA_CHANNEL_0, LL_SPI_DMA_GetTxRegAddr(SPI2));
LL_DMA_SetBlkDataLength(GPDMA1, LL_DMA_CHANNEL_0, icon1_size_byte);
/* Enable DMA transfer complete/error interrupts */
LL_DMA_EnableIT_TC(GPDMA1, LL_DMA_CHANNEL_0);
LL_DMA_EnableIT_DTE(GPDMA1, LL_DMA_CHANNEL_0);
/* Start the DMA transfer Flash to Memory */
LL_DMA_EnableChannel(GPDMA1, LL_DMA_CHANNEL_0);
Icon size is about 2kB. Unfortunately no interrupt occours.
I'll hope that some example will be added on the next H5 update (HAL &LL).
Any suggestions?
2023-12-30 07:46 AM - edited 2023-12-30 07:49 AM
But GPDMA is completely different - that already took me some hours.
Here example, how to write the magic "list" , for dma -> SAI tx + rx :
But with HAL ...+ i got it working . :)
2023-12-30 08:52 AM
Thanks Kudos.
Just a quick glance, but seems very hard... for the LL and flash to RAM only a couple of commands :thinking_face:
But... The LLI (Linked List) seems very complicate and hard to understand. Are they necessary for this case?
I will study the code again, but on M3/M4 was easiest.
2023-12-30 09:09 AM - edited 2023-12-30 09:12 AM
Linked List is not necessary, the dma has an "standard mode" :
But - i didnt get it working....so i tried the list-mode from the example and it worked as it should.
M3/M4 was more easy, also on H7 i had no problems. It seems, STM wants to raise the bar ...
2024-01-05 01:49 AM - edited 2024-01-05 02:03 AM
Hello @TheRaprus,
>>I'll hope that some example will be added on the next H5 update (HAL &LL).
Thank you for the suggestion, LL examples of SPI with DMA (master and slave) will be added soon
This request is tracked internally (Ticket 164113).
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.