More info. Just restarted IAR IDE and entered debug mode, but did not start the code running. The LED stopped blinking, but the narrow negative pulses are still showing on the crystal.
login or register to reply
cb1
Platinum Boarder
2008/06/26 12:15
Re:LM3S6965 crashes in hibernate
Wow - sorry - thought we had it.
It is necessary that you insert delays after enabling your crystal. (doesn't start up immediately)
Can you list all code which references any of the hibernate functions? I'll review after landing tonight. (on road)
Last thought - I didn't see on first reading IF hibernate RTC runs when "hibernate" function is NOT invoked. This may mean - if you have not called hibernate - that the xtal has not been enabled. Don't know...
login or register to reply
ckuecker
Platinum Boarder
2008/06/26 12:54
Re:LM3S6965 crashes in hibernate
It's just 'Blinky' with hibernate stuff added. I haven't gotten to the point of actually trying to hibernate.
Code:
#include "../../../inc/lm3s6965.h"
#include "../../../hw_types.h"
#include "../../../src/sysctl.h"
#include "../../../src/hibernate.h"
//*****************************************************************************
//
//! addtogroup ek_lm3s6965_revc_list
//! <h1>Blinky (blinky)</h1>
//!
//! A very simple example that blinks the on-board LED.
//
//*****************************************************************************
//*****************************************************************************
//
// Blink the on-board LED.
//
//*****************************************************************************
int main(void)
{
volatile unsigned long ulLoop;
//
// Enable the GPIO port that is used for the on-board LED.
//
SYSCTL_RCGC2_R = SYSCTL_RCGC2_GPIOF;
//
// Do a dummy read to insert a few cycles after enabling the peripheral.
//
ulLoop = SYSCTL_RCGC2_R;
//
// Enable the GPIO pin for the LED (PF0). Set the direction as output, and
// enable the GPIO pin for digital function.
//
GPIO_PORTF_DIR_R = 0x01;
GPIO_PORTF_DEN_R = 0x01;
HibernateClockSelect(HIBERNATE_CLOCK_SEL_DIV128); // Set up hibernation module for 32 kHz input
HibernateEnableExpClk(SysCtlClockGet());
HibernateRTCEnable();
HibernateWakeSet(HIBERNATE_WAKE_RTC);
HibernateRTCMatch0Set(512);
//
// Loop forever.
//
while(1)
{
//
// Turn on the LED.
//
GPIO_PORTF_DATA_R |= 0x01;
//
// Delay for a bit.
//
for(ulLoop = 0; ulLoop < 200000; ulLoop++)
{
}
//
// Turn off the LED.
//
GPIO_PORTF_DATA_R &= ~(0x01);
//
// Delay for a bit.
//
for(ulLoop = 0; ulLoop < 200000; ulLoop++)
{
}
}
}
It still dies at the first call for the hibernate setup. I thought from looking at the hibernate source code that the oscillator startup delay was automatically taken care of.
login or register to reply
cb1
Platinum Boarder
2008/06/26 13:01
Re:LM3S6965 crashes in hibernate
Wonder how/if "hibernate functions" perform when hibernate is NOT invoked!
You may comment out all hibernate reference code - and see if that restores "blinky." We want something to work as we explore further...
login or register to reply
ckuecker
Platinum Boarder
2008/06/26 14:18
Re:LM3S6965 crashes in hibernate
Commented out the five hibernate function calls - blinky is back, LED on for 40 mSec and off for 40 mSec.
The fast narrow negative pulse is still present on the crystal.