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.

C6a8168 sysbios problems

Other Parts Discussed in Thread: SYSBIOS

Hi all

I am now using TI C6a8168evm ref v , with CCS4.2.4 and Blackhawk PCI560 Emulator. I want to use sysbios 6.32 which is installed with CCS in my project, but I came across a lot of problems as follows:

(1)  I use the "Typical" sysbios example in the CCS4.2.4, the example creates a task which call Task_sleep(10) in the main.c, just like:

    a:  System_printf("enter taskFxn()\n");    

    b: Task_sleep(10);

    c: System_printf("exit taskFxn()\n");

when I emulate this example with JTAG , I realize the task never wakes up after sleeping. I use ROV tools to examine the System_printf output, the "exti taskFxn()" never occurs.

why?

(2) Then I create another project using timer, it can work well in simulation with c674x CPU Cycle Accurate Simulator little endian(2 timers).  When I try to emulate in the c618168evm, the timer seems not  to work. The code is as follows: 

//  mytimer.c

#include <xdc/std.h>
#include <xdc/runtime/System.h>
#include <xdc/runtime/Error.h>

#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/hal/Timer.h>

Task_Handle myTask;
Timer_Handle myTimer;
Void myTimerFunc(UArg arg);
Void myTaskFxn(UArg arg);

Int main(UArg arg0, UArg arg1)
{
 System_printf("enter main\n");
 
 // Task_create

 Task_Params taskParams;
 Error_Block eb;
 
 Error_init(&eb);
 
 Task_Params_init(&taskParams); 
 taskParams.stackSize = 512;
 taskParams.priority = 15;
 myTask = Task_create((Task_FuncPtr)myTaskFxn,&taskParams,&eb);
 if(myTask == NULL)
 {
  System_abort("Task create failed \n");
 }
 
 //Timer_create

 Timer_Params timerParams;
 
 Error_init(&eb);
 Timer_Params_init(&timerParams);
 timerParams.period = 1000;
 timerParams.periodType = Timer_PeriodType_MICROSECS;
 timerParams.arg = 1;
 timerParams.startMode = Timer_StartMode_USER;
 timerParams.extFreq.lo = 1000000;
 timerParams.extFreq.hi = 0;
 myTimer = Timer_create(Timer_ANY,myTimerFunc,&timerParams,&eb);
 if(myTimer == NULL)
 {
  System_abort("Timer create failed\n");
 }
 
 BIOS_start();
 return(0);
}
Void myTimerFunc(UArg arg)
{
 System_printf("myTimerFunc arg = %d\n",(Int)arg);
 BIOS_exit(0);
}

Void myTaskFxn(UArg arg)
{
 System_printf("enter myTaskFxn\n");
 
 System_printf("start timer\n");
 Timer_start(myTimer);
 System_printf("wait for timer\n");
 while(1)
 {
  ;
 }
}

// .cfg

var BIOS = xdc.useModule('ti.sysbios.BIOS');
BIOS.clockEnabled = false;
Program.stack = 0x4096;
xdc.useModule('ti.sysbios.knl.Clock');
xdc.useModule('ti.sysbios.hal.Timer');
xdc.useModule('ti.sysbios.knl.Task');

It will fall into the while(1) in the myTaskFxn(), I think there is something wrong with the timer .

Mybe there is something wrong with my code, I hope someone can point it.

Any suggession will be appreciated.

  • Hi,

    We've seen this problem a lot.

    Usually it occurs because the timers are being clocked at a different frequency than what BIOS thinks they're being clocked at.

    I suspect that the timers are being clocked at 20 MHz and your version of BIOS thinks they're being clocked at 32,768 Hz.

    The following FAQ shows how to override the default timer frequency setting for BIOS:

        http://processors.wiki.ti.com/index.php/SYS/BIOS_FAQs#TimerFreqAnchor

    Try adding the above configuration setting to your config file and see if the problem clears up.

    If the above setting doesn't resolve the problem, the other common missconfiguration is that the timers are really being clocked at 32,768 Hz when BIOS thinks they're being clocked at 20 MHz. Using the syntax shown in the FAQ, try setting the Timer module's frequency to 32768 and see if the problem clears up.

    Alan