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.

RTOS/AM3352: How to set current time

Part Number: AM3352
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

Hi .

I'm porting the below onto AM335 RTOS.

https://github.com/wolfSSL/wolfssl-examples/blob/master/tirtos_ccs_examples/tcpEcho_Client_TivaTM4C1294NCPDT/tcpEcho.c

By looking at the NDK docs==> http://www.ti.com/lit/ug/spru523k/spru523k.pdf

How to call this kind of API?

MYTIME_init();
MYTIME_settime(1408053541);

BR Rio

  • The RTOS team have been notified. They will respond here.
  • Rio,

    These functions are available in NDK 2.24x, see software-dl.ti.com/.../mytime_8h.html
    but removed in NDK 2.25x.

    As the AM335x has built in real-time clock, you may use CSL APIs to setup the current time, see PDK packages\ti\board\diag\rtc\src\rts_test.c for reference.

    Regards,
    Garrett
  • Hi .

    Thanks.

    But, If I ingrate the RTC example code into my project,

    I will have the below compile error if I enable those 2 lines that arrows pointed. (INTCXXXXX).

    how to solve this?

    BR Rio

    static void RtcTimerIntrInit(uint32_t intNum)
    {
    /* Initialize the Interrupt Controller. */
    INTCInit(INTC_NON_SECURE_MODE);<-----------------------------------------------------------------------------

    /* Do the interrupt related configurations */
    gRtcAppIntrParams.triggerType = INTC_TRIG_HIGH_LEVEL;
    gRtcAppIntrParams.priority = 0x20U;
    /*
    ** Assign the ISR to the function pointer to invoke when the
    ** interrupt is raised.
    */
    gRtcAppIntrParams.pFnIntrHandler = &RtcTimerIsr;
    gRtcAppIntrParams.pUserParam = gRtcHandle;
    gRtcAppIntrParams.isIntrSecure = FALSE;
    /* Configure the interrupt Controller */
    INTCConfigIntr(intNum, &gRtcAppIntrParams, FALSE);<---------------------------------------------------------
    }

    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    My compile error

    C:/TI/pdk_am335x_1_0_9/packages/ti/starterware/binary/soc/lib/am335x-evm/a8/release/gcc\libsoc.a(intc.o): In function `IntDefaultHandler':
    intc.c:(.text.IntDefaultHandler+0x8): undefined reference to `CONSOLEUtilsPuts'
    intc.c:(.text.IntDefaultHandler+0x10): undefined reference to `CONSOLEUtilsPuts'
    collect2.exe: error: ld returned 1 exit status
    gmake[1]: *** [bmc_test_arm335x_ftp_sk.out] Error 1
    makefile:230: recipe for target 'all' failed
    gmake: *** [all] Error 2

  • Hi .
    Can I use the below code to get the current time?
    I'm reference this page:
    e2e.ti.com/.../2064127

    //Rio: Time test
    time_t t;
    struct tm *ltm;
    char *curTime;

    Seconds_set(1480877209);
    t = time(NULL);
    ltm = localtime(&t);
    curTime = asctime(ltm);
    I2C_log("Time(GMT): %s\n", curTime);


    If this is okay, however, I still have this error.

    C:\TI\pdk_am335x_1_0_9\packages\MyExampleProjects\NIMU_FtpExample_skAM335x_armExampleproject\Debug/../main.c:236: undefined reference to `ti_sysbios_hal_Seconds_set__E'

    BR Rio
  • Rio,

    CONSOLEUtilsPuts() is from console_utils.c in C:\ti\pdk_am335x_1_0_9\packages\ti\starterware\utils. Linking libutils.a in
    C:\ti\pdk_am335x_1_0_9\packages\ti\starterware\binary\utils\lib\am335x-evm\a8\release\gcc should resolve the "undefined reference" issue.

    Seconds_set() is a hal function and device specific, which is supported in limited devices only.

    Regards,
    Garrett