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:
@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...
Jump to solution
6 Replies
ZacckOsiemo
ZacckOsiemo5mo ago
Can I ask a few questions? What is your queue length?
ZacckOsiemo
ZacckOsiemo5mo ago
is that what you are refferring to as size here?
Sterling
Sterling5mo ago
Oh yes @ZacckOsiemo
Solution
undefined.elf
undefined.elf5mo ago
@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
Sterling
Sterling5mo ago
Hmm, thanks for the suggestion @Undefined
undefined.elf
undefined.elf5mo ago
Hope it helps
Want results from more Discord servers?
Add your server