2024-11-19 05:31 AM
Hi everybody.
I'm facing a strange behaviour on my application. I'm using a STM 23H562, and I'm usign LL library to drive a SPI display (classic iLi).
I take the example from c:\Users\Massimo NUCLEO-H533RE\Examples_LL\SPI\*
and the display do what I want... only sometime!
Due to the 65535 max transfer length, I need to split it into 3 session. I wait the end of the previous as indicate in the example, using:
while (!LL_DMA_IsActiveFlag_TC(GPDMA2, LL_DMA_CHANNEL_0)){}
LL_DMA_ClearFlag_TC(GPDMA2, LL_DMA_CHANNEL_0);
But the color of the filling change (= the data transmitted to the display) from one session to the others. The 1st is correct, the second "sometime", the 3rd rarely.
But if I put a small delay from one session to the following everything work fine.
How I can fix it?
It seems I must wait for some other flag, but donnow wich!
Moreover, the command to the display is based on a 8 bit spi data, so I change to 16 and back to 8 when I use the DMA. But the session of manual sending command to SPI after DMA fail because the TXC flag is always 0, it never change!
while (!LL_SPI_IsActiveFlag_TXC(SPI2)){}
Thank in advance.