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.

Interrupt mask setting and nest interrupt using DSP/BIOS

I have some questions about how to setup interrupt mask and nest interrupt using DSP/BIOS? Does anyone know it? Thanks.

In HWI setting, the interrupt mask can be set as "self" or "all". Does "all" mean
any interrupt, including HWI, SWI, PRD? If we have multiple HWIs, and one of them
will trigger a SWI. If the HWI interrupt rate is high and SWI may take relative long
time, should we use "all" or "self" as HWIs' interrupt mask?

if a lower priority interrupt (serial port) is set for Self mask, then a) can it be
interrupted by DSP/BIOS interrupt?  and b)  if so, how long is the worst-case delay
until control returns to the lower priority int?

  • Xiaohan Chen said:

    I have some questions about how to setup interrupt mask and nest interrupt using DSP/BIOS? Does anyone know it? Thanks.

    In HWI setting, the interrupt mask can be set as "self" or "all". Does "all" mean
    any interrupt, including HWI, SWI, PRD?

    No it just includes HWI. Good explanation about that at document: (specially pages 87 and 91 - see IEMASK):

    http://focus.ti.com/lit/ug/spru303b/spru303b.pdf

    Xiaohan Chen said:

    If we have multiple HWIs, and one of them
    will trigger a SWI. If the HWI interrupt rate is high and SWI may take relative long
    time, should we use "all" or "self" as HWIs' interrupt mask?

    A SWI will never interrupt a HWI.

    Xiaohan Chen said:

    if a lower priority interrupt (serial port) is set for Self mask, then a) can it be
    interrupted by DSP/BIOS interrupt?  and b)  if so, how long is the worst-case delay
    until control returns to the lower priority int?

    I had to correct this one: A lower priority HWI with self mask will not be interrupted by any other interrupt - that is not true. Looking at page 91 of the document above, you can see that:

    "The third parameter, IEMASK, is a mask of those interrupts that are to be disabled between the HWI_enter and HWI_exit macro calls." So an HWI with mask self, will only prevent it to interrupt itself. If any other interrupt occurred then it would pre-empt the currently running interrupt regardless of priority. The HWI is only applicable in cases where there are simultaneously pending interrupts. 

     

  • Xiaohan,

    I talked to Brad and noticed that my third answer above was wrong, please note the correction in the post. I'm sorry for that.

  • Mariana,

    Thanks for your reply.

    About HWI triggers SWI, I referred the document SPRAAX9-August 2008, in page 4, Sec. 2.2.3, the last sentence is,

    "When the SWI function completes,
    execution returns to the HWI dispatcher to complete interrupt processing."

    Could you please explain it? I thought HWI will complete first and then call SWI. Why will it come back to HWI dispatcher after completing SWI function?

    Thanks,

    Xiaohan

  • Xiaohan,

    This document that you mentioned is just for C2000, so please be carefull If you are using C6000. Not everything might apply to C6000.

    But what you are asking applies for DSP/BIOS in general. The statement just says that when it finishes the SWI, it goes back to the dispatcher waiting for new activity.  The sentence right befor it says:

    "Note that this SWI function can be pre-empted at any point by a HWI or higher-priority SWI, so the most timecritical interrupts should be the highest priority SWIs."

    So the sentence you mentioned does not mean that an HWI will be interrupted because of a SWI.

    Please use the DSP/BIOS user's guide as a reference.