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-TM4C1294XL: Hibernation mode struct argument incompatibile

Part Number: EK-TM4C1294XL

Hello All,

I'am trying to use Hibernation Mode of TM4C129x Series MCU . My issue is that Iam getting a warning message argument of type "struct tm *" is incompatible with parameter of type "struct tm *" in my code as shown below and hence the hibernate mode not working

struct tm sTime;

uint32_t g_ui32MonthIdx, g_ui32DayIdx, g_ui32YearIdx;
uint32_t g_ui32HourIdx, g_ui32MinIdx,g_ui32SecIdx;

int main(Void)
{

//System clock already enabled SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE); HibernateEnableExpClk(ui32SysClock); HibernateClockConfig(HIBERNATE_OSC_LOWDRIVE); HibernateRTCEnable(); // Configure the hibernate module counter to 24-hour calendar mode. HibernateCounterMode(HIBERNATE_COUNTER_24HR); HibernateCalendarSet(&sTime); //#169-D argument of type "struct tm *" is incompatible with parameter of type "struct tm *" sTime.tm_mon = 11; sTime.tm_mday = 17; sTime.tm_year = 117; sTime.tm_hour = 14; sTime.tm_min = 34; HibernateCalendarSet(&sTime);//#169-D argument of type "struct tm *" is incompatible with parameter of type "struct tm *" while(1) { HibernateCalendarGet(&sTime);//#169-D argument of type "struct tm *" is incompatible with parameter of type "struct tm *" g_ui32HourIdx = sTime.tm_hour ; g_ui32MinIdx = sTime.tm_min ; g_ui32MonthIdx = sTime.tm_mon; g_ui32DayIdx = sTime.tm_mday; g_ui32SecIdx = sTime.tm_sec; sTime.tm_year = sTime.tm_year + 1900; } }

kindly help in resolving the issue.

  • Hi Sumit,

    The "struct m" is a structure defined in the C compiler standard library. Normally you will need to include the time.h as in:
    #include <time.h>

    Do you have the same problem when compiling and running the TivaWare hibernate example? The example also references the "struct m" structure. I'm wondering if you have the same issue.

    Which TivaWare version do you have? Please use the latest version.
    Which CCS compiler version do you have?
  • Charles Tsai said:
    Which CCS compiler version do you have?

    Are you sure Summit is using CCS?

    Charles Tsai said:
    The "struct m" is a structure defined in the C compiler standard library. Normally you will need to include the time.h as in:
    #include <time.h>

    If not, the compiler should have complained about an incomplete type when sTime was declared. Given what I've seen of CCS that, sadly, might be a reason for thinking it is CCS being used.

    Robert

  • Hi Charles,

    I've included the time.h header file in the code . Iam using CCS version 7 , TivaWare_C_Series-2.1.0.12573 . I've been using it from almost a year now and dont want to change the tivaware version now atleast for my current project.

    Strangely , When I use the same code on tivaware launchpad it works with the same tivaware version.

    Dont understand why its not working on the other MCU.
  • Sumit Mourya said:
    Strangely , When I use the same code on tivaware launchpad it works with the same tivaware version.

    Something is missing here, that doesn't make sense. The compiler output won't change because you load the result onto a different board. You must have changed something between the boards and recompiled.

    Robert