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.

RTOS/TM4C1294NCPDT: Calling function in HWI context

Part Number: TM4C1294NCPDT


Tool/software: TI-RTOS

Hi,

I am developing an embedded application on TM4C1294NCPDT using TI-RTOS.

Is it possible to call function in HWI context in TI-RTOS ?

If Yes, then what settings and configuration is required ?

Also I tried to do so but I get some assert.

  • Hi Harshal,

    What function are you trying to call? You can look at the SYS/BIOS API Reference to see a calling context table. For example, you cannot call Task_sleep from a Hwi.

  • I need to call function which is part of application. In case of I2C drivers, callback function is provisioned which is called in Hwi context.
  • When in Callback mode, the I2C_transfer callback is called by the Hwi. What is your question?
  • Similar way I2C drivers calling function in Hwi context, I also want to call function in Hwi context but it gives me assert.

    I need to figure it out why is this happening?
  • Hi patil,

    harshal patil said:
    Is it possible to call function in HWI context in TI-RTOS ?

    Yes this is proven to work even with semaphore timer calls not originating from TI-RTOS task handlers.

    harshal patil said:
    If Yes, then what settings and configuration is required

    Installed or loaded TI-RTOS M3 module and configured same registered interrupts (startup_ccs.c) had used. 

    So the callbacks and the interrupt handlers worked well with RTOS M3 module.

    Don't forget to remove startup_ccs.c from the project build once you port all your INT vectors into M3 module.

  • Harshal,

    If you are using blocking mode with the I2C_transfer, you are getting an error since it is calling Semaphore_pend in an Hwi (with a non-zero value). This causes an assert since it is not supported. You can use callback mode instead. Then you can call I2C_transfer from an Hwi. Your callback will be called when the transfer is completed.

    You could not use the TI-RTOS driver and just use driverlib. I believe this is what BP101 is referring to.

    Todd