TMS320F28388D: Creating SYSBIOS HWI at runtime

Part Number: TMS320F28388D
Other Parts Discussed in Thread: SYSBIOS

I need to create HWI interrupt at runtime.

I've found this page in doc that seems to explain what I need.

software-dl.ti.com/.../IHwi.html

But I tried it just to find out that Hwi_create just calls xdc_runtime_Error_raiseX

I'm using bios 6.83.00.18

What am I missing?

  • Do you mind sharing a snippet of the code where you're creating the Hwi? Can you use breakpoints or single step through the code to confirm what line in the Hwi code leads to the error being raised?

    Do note that we are no longer recommending SYS/BIOS for new projects, so if this is a new project, we recommend looking into using our FreeRTOS implementation instead. There's a little more information in this post.

    Whitney

  • The code is almost a copy from doc. I'm trying to create a hwi for timer 1:

            Hwi_Params hwiParams;
            Error_Block eb;

            Hwi_Params_init(&hwiParams);
            Error_init(&eb);

            // set the argument you want passed to your ISR function
            hwiParams.arg = 0;

            // set the event id of the peripheral assigned to this interrupt
            hwiParams.eventId = 10;

            // don't allow this interrupt to nest itself
            hwiParams.maskSetting = Hwi_MaskingOption_SELF;
            Hwi_create(13, incrementMilliseconds,  &hwiParams, &eb);

    Following last 'call Hwi_create' leads to Hwi.h:

    #define Hwi_create ti_sysbios_hal_Hwi_create

    and to app_pe28FP64.c:

    /* create */
    ti_sysbios_hal_Hwi_Handle ti_sysbios_hal_Hwi_create( xdc_Int intNum, ti_sysbios_hal_Hwi_FuncPtr hwiFxn, const ti_sysbios_hal_Hwi_Params *paramsPtr, xdc_runtime_Error_Block *eb)
    {
        xdc_runtime_Error_raiseX(NULL, ti_sysbios_hal_Hwi_Module__id__C, NULL, 0, xdc_runtime_Error_E_generic, (xdc_IArg)"create policy error", 0);
        return NULL;
    }

    A related question: is it allowed to mix sysbios HWIs and plain interrupts?

    Regards

  • That "create policy error" usually means that your configuration has dynamic instance creation turned off. Go into your runtime options and turn it on. In your cfg file it looks like this: BIOS.runtimeCreatesEnabled = true;

    Whitney

  • Thanks, that resolved my issue.

    Do you also know the answer to this question?

    A related question: is it allowed to mix sysbios HWIs and plain interrupts?

  • You need to use what SYS/BIOS calls "zero latency interrupts" which basically allows you to use regular non-BIOS interrupts but register them with the RTOS so that it doesn't interfere with them.

    See the Minimal Latency Interrupts section of this FAQ:

    https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/953170/faq-are-there-any-c28-device-specific-items-with-ti-rtos-sys-bios

    Whitney