2021-08-02 05:17 AM
My application is to implement a real-time signal processing algorithm on the STM32F3 microcontroller. I'm not using FreeRTOS.
Details on what I want to do:
My doubt is: Whether it will be possible to do the processing before the first DMA gets overwritten? How can I verify the timing requirements for processing to make sure it doesn't get overwritten? Because as per the tutorials/forums I've seen by now, FFT consumes a lot of time. Should I do this application into FreeRTOS?
2021-08-02 06:19 AM
Toggle a pin within the interrupt to see long long it takes. Or check for half- and full transfer complete flags at the exit to ensure they haven't yet happened.
It probably won't be possible to continuously process 10 Msps in a nontrivial way. Doing it in FreeRTOS would be even worse than as bare metal as it will add additional overhead. Using HAL is going to slow it down even more.
2021-08-02 06:49 AM
I thought of storing more samples in a buffer. But still, FFT will not be fast enough to compensate.
Suppose, I check the flags for Transfer complete, and it says '1'. For sure, the FFT operation would not be completed by that time for the first buffer. Can I store the data of the second buffer on another address and continue doing FFT?
2021-08-02 06:55 AM
2021-08-02 07:14 AM
So, the best option for me is to stop ADC after the second buffer gets filled. Process everything and then start ADC again.
2021-08-02 07:14 AM
So, the best option for me is to stop ADC after the second buffer gets filled. Process everything and then start ADC again.
2021-08-02 08:24 AM
When you plan real time then need balanced sampling speed vs calculted values. No stop ADC...
Circular DMA is perfect for offload ADC from MCU.
For skip some ADC is better use only switch DMA to dummy and valid buffers.
2021-08-02 08:27 AM
Can you explain the last line?
2021-08-02 08:40 AM
Primary you config DMA for example to receive 1024 samples , then on first 512 ocur half IRQ and you start calculate first half samples.
On second IRQ is next 512 samples ready and if calculation isnt complete in this IRQ you change DMA to second dummy buffer address.
For best speed use direct registers change without HAL...
After calculation is complete you set flag and in same IRQ switch back to primary buffer.
Calculation you can do on both or only on primary buffer, but start only in half complete IRQ...
2021-08-23 06:39 AM
@S12344
Please were you able to implement the dual interleave adc mode?if yes please can you share it with me. Thank you