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.

TMDSCNCD28388D: TMS320F28388x SYS/BIOS General purpose timers management

Part Number: TMDSCNCD28388D
Other Parts Discussed in Thread: SYSBIOS

Hello All

now I develop some software for  TMS320F28388

Now I started On the side CM SYS/BIOS(&.76.01.12) and TCP/IP stack

Example tcpEchoF2838X.

The CM contains 3 General purpose timers.

I know that

SYS/BIOS use 1 timer for Scheduling

TCP/IP     use 1 timer for Scheduling as well.

So it is left 1 timer

And I going to use this timer   to caculate some interval and generate hwi but I have met some problem. 

In configuartion file

I wrote

//var Timer = xdc.useModule('ti.sysbios.family.arm.lm4.Timer');
/*****************************************************************/
 
 //var Timer =xdc.useModule('ti.sysbios.hal.Timer');
 var Timer = xdc.useModule('ti.sysbios.timers.gptimer.Timer');
var timerParams = new Timer.Params();
timerParams.periodType = Timer.PeriodType_MICROSECS;
timerParams.period = 1000;   //2ms
timerParams.arg = 1;
timerParams.startMode = Timer.StartMode_USER;

Program.global.myTimer = Timer.create( (~0), "&myIsr", timerParams);

So I used  consiquently 

var Timer = xdc.useModule('ti.sysbios.family.arm.lm4.Timer');

or

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

Compilation error - "There is not avalable timers"  if I use

Timer.create( 1 , "&myIsr", timerParams);

with 1 or other number of timer

So other compilation error like "wrong timer index "

If I use

var Timer = xdc.useModule('ti.sysbios.timers.gptimer.Timer');

the compilation error  "timers unsupported on device"

So the documentaion of SYS/BIOS    does not contain the enumaration of timers  for TMS320F28388

like for other processors

So

Question is

1 How to get know which timers are occuped ?

2) How to calculate time interval in case if all timers are occuped?

