Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

Trouble to get data from the Hibernation module non-volatile memory LM4F120H5Q

$
0
0

I try to put controller into the hibernation mode, preserve a data before and restore a data after the code restart . But I have a trouble: I get an unexpected data after wake up. My code looke like this:

unsigned long static_array;

void main()

{

...

ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE);

ROM_HibernateEnableExpClk(ROM_SysCtlClockGet());

if(ROM_HibernateIsActive())
{
        ulStatus = ROM_HibernateIntStatus(0);
        if(ulStatus & (HIBERNATE_INT_PIN_WAKE))
        {
               ROM_HibernateDataGet(&static_array, 1);
              PulseLed(PIN_BLUE);
       }
}

static_array++;
uart_write((char *)&static_array, 1); // verify the value of static_array variable

...

// put controller into hibernate mode

}

void hibernate_start(void)

{

        ...

       ROM_HibernateDataSet(&static_array, 1);

       PulseLed(PIN_RED);

       ...

}

I sure that hibernate mode work correctly. But after the processor waked up I always get from UART only 0x01, I expect an increasing value.


Viewing all articles
Browse latest Browse all 262198

Trending Articles