Skip to main content
Graduate
December 21, 2021
Question

Conflict between FREERTOS and Dac timer?

  • December 21, 2021
  • 2 replies
  • 1387 views

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?

    This topic has been closed for replies.

    2 replies

    Super User
    December 21, 2021

    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.

    Graduate
    December 23, 2021

    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.

    Super User
    December 21, 2021

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

    hth

    KnarfB

    Graduate
    December 23, 2021

    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?