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.

hwi work only from second debug start

Other Parts Discussed in Thread: SYSBIOS

Hi,

I use a hwi but it works only if I connect with debugger to my l137 DSP on the second load.

#include <ti/sysbios/family/c64p/Hwi.h>

void RegisterIsr(void *pfnIsr, Uint8 ucInterruptNumber, Uint8 ucInterruptEventID)
{
    Hwi_Params params;

    Hwi_Params_init(&params);
    params.eventId = ucInterruptEventID;
    params.enableInt = FALSE;

    Hwi_create(ucInterruptNumber, (Hwi_FuncPtr)pfnIsr, &params, NULL);
}

What is the problem? I have no idea where I should begion my search.

regards

  • When you load and run it the first time, what does ROV show for the Hwi module? Is the Hwi listed?

    Also, you should not pass in a NULL Error_Block. If there is a problem, the application aborts. If you pass in an initialized Error_Block and there is an failure, the Error_Block is set accordingly and the function returns (with a NULL Handle).

    Todd

  • void INTDSP_RegisterIsr(void *pfnIsr, Uint8 ucInterruptNumber, Uint8 ucInterruptEventID)
    {
        Hwi_Params params;
        Error_Block eb;
        Hwi_Handle handle;

        Error_init(&eb);
        Hwi_Params_init(&params);
        params.eventId = ucInterruptEventID;
        params.enableInt = FALSE;

        handle = Hwi_create(ucInterruptNumber, (Hwi_FuncPtr)pfnIsr, &params, &eb);
    }

    I chaned the code to lookn on the return value. Its both times the same value I get a valid handle and no error. But on the first start aftter VCC off the ISR don't starts.If I start the code without debugger the isr never occur. How can I found the problem

    About the error block schould these functions only write to the eb of the pointer is not NULL. I think this is a sysbios BUG in my opinion. Maybe this should be discussed.

  • Hi,

    I found the problem.

    The hwi works well, I debugged in hwi module and the interrupt was there. In my ISR the first was if data is available (the first 4 Bytes on shared ram)

    These bytes wher 0 every time. So I disabled caching for the shared ram and all works fine.

    regards

  • If an Error_Block is NULL and an error occurs, the program terminates. Granted, you can argue whether this is good or not, but this was the design that was choosen. It does make debugging easy when you start development and forget to check return codes.

    Back to your problem. You are setting the enableInt to FALSE.  When do you enable it? Can you look at Hwi in ROV and see if there is a difference between the first load/run and the second load/run.

    Todd

  • see my last post the problem is solved