How to Efficiently Transfer Large Data from ISR to Task on STM32F401 with FreeRTOS?
Good day Devs, I am working with an STM32F401 microcontroller for audio acquisition and need to transfer 384 bytes of PCM audio data from an ISR to a task using queues. The queue size currently used for this transfer is 5, but the high frequency of the ISR (8 kHz) seems to be causing data loss due to queue overflow, resulting in noisy audio recordings.
Is there a more efficient method to transfer large amounts of data from an ISR to a task???
(The RTOS in use is FreeRTOS, and the ISR is triggered by the DMA callback from the I2S microphone peripheral).
Solution:Jump to solution
@Sterling It is suggested not to use large code inside the ISR rather than just define a flag and set that flag inside the isr when the flag is set just read those data from the memory and reset that flag
Assuming you are using dma peripheral to memory
...6 Replies
Can I ask a few questions? What is your queue length?
is that what you are refferring to as size here?
Oh yes @ZacckOsiemo
Solution
@Sterling It is suggested not to use large code inside the ISR rather than just define a flag and set that flag inside the isr when the flag is set just read those data from the memory and reset that flag
Assuming you are using dma peripheral to memory
Hmm, thanks for the suggestion @Undefined
Hope it helps