This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28P650DH: Question about FreeRTOS blocking C2000 interrupt

Part Number: TMS320F28P650DH

Tool/software:

Hi champs,

I ask this for customer.

When using FreeRTOS, how to use FreeRTOS to control interrupts on C2000?

And in ARM devices, FreeRTOS cannot block interrupts with too high a priority. Does F28P65x have similar logic? Thank you!

Julia

  • Hi Julia,

    The kernel tick interrupt for FreeRTOS is configured to use the CPU TIMER 2 interrupt, which is at the lowest priority, and will not block any other system interrupt. This is configured in the FreeRTOS port, and thus applies for all C2000 devices with FreeRTOS support.

    Thanks,

    Arnav

  • My project is currently using FreeRTOS system on F28P65, my AD interrupt is still executed in ISR function, and the rest of the interrupt is done by semaphores, which encapsulates the interrupted execution content into tasks, the specific framework is as follows, but now it is prone to the phenomenon of the watchdog timeout chip reset. The watchdog feeds the dog when the AD is interrupted. The AD frequency is 32k, and the operating system tick frequency is 1kHZ. What is the reason? Thank you!

    __interrupt void adc_isr(void)
    {

    volatile uint16_t tempPIEIER = HWREGH(PIECTRL_BASE + PIE_O_IER1);
    IER |= M_INT1;
    IER &= MINT1;
    HWREGH(PIECTRL_BASE + PIE_O_IER1) &= MG1_1;
    Interrupt_clearACKGroup(0xFFFFU);
    __asm(" NOP");
    EINT;
    .....
    code;
    serviceWatchdog;
    ADC_clearInterruptOverflowStatus(ADCA_BASE, ADC_INT_NUMBER1);
    ADC_clearInterruptStatus(ADCA_BASE, ADC_INT_NUMBER1);
    Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP1);
    DINT;
    HWREGH(PIECTRL_BASE + PIE_O_IER1) = tempPIEIER;
    }

    __interrupt void cpuTimer0ISR(void)
    {
    BaseType_t xHigherPriorityTaskWoken = pdFALSE;
    xSemaphoreGiveFromISR( binarySem1Handle, &xHigherPriorityTaskWoken );
    Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP1);
    portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
    }

    void cpuTimer0_isr_Task( void * pvParameters )
    {
    for(;;)
    {
    if(xSemaphoreTake( binarySem1Handle, portMAX_DELAY ) == pdTRUE)
    {
    code;
    }
    }
    }


    __interrupt void ECan_ISR0(void)
    {

    BaseType_t xHigherPriorityTaskWoken = pdFALSE;
    xSemaphoreGiveFromISR( binarySem2Handle, &xHigherPriorityTaskWoken );
    Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP9);
    portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
    }
    void ECanA_isr0_Task( void * pvParameters )
    {
    for(;;)
    {
    if(xSemaphoreTake( binarySem2Handle, portMAX_DELAY ) == pdTRUE)
    {
    code ;
    }
    }
    }


    __interrupt void Sci_RxIsr(void)
    {
    BaseType_t xHigherPriorityTaskWoken = pdFALSE;
    xSemaphoreGiveFromISR( binarySem4Handle, &xHigherPriorityTaskWoken );
    sClearSciIntFlag();
    Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP9);
    portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
    }

    void Scia_Rx_isr_Task( void * pvParameters )
    {
    for(;;)
    {
    if(xSemaphoreTake( binarySem4Handle, portMAX_DELAY ) == pdTRUE)
    {
    code;
    }
    }
    }

  • Hi Wang,

    Trying to understand the issue here. What is your issue related to - FREERTOS, Interrupt or Watchdog ?

    my AD interrupt is still executed in ISR function, and the rest of the interrupt is done by semaphores, which encapsulates the interrupted execution content into tasks, the specific framework is as follows, but now it is prone to the phenomenon of the watchdog timeout chip reset

    I cannot understand what you meant by above ? 
    AD interrupt is executed in ISR?
    Interrupt is done by semaphores ?  

    Please elaborate your issue so I can understand this better

    Thanks