Other Parts Discussed in Thread: SYSBIOS
Hello,
I'm using DSP/BIOS 6.21.0.19 on a TCI6482 DSK.
I've successfully run the "RTSC Configuration Templates" Clock Example (see source code at end of this post).
I noticed that CIO host console output only happens after System_exit() is called.
That is, when I remove the call to System_exit() (resulting in a periodically called Swi Clock interrupt), I never get output on the host console.
I worked around this problem by using System_flush() after each System_printf(). This causes console output in every instance that System_printf() is called. But there should be a nicer solution.
In the DSP/BIOS 6 user guide, it says: "Data transfer for between the target and the host is handled by a low-priority task.", so I guess there is a automatically-created task behind the scenes that handles console output. Yet it does not seem to be called, even though my system should idle pretty often.
Does anyone have an idea how to have System_printf() print out data "live"?
Thanks,
Jerry
#include <xdc/std.h>
#include <xdc/runtime/System.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Clock.h>
Void clk0Fxn(UArg arg0);
Void clk1Fxn(UArg arg0);
/*
* ======== main ========
*/
Void main()
{
Clock_Handle clk2;
Clock_Params clkParams;
/* Create a periodic Clock Instance with period = 5 system time units */
Clock_Params_init(&clkParams);
clkParams.period = 1000;
clkParams.startFlag = TRUE;
clkParams.arg = (UArg)0x5555;
Clock_create(clk0Fxn, 1000, &clkParams, NULL);
/* Create an one-shot Clock Instance with timeout = 11 system time units */
clkParams.period = 0;
clkParams.startFlag = FALSE;
clkParams.arg = (UArg)0x6666;
clk2 = Clock_create(clk1Fxn, 11, &clkParams, NULL);
Clock_start(clk2);
BIOS_start();
}
/*
* ======== clk0Fxn =======
*/
Void clk0Fxn(UArg arg0)
{
UInt32 time;
time = Clock_getTicks();
System_printf("System time in clk0Fxn = %lu\n", (ULong)time);
}
/*
* ======== clk1Fxn =======
*/
Void clk1Fxn(UArg arg0)
{
UInt32 time;
time = Clock_getTicks();
System_printf("System time in clk1Fxn = %lu\n", (ULong)time);
System_printf("Calling System_exit() from clk1Fxn\n");
System_exit(0);
}