I am using STM32 Nucleo F334R8 board. I transmit some data using UART in asynchronous mode to my PC using:
HAL_UART_Transmit_IT(&huart2, &data, sizeof(data));
I noticed that after enabling ADC in DMA mode microcontroller started to send incorrect data over UART.
When I just only commented out:
HAL_ADC_Start_DMA(&hadc1, adc_dma_values, 2);
UART transmission sends correct data.
When I replaced HAL_UART_Transmit_IT()
with HAL_UART_Transmit()
it also surprisingly works well.
I do not understand how HAL_ADC_Start_DMA()
may affect HAL_UART_Transmit_IT()
.
Here's whole code of main.c, maybe it would be helpful.