2023-10-13 04:43 AM
Hi,
I have an STM32L4x6 processor.
I'm reading data using ADC and DMA, and after the HAL_ADC_ConvCpltCallback, I process the data with a Fast Fourier Transform. Originally, in bare-metal, I had a flag in the main loop, and when the interrupt occurred, I set the flag and calculated the FFT(). My processor is currently running at 4MHz. The entire FFT operation took about 140-145ms (measured with HAL_GetTick()).
Afterward, I wanted to see the results with FreeRTOS. I created a task that starts when the flag is set to 1 by the HAL_ADC_ConvCpltCallback. However, when I measure it with osKernelGetTickCount(), the FFT function takes three times as long under FreeRTOS compared to bare-metal. I also tried giving the task a high priority and experimented with kernel_lock, but in all cases, it's about 480ms.
What could be causing this significant difference?
I also tried other tasks like memcpy and looped copying, and in all cases, the tasks take about three times as long under FreeRTOS.
Does anyone have any ideas?
Thank you :)
Solved! Go to Solution.
2023-10-13 05:47 AM
Issue solved.
The problem was caused by the RTOS kernel Awareness - RTOS Proxy being enabled, to see the thread properties during debugging. However, when switching from RTOS Proxy to J-Link, the performance issues were resolved immediately. But, of course, this requires J-Link.
2023-10-13 05:47 AM
Issue solved.
The problem was caused by the RTOS kernel Awareness - RTOS Proxy being enabled, to see the thread properties during debugging. However, when switching from RTOS Proxy to J-Link, the performance issues were resolved immediately. But, of course, this requires J-Link.