2025-02-13 11:50 AM
so i was following an online tutorial (from digikey, where they teach how to use dma) and in it the values from ADC is transmitted through DMA to a buffer of decent size (4096byte). But it seems they always use the hal delay function after using uart transmission. Is this necessary, i noticed that without the delay function my frequency goes from 1khz to 7khz and i dont see any issues with the transmission too.
i mentioned about the dma from adc in case its relevant for using the delay function in uart
2025-02-13 12:09 PM
No, not really. If you want pauses between sampling the ADC, provide the intervals in any way.
By the way, this forum is the perfect place to ask about internal ADCs of STM32. No digikey or any amateur website even comes close.
2025-02-13 12:40 PM
No
HAL_UART_Transmit(), blocks until completion
HAL_UART_Transmit_DMA(), returns immediately, so you're supposed to wait for the completion or error callbacks to understand when it finished. You call also only have a single operation in-flight at once, and you should pay attention to the scope/life of the buffer you're passing.