Skip to main content
Ofer
Associate III
Mar 20, 2024 10:20 PM UTC
Question

xEventGroupWaitBits function usning

Hi

I use STM32H7 with free-rtos for my projct.

I need to synchonized analog samples reading from 2 DMA channels and from 2 different ADCs.

I use the xEventGroupWaitBits function to stop the execution of the sampling before starting a new sampling cycle.

DMA-ADC interrupts of both channels releasing the WAIT by the xEventGroupSetBitsFromISR command.

My problem is the time takes from the xEventGroupSetBitsFromISR (in the callbacks) until the xEventGroupWaitBits function resumes execuation - It takes 1ms which is much to much for my project. What can solve it ?

Thanks

This topic has been closed for replies.

2 replies

hs2
Visitor II
Mar 21, 2024 11:37 AM UTC

Do you handle xHigherPriorityTaskWoken (naming in the example) to properly call portYIELD_FROM_ISR ?
On the other hand consider using task notifications as a faster alternative, since xEventGroupSetBitsFromISR uses the timer task which then signals/wakes up the task waiting for the event group. That causes a certain overhead which is avoided by using e.g. task notfications.
Of course the overall system load and your priority scheme is also important to tune the task response time/latency.

Ofer
OferAuthor
Associate III
Mar 31, 2024 9:54 PM UTC

Thank you.

I will check it.