Tool/software: TI C/C++ Compiler
We're using the TM4C129EKCPDT chip.
I want to do that every time the IO port state is changed, the state (variable data of uint32_t) is saved to HIBDATA register (call HibernateDataSet), and the IO state previously recorded can be read out again when the power is re-energized.(HibernateDataGet function is read out)
The hardware operation is to supply power to the VBAT (PIN 68) PIN via button battery, not to XSOC0 or XSOC1 (PIN 66/67) and crystal vibration.Is there a problem?
Referring to the TI demo, I wrote the following simplified code (actually I not sure how to configure it) :
uint32_t pin_vel = 0x00000001; uint32_t bk_pin = 0x00000000; set_hibernate() { HibernateDataSet(&pin_vel,1); //pin_vel is change depending on the state of the IO } get_hibernate() { SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE); // Enable the hibernate module. HibernateClockConfig(HIBERNATE_OSC_LOWDRIVE); ui32Status = HibernateIntStatus(0); HibernateIntClear(ui32Status); if(HibernateIsActive()) { HibernateDataGet(&bk_pin,1); //read data to bk_pin rt_kprintf("read value =%ld\r\n",bk_pin); //Gets the value written before power off and prints it out } } void hib_thread() { //other init get_hibernate() while(1) { get_hibernate(); //Constantly writing "pin_vel" value ,"pin_vel "is will change delay(); } }
The program runs printing to get a value of 0, not written value. How should the software be modified?
I need detailed configuration .I tried to configure it myself many times, but the test didn't work.
Because I'm using TI's chip for the first time, it's not very familiar.I'd better be able to give me a simple program that only implements what I want.
thank you !