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.

Changing the nestingEnabled HWI param does not do anything.

Other Parts Discussed in Thread: MSP430BT5190

I'm using: CCSv4.2.4, SYS/BIOS 6.32.04.49, IPC 1.23.04.36, XDCtools 3.22.03.41. MSP430BT5190.

When I change the nestingEnabled HWI param from false to true, there is no change to the generated HwiFuncs.c file. The result is that the GIE is cleared during interrupt functions preventing nested interrupts.

 

 

  • Carl,

    Setting the nestingEnabled configuration parameter for a Hwi instance will not automatically re-enable GIE during the execution of the interrupt routine.  What it will do is cause the generated interrupt stub to disable and re-enable the Task and Swi schedulers at the proper times, so that if another interrupt does nest on top, the schedulers won’t be activated immediately at the end of the interrupt that is nesting, but will be held off, until this interrupt routine completes.  If the interrupt instance is configured with “taskEnabled=true;” and “swiEnabled=true;” (the defaults, so the scheduler calls are already in the stub), then you won’t see any difference in the generated HwiFuncs.c file.

    On other CPU architectures SYS/BIOS will fully manage interrupt masking via centralized interrupt mask registers, and an interrupt dispatcher.  On the MSP430 there isn’t a corresponding set of centralized mask registers that allow an efficient way for SYS/BIOS to fully manage the masking/nesting.  So, on MSP430, it is left to the configured interrupt functions to do the necessary interrupt masking, and to re-enable and then re-disable GIE within that specific interrupt function.  In other words… SYS/BIOS for MSP430 *supports* interrupt nesting, but it doesn’t automatically manage the nesting - the steps of masking the unwanted interrupts, and re-enabling global interrupts during the user’s interrupt routine are left to that interrupt routine.

    I hope this makes sense.  I see that this needs better explanation in our docs, and will add this.  If you haven’t seen it, there is further discussion of the interrupt model SYS/BIOS uses on the MSP430 on this wiki page: http://processors.wiki.ti.com/index.php/SYS/BIOS_for_the_MSP430#Interrupt_Handling

    Regards,
    Scott

  • Hi Scott, thanks for the thorough reply. Yes the statement in BIOS_for_the_MSP430#Interrupt_Handling could be a little more explicit in saying the user must enable the GIE and it will not be done by the HWI stub. Upon learning more about MSP430 nested interrupts I'm really going to make an effort not to have to use them.