Hi All,
I am working on LM3S5K31 controoler and embos 3.82K. I am trying to use Hibernation module, but when I write "HibernateIntRegister(MyHibernateHandler);" to register Handler function for processing interrupt, processor got stuck in _IllegalException.
Please guide me how to use Hibernate module.
Thanks a lot..
Harsh
Harsh,
Your issue is most likely that you did not correctly configure the interrupt vector in the Startup file. Which IDE are you using? In your project, open the startup_ccs.c (or _ewarm, _rvmdk, _gcc), and then insert the extern directive and vector define. Each IDE has its own specific format, so you should look at other Stellarisware projects that use properly configured interrupts. For example, if using Keil, in startup_rvmdk.c add EXTERN HibernateIntHandler and DCD IntDefaultHandler ; Hibernate in the __Vectors section. Below are some specific examples to look at and where to find them.
If you have not already done so, download Stellarisware for the LM3Sxxxx devices at http://www.ti.com/tool/sw-lm3s. It has working examples for all of the evaluation and developement kits.
See interrupts or timers example at path C:\StellarisWare\boards\ek-lm3s9b92\interrupts and C:\StellarisWare\boards\ek-lm3s9b92\timers, respectively.
For a working Hibernate example, see C:\StellarisWare\boards\ek-lm3s1968\hibernate. This example does not use interrupts, but will give you a good starting point of for configuring, and using the hibernate module. Since hibernate is similar to a POR, the code is configured to first determine if it is waking up from Hibernate or if it is a POR (power on reset.)
Review document for a full description of the Stellarisware API's follow path C:\StellarisWare\docs\SW_DRL_UG_xxxx.pdf. Inside the Stellaris Peripheral Driver Library User's Guide, you will find a full descripton of each of the functions. For example:
HibernateIntRegister
Registers an interrupt handler for the Hibernation module interrupt.
Prototype:
void
HibernateIntRegister(void (*pfnHandler)(void))
Parameters: pfnHandler points to the function to be called when a hibernation interrupt occurs.
Description: This function registers the interrupt handler in the system interrupt controller. The interrupt is enabled at the global level, but individual interrupt sources must still be enabled with a call to HibernateIntEnable()
See also:
IntRegister() for important information about registering interrupt handlers.
Returns:
None.
To provide another example of hibernate with masked interrupts, I have attached a RTC.c and Startup_rvmdk.c file. We don't have it available in Stellarisware. It does demonstrate using masked interrupts for the hibernate module.
7585.startup_rvmdk.S
8780.RTC.c
Lela