Nucleo STM32U575ZI-Q low level USART receiving help
Hi all,
I am using the Nucleo STM32U575ZI-Q and have been trying to get low level USART with DMA working. Transmitting data works fine as I can see the data using a logic analyser but when I try to receive data either from another Nucleo or putting the wire from Tx to Rx I get nothing.
I have a Asynchronous USART with DMA channels for both Tx and Rx.
In MX_USART1_UART_Init() I enable:
LL_DMA_EnableIT_HT(GPDMA1, LL_DMA_CHANNEL_10);
LL_DMA_EnableIT_TC(GPDMA1, LL_DMA_CHANNEL_10);
LL_DMA_EnableIT_TC(GPDMA1, LL_DMA_CHANNEL_11);
LL_USART_EnableIT_IDLE(USART1);
In my other init function for my code I set the DestAddress, BlkDataLength and also enable the channel:
LL_DMA_SetDestAddress(pDMATypedef, LL_DMA_CHANNEL_10, (uint32_t)RXBuffer);
LL_DMA_SetBlkDataLength(pDMATypedef, LL_DMA_CHANNEL_10, mARRAY_LEN(RXBuffer));
LL_DMA_EnableChannel(pDMATypedef, LL_DMA_CHANNEL_10);
In my Rx DMA interrupt I call a function which calls another function which will check if there is any data in the buffer. This checking function also gets called from the USART interrupt.
My problem is when it comes to check the data in the buffer there is nothing:
uint32_t u32Pos = sizeof(RXBuffer) - LL_DMA_GetBlkDataLength(pDMATypedef, LL_DMA_CHANNEL_10);
This function does not get called from the Rx DMA interrupt but from the USART interrupt.
Is there anything I have missed or have not done correctly?
If there is any other information needed please ask!
Many thanks!
