Tool/software: Code Composer Studio
Hi
i'm trying to check if my board went into Hibernation module or it didn't. I'm using TM4C123G LaunchPad and i managed to configure it to go into Hibernation by the use of sw1 and here is the soft i did.
void ConfigureUART(void) { // // Enable the GPIO Peripheral used by the UART. // ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); // // Enable UART0 // ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); // // Configure GPIO Pins for UART mode. // ROM_GPIOPinConfigure(GPIO_PA0_U0RX); ROM_GPIOPinConfigure(GPIO_PA1_U0TX); ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); // // Use the internal 16MHz oscillator as the UART clock source. // UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC); // // Initialize the UART for console I/O. // UARTStdioConfig(0, 115200, 16000000); } //***************************************************************************** // // The interrupt handler for the Buttons. // //***************************************************************************** void BottonsHandler(void){ if((GPIOIntStatus(GPIO_PORTF_BASE,true)& Buttoninit1)) { GPIOIntClear(GPIO_PORTF_BASE,Buttoninit1);// Clear interrupt flag TimerEnable(TIMER0_BASE, TIMER_A);//Enables the timer } else if((GPIOIntStatus(GPIO_PORTF_BASE,true)& Buttoninit0)) { GPIOIntClear(GPIO_PORTF_BASE,Buttoninit0);// Clear interrupt flag TimerDisable(TIMER0_BASE, TIMER_A);//Disables the timer SysCtlPeripheralDisable(SYSCTL_PERIPH_HIBERNATE);//Disables the Hibernation module HibernateGPIORetentionDisable();//Disable GPIO retention HibernateDisable();//Disables the Hibernation module for operation. } } void configureButtons(void){ //configureButton0 GPIOPinTypeGPIOInput(ButtonBase, Button0); GPIOPadConfigSet(ButtonBase ,Button0,GPIO_STRENGTH_2MA,GPIO_PIN_TYPE_STD_WPU);// Register our handler function for port F GPIOIntTypeSet(GPIO_PORTF_BASE,GPIO_PIN_0,GPIO_FALLING_EDGE);// Configure PF4 for falling edge trigger GPIOIntRegister(GPIO_PORTF_BASE,BottonsHandler); // Register our handler function for port F GPIOIntEnable(GPIO_PORTF_BASE, GPIO_INT_PIN_0);// Enable interrupt for PF0 //configureButton1 GPIOPinTypeGPIOInput(ButtonBase, Button1); GPIOPadConfigSet(ButtonBase ,Button1,GPIO_STRENGTH_2MA,GPIO_PIN_TYPE_STD_WPU);// Register our handler function for port F GPIOIntTypeSet(GPIO_PORTF_BASE,GPIO_PIN_4,GPIO_FALLING_EDGE);// Configure PF4 for falling edge trigger GPIOIntRegister(GPIO_PORTF_BASE,BottonsHandler);// Register our handler function for port F GPIOIntEnable(GPIO_PORTF_BASE, GPIO_INT_PIN_4);// Enable interrupt for PF4 } void Timer0IntHandler(void) { // // Clear the timer interrupt. // TimerIntClear(TIMER0_BASE, TIMER_TIMA_TIMEOUT); UARTprintf("Hibernate mode is on!\n"); SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE);// enable the hibernation module HibernateEnableExpClk(SysCtlClockGet());//defines the clock supplied to the hibernation module HibernateGPIORetentionEnable(); //Calling this function enables the GPIO pin state to be maintained during hibernation . SysCtlDelay(SysCtlClockGet()/10 ); HibernateWakeSet(HIBERNATE_WAKE_PIN);//set the wake condition to the wake pin SysCtlDelay(SysCtlClockGet()/10 ); //GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_3, 0);//turn off the green LED before the device goes to sleep. /*function requests the Hibernation module to disable the external regulator, removing power from the processor and all peripherals.*/ HibernateRequest(); } //***************************************************************************** // // Print "Hello World!" to the UART on the evaluation board. // //***************************************************************************** int main(void) { //volatile uint32_t ui32Loop; // // Enable lazy stacking for interrupt handlers. This allows floating-point // instructions to be used within interrupt handlers, but at the expense of // extra stack usage. // //ROM_FPULazyStackingEnable(); // // Set the clocking to run directly from the crystal. // ROM_SysCtlClockSet(SYSCTL_SYSDIV_5 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN); // // Enable the GPIO port that is used for the on-board LED. // ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); // // Enable the GPIO pins for the LED (PF2 & PF3). // ROM_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3); // // Enable the peripherals used by this example. // ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0); // // Registers an interrupt handler for the timer interrupt. // TimerIntRegister(TIMER0_BASE,TIMER_A,Timer0IntHandler); // // Enable processor interrupts. // ROM_IntMasterEnable(); // // Configure the two 32-bit periodic timers. // ROM_TimerConfigure(TIMER0_BASE, TIMER_CFG_PERIODIC); ROM_TimerLoadSet(TIMER0_BASE, TIMER_A, ROM_SysCtlClockGet()); // // Setup the interrupts for the timer timeouts. // ROM_IntEnable(INT_TIMER0A); ROM_TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT); // // Initialize the UART. // ConfigureUART(); // //Initialize the Buttons. // configureButtons(); // // Hello! // UARTprintf("Hello, world!\n"); SysCtlDelay(SysCtlClockGet()); while(1) { UARTprintf("Run mode is on!\n"); SysCtlDelay(SysCtlClockGet()); GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_3,GPIO_PIN_3 ); SysCtlDelay(SysCtlClockGet()/10 ); GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_3,0); SysCtlDelay(SysCtlClockGet()/10 ); } }
So what i did is that i removed the jumper from the lunchpad and i tried to mesure the current in the different modes but the DMM doesn't show any differences during the different modes.
so if you know how to check if the board went into hibernation with the use of some command and the terminal i would be gratefull.
thank you.
Best regards
Amine.