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.

TMS320F28335: Is it necessary to use HWI_Plug()?

Guru 20075 points

Part Number: TMS320F28335
Other Parts Discussed in Thread: SYSBIOS

Hello,

I looked at the SysBios Code for HWI_Plug() and I noticed that it mainly assigns the ISR function pointer to the PIE vector address.

Therefore, Is it necessary to use HWI_Plug?

Stephen

  • Hwi_plug() is specifically meant for use with the minimal latency interrupt features in SYS/BIOS, so if you're not using that, you definitely don't want to call Hwi_plug() since it will end up overwriting the SYS/BIOS Hwi dispatcher in the vector table. Instead you just specify the Hwi function when you create the Hwi either by calling Hwi_create() or statically in your cfg file.

    If you are using the zero latency interrupt feature of SYS/BIOS for a particular interrupt, then if you want to use an alternative method of writing your function to the vector table, that's probably fine. The most important thing there is that you set the Hwi.zeroLatencyIERMask to tell SYS/BIOS not to manage that interrupt group.

    Whitney

  • Thanks Whitney,

    The purpose of the Hwi.zeroLatencyIERMask is to keep the HIW Dispatcher from disabling the interrupt?

    I think the HWI Dispatcher is Void Hwi_dispatchCore(Int intNum).  How is this function called when a specific interrupt occurs?  

    Stephen

  • Yes, that's part of it. There's some info under "Minimal Latency Interrupts" in the thread below that describes the different things that the Hwi dispatcher does that get bypassed when using zero latency interrupts. It also discusses the trade offs you need to consider when choosing to use them.

    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

  • Hello Whitney, 

    I changed my 2nd Post before I noticed you answered it. Sorry about that.  However, you did answer the first question of that post.

    Just one more question.  I am looking at the SysBios code to figure out how things work behind the scene.

    Question:

    I think the HWI Dispatcher is Void Hwi_dispatchCore(Int intNum).  How is this function called when a specific interrupt occurs?  

    Thanks.

  • That function is part of it. If you look at what is actually plugged into the vector table using the memory browser, the first thing that executes is part of ti_sysbios_family_c28_Hwi_dispatchTable but Hwi_dispatchCore does get called eventually.

    If you wanted you could look up the address in the vector table, search for it in the disassembly window, put a breakpoint there, and step through the code to see how it gets to Hwi_dispatchCore and beyond.

    Whitney