This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

EK-TM4C129EXL: Ti-RTOS and RTC

Part Number: EK-TM4C129EXL

hello,

unfortunately, I can not find an example showing the use of the RTC module in TI-RTOS.

I only found the hibernation example without TI-RTOS.

I have installed this in a function in TI-RTOS.

That's how it works. When I wrap the file for the hibernation module #include <driverlib / hibernate.h>, I get the warning: 233-D declaration is not visible outside of function.

Can I use the RTC from the Hibernation module in Ti-RTOS?

Are there any better ways to use an RTC?

I have an external clock of 32,768kHz on XOSC0 / 1.

Here is my code under TI-RTOS in the file TM4C129EXL.c:

#include <driverlib/hibernate.h>

void EK_TM4C129EXL_initHibernateMode(void)
{
    SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE);

    HibernateEnableExpClk(SysCtlClockGet());
    HibernateClockConfig(HIBERNATE_OSC_LOWDRIVE);
    HibernateRTCEnable();
    HibernateCounterMode(HIBERNATE_COUNTER_RTC);
    uint8_t i;
    for (i = 0; i < 100; ++i)
    {
    	 uint32_t secdec = HibernateRTCSSGet() * 1000/32768; // secdec ist 0.xx Sekunden
    	 System_printf("%d\n", secdec);	System_flush();
	}

    if(HibernateIsActive())
	{
    	_nop();
	}
    else
    {
    	_nop();
    }

}

  • Hi, it is me again;)
    The warning: "233-D: declaration is not visible outside of function" I have eliminated by including the file time.h before the include for the Hibernate module. Apparently hibernate.h needs the data structure tm.
    The question remains:

    Can I use the RTC of the Hibernate module without any problems, since there is no driver in TI-RTOS for it.

    Can this lead to other problems?

     

    I find nowhere examples in TI-RTOS for this Hibernate module

  • Hi Kram,

     I'm able to reproduce your warning. By including the time.h is the correct way to resolve the warning.

     Also to answer your question, the TI-RTOS does not natively have drivers for Hibernation module. Yes, you will need to use the TivaWare hibernation module drivers in the TI-RTOS. I can't think of a reason why it will be a problem to use RTC in the TI-RTOS. I will suggest you create a small non-TI-RTOS project with RTC and make it work according to your requirement first and then port the code to your TI-RTOS environment. 

  • Thank you for your answer. I have implemented the hibernate modul successfully;