3)The SYS/BIOS window looks like on the picture 

  The question is why in Target Specific Support/Arm exists to Arms M3 (Ducati) and M4(Tiva) with its own periphery (for example M3 contains the cashe and AMMU )?

   What is the  LM4-specific Timer managment?

   What do the pointed by arrows,  red points mean?

  Best regards

  Andrii

  • Hello All

    So I have added the picture

    Best Regards

    Andrii Shevchuk

  • Andrii,

    The easiest way is to open CCS->Tools->ROV and look at the timer module to see the timers being used.

    Todd

  • Hello All and TI

    May be TI thinks that issue is resolved but I do not think so.

      The previous suggetion does not lead to solution - ROV indicate only 1 timer occupied as system clock

    Where other timers disappeared ?

    Why compilation produces error in above mentioned cases?

    Best regards

    Andrii

  • Hi Andrii,

    The lm4 timer is not supported for the F2838x device class. Try using the family.arm.m3 timer instead.

    -Kevin

  • Hi Kevin

    Accordinghly  e2e.ti.com/.../446881

    "ti.sysbios.family.arm.m3.Timer corresponds to the SYSTICK timer.  There is only one of these timers, and by default this timer is used to provide Clock and Timestamp services. "

    The  ROV confirm it.

    The function  Timer_getNumTimers(); (module ti.sysbios.hal.Timer)

    return 1

    So accordinghly documentation, the TMS320F28388x CM has 3 general purpose timers,

    So the question is still - Where other timers disappeared ?

    and how to use these one ?

    Best regards

    Andrii

  • When looking at other threads, please make sure that it is the correct device as different platforms will support different timers in SYS/BIOS.

    i have talked to my colleagues and it seems that the code that would return the right info about timers is missing for your platform.

    You could try looking into the timestamp module. It provides timing services without needing to allocate/create a new timer. 

    -Kevin

     

  • Hi Kevin

                   Timestamp_get64(&l_tTime_Stamp64_Start) ;
                    usleep(1000);
                   Timestamp_get64(&l_tTime_Stamp64_Stop);
                   System_printf("%u\n",l_tTime_Stamp64_Stop.lo - l_tTime_Stamp64_Start.lo);

    So Ouutput like   386810, 386808, 

       some time it 405324 405323

    You can see below additionaly my related thread "TMS320F28388 CM side the function Timestamp_getFreq() return wrong value"

    I started the example  tcpEchoF2838X and modified this one for my necessity .

    Types_FreqHz l_tTimer_Freq ;
       l_tTimer_Freq.hi =0;
       l_tTimer_Freq.lo =0;
       Timestamp_getFreq(&l_tTimer_Freq);

    So function Timestamp_getFreq(), which has to return frequency of timer in Herz , return 250000000 in the l_tTimer_Freq.lo

    There is screenshoot above how it looks like the platform depend features.

    Accordighly  ROV

    threre are 2 timers

    first

    [
        {
            "module": "ti.sysbios.family.arm.m3.Timer",
            "view": "Basic"
        },
        [
            {
                "address": "0x20001180",
                "halTimerHandle": null,
                "label": "",
                "id": "0",
                "device": "SysTick",
                "startMode": "StartMode_AUTO",
                "runMode": "RunMode_CONTINUOUS",
                "period": "125000",
                "periodType": "PeriodType_COUNTS",
                "intNum": "15",
                "tickFxn": [
                    "ti_sysbios_knl_Clock_doTick__I"
                ],
                "arg": "0x0",
                "extFreq": "0",
                "hwiHandle": "0x20001350"
            }
        ]
    ]

    and Second

    [
        {
            "module": "ti.sysbios.hal.Timer",
            "view": "Raw"
        },
        {
            "Module State": null,
            "Instance States": [],
            "Module Configuration Parameters": {
                "$category": "Module",
                "$name": "ti.sysbios.hal.Timer",
                "ANY": "-1",
                "Module__diagsEnabled": "32784",
                "Module__diagsIncluded": "49299",
                "Module__diagsMask": "&ti_sysbios_hal_Timer_Module__root__V.mask",
                "Module__gateObj": null,
                "Module__gatePrms": null,
                "Module__id": "32806",
                "Module__loggerDefined": false,
                "Module__loggerFxn0": null,
                "Module__loggerFxn1": null,
                "Module__loggerFxn2": null,
                "Module__loggerFxn4": null,
                "Module__loggerFxn8": null,
                "Module__loggerObj": null,
                "Object__count": "0",
                "Object__heap": null,
                "Object__sizeof": "0",
                "Object__table": null,
                "TimerProxy": {
                    "$category": "Module",
                    "$name": "ti.sysbios.family.arm.m3.Timer",
                    "ANY": "-1",
                    "E_cannotSupport": {
                        "$category": "Struct",
                        "$name": "xdc.runtime.Error.Desc#37",
                        "code": "0",
                        "msg": "E_cannotSupport: Timer cannot support requested period %d"
                    },
                    "E_invalidTimer": {
                        "$category": "Struct",
                        "$name": "xdc.runtime.Error.Desc#35",
                        "code": "0",
                        "msg": "E_invalidTimer: Invalid Timer Id %d"
                    },
                    "E_notAvailable": {
                        "$category": "Struct",
                        "$name": "xdc.runtime.Error.Desc#36",
                        "code": "0",
                        "msg": "E_notAvailable: Timer not available %d"
                    },
                    "MAX_PERIOD": "16777215",
                    "MIN_SWEEP_PERIOD": "1",
                    "Module__diagsEnabled": "32784",
                    "Module__diagsIncluded": "49299",
                    "Module__diagsMask": "&ti_sysbios_family_arm_m3_Timer_Module__root__V.mask",
                    "Module__gateObj": null,
                    "Module__gatePrms": null,
                    "Module__id": "32816",
                    "Module__loggerDefined": false,
                    "Module__loggerFxn0": null,
                    "Module__loggerFxn1": null,
                    "Module__loggerFxn2": null,
                    "Module__loggerFxn4": null,
                    "Module__loggerFxn8": null,
                    "Module__loggerObj": null,
                    "NUM_TIMER_DEVICES": "1",
                    "Object__count": "0",
                    "Object__heap": null,
                    "Object__sizeof": "0",
                    "Object__table": null,
                    "TIMER_CLOCK_DIVIDER": "1",
                    "anyMask": "1",
                    "common$": {
                        "$category": "Struct",
                        "$name": "ti.sysbios.family.arm.m3.Timer/common$",
                        "diags_ANALYSIS": "xdc.runtime.Diags.ALWAYS_ON",
                        "diags_ASSERT": "xdc.runtime.Diags.ALWAYS_ON",
                        "diags_ENTRY": "xdc.runtime.Diags.RUNTIME_ON",
                        "diags_EXIT": "xdc.runtime.Diags.RUNTIME_ON",
                        "diags_INFO": "xdc.runtime.Diags.RUNTIME_ON",
                        "diags_INTERNAL": "xdc.runtime.Diags.ALWAYS_OFF",
                        "diags_LIFECYCLE": "xdc.runtime.Diags.ALWAYS_OFF",
                        "diags_STATUS": "xdc.runtime.Diags.RUNTIME_ON",
                        "diags_USER1": "xdc.runtime.Diags.ALWAYS_OFF",
                        "diags_USER2": "xdc.runtime.Diags.ALWAYS_OFF",
                        "diags_USER3": "xdc.runtime.Diags.ALWAYS_OFF",
                        "diags_USER4": "xdc.runtime.Diags.ALWAYS_OFF",
                        "diags_USER5": "xdc.runtime.Diags.ALWAYS_OFF",
                        "diags_USER6": "xdc.runtime.Diags.ALWAYS_OFF",
                        "diags_USER7": "xdc.runtime.Diags.RUNTIME_ON",
                        "diags_USER8": "xdc.runtime.Diags.ALWAYS_ON",
                        "fxntab": false,
                        "gate": {
                            "$category": "Instance",
                            "$name": "ti.sysbios.gates.GateHwi.Instance#0",
                            "Q_BLOCKING": "1",
                            "Q_PREEMPTING": "2",
                            "instance": {
                                "$category": "Struct",
                                "$name": "ti.sysbios.gates.GateHwi.Instance#0/instance",
                                "name": null
                            }
                        },
                        "gateParams": null,
                        "instanceHeap": null,
                        "instanceSection": null,
                        "logger": null,
                        "memoryPolicy": "xdc.runtime.Types.DELETE_POLICY",
                        "namedInstance": false,
                        "namedModule": true,
                        "outPolicy": "xdc.runtime.Types.COMMON_FILE",
                        "romPatchTable": false
                    },
                    "defaultDynamic": false,
                    "rovViewInfo": {
                        "$category": "Instance",
                        "$name": "xdc.rov.ViewInfo.Instance#33",
                        "argsMap": {
                            "$category": "Map",
                            "$name": "xdc.rov.ViewInfo.Instance#33/argsMap"
                        },
                        "showRawTab": true,
                        "viewMap": [
                            {
                                "$category": "Struct",
                                "$name": "xdc.rov.ViewInfo.Instance#33/viewMap/'Basic'",
                                "argsName": null,
                                "structName": "BasicView",
                                "type": "xdc.rov.ViewInfo.INSTANCE",
                                "viewInitFxn": "viewInitBasic"
                            },
                            {
                                "$category": "Struct",
                                "$name": "xdc.rov.ViewInfo.Instance#33/viewMap/'Device'",
                                "argsName": null,
                                "structName": "DeviceView",
                                "type": "xdc.rov.ViewInfo.INSTANCE",
                                "viewInitFxn": "viewInitDevice"
                            },
                            {
                                "$category": "Struct",
                                "$name": "xdc.rov.ViewInfo.Instance#33/viewMap/'Module'",
                                "argsName": null,
                                "structName": "ModuleView",
                                "type": "xdc.rov.ViewInfo.MODULE",
                                "viewInitFxn": "viewInitModule"
                            }
                        ]
                    },
                    "startupNeeded": "1",
                    "supportsDynamic": false,
                    "timerInUse": true
                },
                "common$": {
                    "$category": "Struct",
                    "$name": "ti.sysbios.hal.Timer/common$",
                    "diags_ANALYSIS": "xdc.runtime.Diags.ALWAYS_ON",
                    "diags_ASSERT": "xdc.runtime.Diags.ALWAYS_ON",
                    "diags_ENTRY": "xdc.runtime.Diags.RUNTIME_ON",
                    "diags_EXIT": "xdc.runtime.Diags.RUNTIME_ON",
                    "diags_INFO": "xdc.runtime.Diags.RUNTIME_ON",
                    "diags_INTERNAL": "xdc.runtime.Diags.ALWAYS_OFF",
                    "diags_LIFECYCLE": "xdc.runtime.Diags.ALWAYS_OFF",
                    "diags_STATUS": "xdc.runtime.Diags.RUNTIME_ON",
                    "diags_USER1": "xdc.runtime.Diags.ALWAYS_OFF",
                    "diags_USER2": "xdc.runtime.Diags.ALWAYS_OFF",
                    "diags_USER3": "xdc.runtime.Diags.ALWAYS_OFF",
                    "diags_USER4": "xdc.runtime.Diags.ALWAYS_OFF",
                    "diags_USER5": "xdc.runtime.Diags.ALWAYS_OFF",
                    "diags_USER6": "xdc.runtime.Diags.ALWAYS_OFF",
                    "diags_USER7": "xdc.runtime.Diags.RUNTIME_ON",
                    "diags_USER8": "xdc.runtime.Diags.ALWAYS_ON",
                    "fxntab": false,
                    "gate": {
                        "$category": "Instance",
                        "$name": "ti.sysbios.gates.GateHwi.Instance#0",
                        "Q_BLOCKING": "1",
                        "Q_PREEMPTING": "2",
                        "instance": {
                            "$category": "Struct",
                            "$name": "ti.sysbios.gates.GateHwi.Instance#0/instance",
                            "name": null
                        }
                    },
                    "gateParams": null,
                    "instanceHeap": null,
                    "instanceSection": null,
                    "logger": null,
                    "memoryPolicy": "xdc.runtime.Types.DELETE_POLICY",
                    "namedInstance": false,
                    "namedModule": true,
                    "outPolicy": "xdc.runtime.Types.COMMON_FILE",
                    "romPatchTable": false
                },
                "defaultDynamic": false,
                "supportsDynamic": false
            }
        }
    ]

    Best regards

    Andii

  • Thank you for the information.

    The second timer you mentioned is simply an abstraction layer that refers to the device timer. The timer that this device should be using is the ti.sysbios.family.arm.m3 timer. The fact that the corresponding hal timer is only displaying the one clock timer is incorrect. I have passed this information on to my colleagues.

    Meanwhile, the timestamp issue will be resolved in its respective thread.

    -Kevin