I'm trying to get three dynamically-created (versus
creating statically
under the Tconf gui) tasks running but the
tasks just won't run. They
are successfully created (TSK_create()
returns non-null) but never run
according to the event log. This is
taken from the tsk example under
the bios directory.
Any ideas/help would be appreciated.
--Randy
*************** .tcf file:
var mem_ext = [];
var device_regs = {
/* The property l2Mode specifies the L2 cache setting. The valid
values are:
* "4-way cache (0k)", "4-way cache (32k)", "4-way
cache (64k)",
* "4-way cache (128k)", "4-way cache (256k)"
*/
l2Mode: "4-way cache (0k)"
var
params = {
clockRate: 500,
catalogName:
"ti.catalog.c6000",
deviceName: "6418",
regs:
device_regs,
mem: mem_ext
utils.loadPlatform("ti.platforms.generic",
params);
/**** End custom monitor platform definitions ****/
/*
The following DSP/BIOS Features are enabled. */
bios.enableRealTimeAnalysis(prog);
bios.enableRtdx(prog);
bios.enableTskManager(prog);
bios.GBL.SPECIFYRTSLIB = 0;
bios.MEM.NOMEMORYHEAPS = 0;
bios.MEM.instance("IRAM").createHeap =
1;
bios.MEM.instance("IRAM").heapSize = 0x8000;
//bios.MEM.instance("IRAM").enableHeapLabel = 1;
//bios.MEM.instance("IRAM").heapLabel = prog.extern("iram_heap", "asm");
bios.MEM.BIOSOBJSEG = prog.get("IRAM");
bios.MEM.MALLOCSEG =
prog.get("IRAM");
//bios.TSK.STACKSEG = prog.get("IRAM");
//
!GRAPHICAL_CONFIG_TOOL_SCRIPT_INSERT_POINT!
/**** example
beg ****/
//bios.CLK.HIRESTIME = 1;
//bios.CLK.MICROSECONDS =
1000.0000;
/* Increase the buffer size of the LOG_system LOG object */
bios.LOG_system.bufLen = 256;
/* Create a trace LOG object for printing basic program output. */
var
trace = bios.LOG.create("trace");
trace.bufLen = 256;
trace.logType = "circular";
/* Create three TSKs of equal priority */
//var task0 = bios.TSK.create("task0");
//task0.priority = 1;
//task0["fxn"] = prog.extern("task");
//task0.arg0 = 0;
//
//var task1 = bios.TSK.create("task1");
//task1.priority = 1;
//task1["fxn"] = prog.extern("task");
//task1.arg0 = 1;
//
//var task2 = bios.TSK.create("task2");
//task2.priority = 1;
//task2["fxn"] = prog.extern("task");
//task2.arg0 = 2;
/**** example end ****/
prog.gen();
********** C file:
#include <stdint.h>
#include <std.h>
#include <log.h>
#include
<tsk.h>
#include "monitorcfg.h"
#include "init.h"
Void MyTask(Arg id_arg);
Void main(void)
{
TSK_Attrs
attrs = TSK_ATTRS;
attrs.priority = 8;
attrs.name
= "thr1";
if (TSK_create((Fxn)MyTask, &attrs, 1))
{
SYS_abort("Failed to open thr1 task");
}
attrs.name =
"thr2";
if (TSK_create((Fxn)MyTask, &attrs, 2))
{
SYS_abort("Failed to open thr2 task");
}
attrs.name =
"thr3";
if (TSK_create((Fxn)MyTask, &attrs, 3))
{
SYS_abort("Failed to open thr3 task");
}
Void
MyTask(Arg id_arg)
{
Int id = ArgToInt (id_arg);
Int i;
start:
LOG_printf(&trace, "Task
%d begun", id);
for (i = 0; i < 5 ; i++) {
LOG_printf(&trace, "Loop %d: Task %d Working", i, id);
TSK_yield();
// TSK_sleep(10000);
}
LOG_printf(&trace, "Task %d DONE", id);
goto start;
This
is DSP/BIOS 5.33.06 under CCS 3.3 SR 11.
--
Randy Yates
% "Rollin' and riding and slippin' and
Digital
Signal Labs % sliding, it's magic."
mailto://ya...@ieee.org
%
http://www.digitalsignallabs.com
% 'Living' Thing', *A New World Record*, ELO