Slide 1 Slide 2 Slide 3 Slide 4 Slide 5 Slide 6 Slide 7 Slide 8 Slide 9 Slide 10 Slide 11 Slide 12 Product List
SYS/BIOS: MSP430 Support Slide 8

The approach used by SYS/BIOS is to closely mimic the traditional C approach that was just shown, but to conditionally allow add-ons of additional enhancements. To do this, the SYS/BIOS configuration tool automatically generates "interrupt stub" functions that will call the user-defined ISR functions at the appropriate points of execution. These auto-generated stub functions use the "interrupt" keyword, but the user-defined functions must be standard C callable functions. An example of a default stub for a SYS/BIOS ISR that schedules a Task to run from the ISR function is shown below. The ISR function (hwiFxn53) gets called after, the Task scheduler is disabled, the stack is switched from the interrupted Task's stack to the interrupt stack, the Swi scheduler is disabled, and the execution context is updated. After the function returns, the interrupt unwinds by restoring the Swi scheduler, restoring the execution context, switching back to the interrupted Task's stack, and restoring the Task scheduler and returning from the interrupt. Note that this stub looks like it carries a lot of overhead. But keep in mind that this is the generated C code for the stub, and the compiler and linker will optimizes this. Also, almost all of this is configurable by the developer. Shown here is a screenshot of the configuration tool’s window for configuring an MSP430 hardware interrupt. Note that there is a configure parameter that will direct all the SYS/BIOS, generated interrupt stubs, to emit to keep the CPU awake upon return from interrupt. This is provided as a debug aid, as well as a mechanism to ease porting of legacy MSP430 application code to run with SYS/BIOS.

PTM Published on: 2012-07-12