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.

SecondsClock usage

Other Parts Discussed in Thread: TM4C123GH6PGE, SYSBIOS

TIRTOS on a TM4C123GH6PGE.

tirtos_tivac_2_10_01_38

Code Composer Studio Version: 6.0.1.00040

From the cfg file:
var SecondsClock = xdc.useModule('ti.sysbios.hal.SecondsClock');

From this users guide "SYS/BIOS (TI-RTOS Kernel) v6.41" it appears I can use SecondsClock to keep calendar time on my system.

However when compiling this error is generated:

Undefined reference to 'ti_sysbios_hal_Seconds_get__E' in file ./main.obj     .xdchelp    /WM24 TIRTOS       C/C++ Problem

The compiler suggests this a fix:

var ti_sysbios_hal_Seconds = xdc.useModule('ti.sysbios.hal.Seconds');

Adding this to the project lets the program compile, but the unit lockups in Seconds_set at the clock enable bit. Understandable because this hardware is not used on this unit.

Void Seconds_set(UInt32 seconds)

{
UInt32 curSeconds;

/* Turn on the clock enable bit. */
HWREG(HIB_CTL) |= HIB_CTL_CLK32EN;

 

 

The question is how do you get it to compile and use an increment from the clock module like mentioned in the TIRTOS user's guide?

 

  • Hi Gary,

    SecondsClock needs to configured as the SecondsProxy. Here's an example showing how to set the SecondsProxy in the cfg file:

    *.cfg:

    var Seconds = xdc.useModule('ti.sysbios.hal.Seconds'); Seconds.SecondsProxy = xdc.useModule('ti.sysbios.hal.SecondsClock');

    Best,

    Ashish

  • This is clearly the answer so I have marked it as such.

    I was a little confused by the "*.cfg:". I took that out and it does compile and the Seconds_set() and the Seconds_get() become simple operators on SecondsClock_module->seconds and no more lockups. The system then increments the seconds at about the correct rate.

    It would be useful to get a couple of more clarifying comments.

    Please list the source of where you would get this information in the manual.

    Is it true that this can only be done by editing the cfg, not by using the cfg GUI?
  • Hi Gary,

    Gary R said:

    I was a little confused by the "*.cfg:".

    The "*.cfg:" was to indicate that the lines need to go into your config file. My msg formatting had an issue because of which it was hard to understand. Sorry about that.

    Gary R said:


    It would be useful to get a couple of more clarifying comments.

    Please list the source of where you would get this information in the manual.

    Is it true that this can only be done by editing the cfg, not by using the cfg GUI?

    The SupportProxy field for Seconds module is documented here. Section 5.4 of the user guide also has some info on the Seconds module and how SecondsClock can be used as the delegate for this module.
    You can only add the Seconds module through the GUI (XGCONF) but I dont think there is a way to change the SupportProxy in the GUI.
    Best,
    Ashish
  • Thank you.

    This works well. Essentially a realtime clock for free. My project occasionally accesses a network and gets a time update that I can use to update this clock.