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.

UCOS II port for TM4C123G microcontroller

I ported uCOS II for TM4C123G micro-controller.

uCOS II works great.

But when interrupt is used, it goes to lowest priority idle task.

It is not scheduling user defined highest priority task.

I use the following code for servicing interrupt.

void  BSP_IntHandler (CPU_INT16U  src_nbr)
{
    CPU_FNCT_VOID  isr;
    CPU_SR_ALLOC();

    CPU_CRITICAL_ENTER();                                       
    OSIntEnter();
    CPU_CRITICAL_EXIT();

    OSIntExit();                                                
}

  • Hello Nishanth,

    Is the BSP_IntHandler registered in the interrupt vector table for the TM4C123 device?

    Regards

    Amit

  • Yes, BSP_IntHandler is registered in the interrupt vector table.

    Microcontroller enter the ISR and executes the ISR instructions.

    When ISR calls OSIntExit() function, it should  shedule the highest priority task.

    But it always enters lowest priority Idle task (which is an infinite loop code).

  • Hello Nishanth,

    In the UCOS II source code for bsp_int.c shows something like this

    void  BSP_IntHandler (CPU_INT16U  src_nbr)
    {
        CPU_FNCT_VOID  isr;
        CPU_SR_ALLOC();

        CPU_CRITICAL_ENTER();                                       /* Tell the OS that we are starting an ISR            */
        OSIntEnter();
        CPU_CRITICAL_EXIT();

        if (src_nbr < BSP_INT_ID_MAX) {
            isr = BSP_IntVectTbl[src_nbr];
            if (isr != (CPU_FNCT_VOID)0) {
                isr();
            }
        }

        OSIntExit();                                                /* Tell the OS that we are leaving the ISR            */
    }

    Regards

    Amit

  • Yes.

    if (src_nbr < BSP_INT_ID_MAX) {
            isr = BSP_IntVectTbl[src_nbr];
            if (isr != (CPU_FNCT_VOID)0) {
                isr();
            }
        }

    But what this code do?