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.

AM5728: Clock, Timer and Power Idle Questions

Part Number: AM5728
Other Parts Discussed in Thread: SYSBIOS,

Tool/software:

SDK Linux -06.03.00.106

SDK RTOS -06.03.00.106

Running Linux on host and BIOS-RTOS on DSP1 and DSP2.  I have built and run the ex02_messageq example successfully

I've been trying to understand the following section of the Dsp2.cfg file of the ex02_messageq example. I have read what documentation I can find on the modules in the examples but its more reference and doesnt give much context of why?

  1. Is this specifying that the clock ticks are provide by user code?
  2. Why is  timer being created here?
  3. Is there not a timer built into the RTOS?
  4. Without this timer would a Task_sleep or a wait on a message queue with timeout work?

var Clock = xdc.useModule('ti.sysbios.knl.Clock');
Clock.tickSource = Clock.TickSource_USER;

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

/* Skip the Timer frequency verification check. Need to remove this later */
Timer.checkFrequency = false;

/* Match this to the SYS_CLK frequency sourcing the dmTimers.
* Not needed once the SYS/BIOS family settings is updated. */
Timer.intFreq.hi = 0;
Timer.intFreq.lo = 19200000;

var timerParams = new Timer.Params();
timerParams.period = Clock.tickPeriod;
timerParams.periodType = Timer.PeriodType_MICROSECS;
/* Switch off Software Reset to make the below settings effective */
timerParams.tiocpCfg.softreset = 0x0;
/* Smart-idle wake-up-capable mode */
timerParams.tiocpCfg.idlemode = 0x3;
/* Wake-up generation for Overflow */
timerParams.twer.ovf_wup_ena = 0x1;

/* Create Timer module */
Timer.create(Clock.timerId, Clock.doTick, timerParams);

The second set of questions are regarding the idle loop

  1. Why is the purpose of including the power management module in this example?
  2. Where is the function IpcPower_idle defined?

/*
* ======== Power Management Configuration ========
*/
/* Bring in modules used in Power Management */
xdc.loadPackage('ti.pm');
var Power = xdc.useModule('ti.sysbios.family.c66.vayu.Power');
Power.loadSegment = "PM_DATA";

/*
* Workaround for silicon bug
*
* IpcPower_callIdle must be placed in L2SRAM and not external memory
* to avoid CPU hang when going into idle. We do so by adding an entry
* into the resource table so that the loader can load to internal L2.
*/
Program.sectMap[".text:IpcPower_callIdle"] = "L2SRAM";

/*
* Add function to support Power Management in the Idle loop
* Must be added after all other Idle functions
*/
Idle.addFunc('&IpcPower_idle');