cancel
Showing results for 
Search instead for 
Did you mean: 

Conflict between FREERTOS and Dac timer?

Riccardo Franceschetto
Associate III

Hello, i'm trynge generating a sine wave with DAC, on stm32f429ii, when it's coded baremetal everything works fine, when working with freertos the dac won't show any output.

May the timer tigger for the DAC goes to conflict with freertos?

4 REPLIES 4
TDK
Guru

Are we just guessing here? Does FreeRTOS use that timer for anything? If not, I don't see how there can be a conflict.

Step through code, verify things aren't getting hung up somewhere, verify tasks are working, verify register settings are correct. In this case I'd ensure the timer is working with DMA requests enabled and the DAC is working.

If you feel a post has answered your question, please click "Accept as Solution".
KnarfB
Principal III

If you enable FreeRTOS, interrupt priorities change. This might cause issues.

hth

KnarfB

hi, thank you for your response.

I tried baremetal coding with

 MX_TIM4_Init();

 HAL_TIM_Base_Start(&htim4);

 HAL_DAC_Start_DMA(&hdac, DAC_CHANNEL_2, (uint32_t*)Wave_LUT, NS, DAC_ALIGN_12B_R);

to generete a sine wave feeding a lookup table to the DAC and everything works fine so it's not hardware related.

Could the TouchGFX process interfere in some way?

When i got to work with freertos, calling this same code inside a task won't generate nothing at the DAC output, the timer 4 serves only the DAC.

I'm guessing is a problem of priority in the freertos, but i gave the timer level 5 priority, the highest it lets me select.

Thank you @KnarfB​.

as i replied above to @TDK​ i guess thats the problem.

Do you have any raccomandation to follow to try solve the issue?