2023-07-10 05:21 PM - edited 2023-07-10 05:24 PM
Enabled DMA in CubeMX settings to transfer data via UART.
But I don't see any difference at all between non-DMA functions and DMA functions.
I don't think it's important, but I use this code:
Transferring characters from the COM port to the STM32 and returning these characters back to the COM port.
uint8_t arr[10]={0};
void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size)
{
if(huart->RxState==HAL_UART_STATE_READY)
{
HAL_UART_Transmit_DMA(&huart3, arr, Size);
HAL_UARTEx_ReceiveToIdle_DMA(&huart3, arr, 5);
}
int main()
{
HAL_UARTEx_ReceiveToIdle_DMA(&huart3, arr, 5);
}
The code works. But how to understand that data is transmitted via DMA?
Yes, there is DMA in the function names.
I need proof, if I may say so, that the data is transferred via DMA.
2023-07-10 09:36 PM
DMA has dedicated documents for the topic, look for them, I'm also looking to understand how to use DMA with I2C, SPI and USB Host, it's time consuming, and there's still FIFO.
https://deepbluembedded.com/stm32-dma-tutorial-using-direct-memory-access-dma-in-stm32/
https://dev.to/apollolabsbin/stm32f4-embedded-rust-at-the-hal-dma-controllers-daf
http://www.lucadavidian.com/2017/11/17/stm32f4-using-the-dma-controller-with-adc/