2017-01-19 08:03 PM
Hi all
I used the example ''UART_TwoBoards_ComDMA''.
Just comment #define TRANSMITTER_BOARD, because I only have one device connecting to PC.
After run it, I couldn't see LD2 flashing.
It should be toggled because while (UartReady != SET) loop.
If I add some code ''HAL_UART_Transmit_DMA(&UartHandle, (uint8_t*)aTxBuffer, TXBUFFERSIZE);'' between HAL_UART_Receive_DMA() and
while (UartReady != SET) loop.
It will show messages on my PC terminal, but LD2 still didn't flash.
I don't know where is the code running.
I tried to input some datas, unfortunately HAL_UART_RxCpltCallback() has no respond.
If someone could show me a example using
HAL_UART_Receive_DMA could work in STM32L476 nucleo.
or tell me how to debug the problem.
Thank you all in advance.
2017-01-19 09:14 PM
MX_DMA_Init();
MX_USART1_UART_Init();
HAL_UART_MspInit(&huart1);
HAL_UART_Receive_DMA(&huart1,aTxBuffer,1024);
these are key codes in Uart receive process using DMA;
2017-01-20 01:40 AM
Thank you, Adam Hu.
After some tests, I find my device can't receive any data in polling and DMA mode.
But it works well when I use HAL_UART_Receive_IT();
So the problem seems to be why the receive IRQ procedure has no response when I tried to send character.
HAL_DMA_Start_IT().