Home arrow Support arrow Forums

Luminary Micro Forums

<< Start < Prev 1 2 3 4 5 Next > End >>

ckuecker

Platinum Boarder
Click here to see the profile of this user

2008/06/25 15:08

LM3S6965 crashes in hibernate

While poking around in the hibernate module, using the driver lib code supplied with the LM3S6965 Ethernet Eval Board, I find the code hitting the FaultISR exception when I attempt to save processor state using HibernateDataSet(). The culprit is the line below:

Code:

          //         // Add a delay between writes to the data area.         //         if(CLASS_IS_FURY)         {             //             // Delay a fixed time on Fury-class devices             // >>> Dies here>   SysCtlDelay(g_ulWriteDelay);         }



The actual assembly code that hits the exception is shown below in the disassembly:

if(CLASS_IS_FURY)
00002B7C 4808 LDR R0, [PC, #0x20]

so it necer gets to the delay routine.

I am using the setup code that came with the enet_lwip example project.

login or register to reply

cb1

Platinum Boarder
Click here to see the profile of this user

2008/06/25 15:48

Re:LM3S6965 crashes in hibernate

Don't have any hibernate-capable devices yet so can't replicate your findings.

Always prefer simplicity - could you load in the basic "blinky" program - without the added complexity of ethernet & other functions? Believe that you need to perform a fuller examination of "hibernate" - perhaps smaller/simpler codes with few "hooks" will speed/ease your investigation.

Good luck - keep posting.

login or register to reply

ckuecker

Platinum Boarder
Click here to see the profile of this user

2008/06/25 16:08

Re:LM3S6965 crashes in hibernate

OK. Tried Blinky - it runs rine as it was.

Added the hibernate setup, as I had it - had to add hibernate.c and sysctl.c:

Code:

  #include "../../../inc/lm3s6965.h" #include "../../../hw_types.h" #include "../../../src/sysctl.h" #include "../../../src/hibernate.h" 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; >> dies here>>    HibernateClockSelect(HIBERNATE_CLOCK_SEL_RAW); // 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 0ulLoop 200000ulLoop++)         {         }         //         // Turn off the LED.         //         GPIO_PORTF_DATA_R &= ~(0x01);         //         // Delay for a bit.         //         for(ulLoop 0ulLoop 200000ulLoop++)         {         }     } }



Now, it dies just as my original code did.

Could this just be a bad crystal on the hibernate module? I don't like the waveforms I see there...

login or register to reply

cb1

Platinum Boarder
Click here to see the profile of this user

2008/06/25 19:25

Re:LM3S6965 crashes in hibernate

Check that you have done everything to enable hibernate osc/clock - seems as if you may not be oscillating. You should be able to probe XOsc (out) with a Hi-Z scope probe and see 4.19MHz.

I will read the hibernate chapter again looking for details...

login or register to reply

cb1

Platinum Boarder
Click here to see the profile of this user

2008/06/25 20:50

Re:LM3S6965 crashes in hibernate

Got it!

HIBERNATE_CLOCK_SEL_DIV128 is what you need.
(get rid of the CLOCK_SEL_RAW - that is for the external OSC in)

Thus you never enabled the 4.194MHZ xtal - which is what we reasoned.

This hibernate module is very valuable, powerful - brings LMI into the battery powered arena.

Be sure you have power to HIB and BAT pins.

*** If this doesn't work instantly I may have found an error in hibernate.h.

#define HIBERNATE_CLOCK_SEL_RAW 0x04
#define HIBERNATE_CLOCK_SEL_DIV128 0x00

My read of the DataSheet shows these to be 0x44 and 0x40 (your case - w/ xtal).
Bit 7 enables your xtal. Let us know please...

Post edited by: cb1, at: 2008/06/25 20:57

login or register to reply

ckuecker

Platinum Boarder
Click here to see the profile of this user

2008/06/26 10:22

Re:LM3S6965 crashes in hibernate

All right -I have changed the code to HibernateClockSelect(HIBERNATE_CLOCK_SEL_DIV128);

It still dies at the first call to this function, precisely, it dies at assembly code:

?Subroutine0:
> dies here 00000278 680A LDR R2, [R1]
0000027A 439A BICS R2, R2, R3
0000027C 4302 ORRS R2, R2, R0
0000027E 600A STR R2, [R1]

I see nothing on the 4.194304 MHz cryastal, at either lead. I am using the ethernet eval board, so all power and other signals are there - I hope!

Here's a hint, possibly - when I first powered the eval board up, before I started the IAR IDE, the Blinky program loaded last night started right up and ran - and I saw about a 112 kHz sawtooth on the crystal leads. This was with HibernateClockSelect still using HIBERNATE_CLOCK_SEL_RAW.

I just reset the program in the debugger, exited, and power cycled the eval board. Blinky appears to be running, and I see a 63 Hz negative going pulse train - 600 uSec negative pulses - on the crystal at header pin 56, which is XOSC1 - pin 53 on the processor.

Is the LED blinking because the processor is repeatedly resetting?

I have 32 kHz oscillator units on order - when I get them, I will try again with HIBERNATE_CLOCK_SEL_RAW.

login or register to reply
<< Start < Prev 1 2 3 4 5 Next > End >>