Tool/software: TI-RTOS
Hello,
Right out of the box, the "New Project" code that is generated by CCS and Sys/Bios TI-RTOS creates a "task". With a "Task_sleep(10)" in it. Which blocks and never returns. The code is simply this:
/*
* ======== main.c ========
*/
#include <xdc/std.h>
#include <xdc/runtime/Error.h>
#include <xdc/runtime/System.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
/*
* ======== taskFxn ========
*/
Void taskFxn(UArg a0, UArg a1)
{
System_printf("enter taskFxn()\n");
Task_sleep(10);
System_printf("exit taskFxn()\n");
System_flush(); /* force SysMin output to console */
}
/*
* ======== main ========
*/
Int main()
{
Task_Handle task;
Error_Block eb;
System_printf("enter main()\n");
Error_init(&eb);
task = Task_create(taskFxn, NULL, &eb);
if (task == NULL) {
System_printf("Task_create() failed!\n");
BIOS_exit(0);
}
BIOS_start(); /* does not return */
return(0);
}
I have three different projects, all autogenerated from CCS 7.2 and built with either GNU 4.9.3, GNU 6.3.1 or TI 16.9.3. Not one of them works. They use SYS/BIOS 6.46.5.55
I place a break point right after the "Task_sleep(10)" but it is never reached it. When I place a break point before "Task_sleep(10)" and step into it, it never returns.
So I looked into the BeagleBone Black "blink" example. It doesn't use that call. it uses "while(...) " loop to delay. I guess whoever created the example, must have known it was broken.
My searches have yeilded people from 4 years ago with problems. None of which seems to apply to the current environment.
( All this started when I discovered I had to import a couple StarterWare projects for USB because they were removed from the new SYS/BIOS TI-RTOS. Deep down in there, there is a "Sysdelay()" function, which also doesn't work. I have stepped deep into the code, and see it is using Timer7, but the interrupt never fires despite the appearance that everything is configured correctly. )
Any idea why the "out of the box" samples are broken? Or more importantly, why this simple function is broken? I'd post my entire project, but anyone can duplicate it simply by creating a new "typical" "Sys/Bios" new project.
-CSW