Other Parts Discussed in Thread: EK-TM4C1294XL
hi,
My customer found a board and run the attachment code. The count is always reset to 0 when count to 0x200.
It only happens on one board and issue follows with TM4C129 after ABA swap.
2022/05/03 17:11:12.176 ==>> Get RTC: 000001FF
2022/05/03 17:11:13.225 ==>> Get RTC: 00000001
//*****************************************************************************
//
// hibernate.c - Hibernation Example.
//
// Copyright (c) 2013-2017 Texas Instruments Incorporated. All rights reserved.
// Software License Agreement
//
// Texas Instruments (TI) is supplying this software for use solely and
// exclusively on TI's microcontroller products. The software is owned by
// TI and/or its suppliers, and is protected under applicable copyright
// laws. You may not combine this software with "viral" open-source
// software in order to form a larger program.
//
// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
// NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
// NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
// DAMAGES, FOR ANY REASON WHATSOEVER.
//
// This is part of revision 2.1.4.178 of the DK-TM4C129X Firmware Package.
//
//*****************************************************************************
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <time.h>
#include "inc/hw_gpio.h"
#include "inc/hw_hibernate.h"
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "inc/hw_sysctl.h"
#include "inc/hw_types.h"
#include "driverlib/debug.h"
#include "driverlib/gpio.h"
#include "driverlib/hibernate.h"
#include "driverlib/interrupt.h"
#include "driverlib/pin_map.h"
#include "driverlib/rom.h"
#include "driverlib/rom_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/uart.h"
#include "grlib/grlib.h"
#include "grlib/widget.h"
#include "grlib/canvas.h"
#include "grlib/pushbutton.h"
#include "drivers/frame.h"
#include "drivers/kentec320x240x16_ssd2119.h"
#include "drivers/pinout.h"
#include "drivers/touch.h"
#include "utils/ustdlib.h"
//*****************************************************************************
//
//! \addtogroup example_list
//! <h1>Hibernate Example (hibernate)</h1>
//!
//! An example to demonstrate the use of the Hibernation module. The user
//! can put the microcontroller in hibernation by touching the display. The
//! microcontroller will then wake on its own after 5 seconds, or immediately
//! if the user presses the RESET button. External WAKE pin and GPIO (PK5)
//! wake sources can also be used to wake immediately from hibernation. The
//! following wiring enables the use of these pins as wake sources.
//! WAKE on J27 to SEL on J37
//! PK5 on J28 to UP on J37
//!
//! The program keeps a count of the number of times it has entered
//! hibernation. The value of the counter is stored in the battery backed
//! memory of the Hibernation module so that it can be retrieved when the
//! microcontroller wakes. The program displays the wall time and date by
//! making use of the calendar function of the Hibernate module. User can
//! modify the date and time if so desired.
//
//*****************************************************************************
//*****************************************************************************
//
// This example demonstrates the different hibernate wake sources. The
// microcontroller is put into hibernation by the user and wakes up based on
// timeout or one of the user inputs. This example also demonstrates the RTC
// calendar function that keeps track of date and time.
//
//*****************************************************************************
int
main(void)
{
uint32_t ui32SysClock;
static uint32_t CurrentRTC, CurrentRTC_old;
uint32_t pui32RTC[2];
//
// Run from the PLL at 120 MHz.
//
ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
SYSCTL_OSC_MAIN | SYSCTL_USE_PLL |
SYSCTL_CFG_VCO_480), 120000000);
//
// Configure the device pins.
//
PinoutSet();
//
// Initialize the UART for console I/O.
//
UARTStdioConfig(0, 115200, ui32SysClock);
UARTprintf("ui32SysClock: %d\n", ui32SysClock);
//
// Hibernation initialization
//
HibernateEnableExpClk(ui32SysClock);
HibernateClockConfig(HIBERNATE_OSC_HIGHDRIVE);
HibernateRTCEnable();
HibernateCounterMode(HIBERNATE_COUNTER_RTC);
//
// Set RTC to 0 to start the test
//
HibernateRTCSet(0);
//
// Loop forever.
//
while(1)
{
//
// Read RTC via USB virtual COM every second
//
do
{
pui32RTC[0] = HibernateRTCGet();
pui32RTC[1] = HibernateRTCSSGet();
}
while(pui32RTC[0] != HibernateRTCGet());
CurrentRTC = pui32RTC[0];
if(CurrentRTC_old!=CurrentRTC){
UARTprintf("Get RTC: %08x\n", CurrentRTC);
CurrentRTC_old = CurrentRTC;
}
}
}
Can I know how to debug it?
BR,
frank

