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.

Trying to Create Clock at Runtine

Other Parts Discussed in Thread: SYSBIOS, CC3200

Hi SysBios Users,

I am *trying* to learn sys bios and I wish to create clock function from C on CC3200 launch pad.

If I use the .cfg it work, but I am unable to create the clock using C code.

In the attached code the clock is always created as NULL.

Could some point me to what I have done wrong?

Cheers

Stuart

/* XDCtools Header files */
#include <xdc/std.h>
#include <xdc/cfg/global.h>
#include <xdc/runtime/System.h>
#include <xdc/runtime/Error.h>

/* BIOS Header files */
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/knl/Clock.h>

/* TI-RTOS Header files */
#include <ti/drivers/I2C.h>

/* Example/Board Header files */
#include "Board.h"

Void clockFunction(UArg arg) {

}

int main(void)
{
    Board_initGeneral();
    Board_initGPIO();
    Board_initI2C();
    System_printf("System Started\n");

    Error_Block eb;
    Clock_Handle clock;
    Clock_Params clockParams;
    Clock_Params_init(&clockParams);
    clockParams.period = 4;/* every 4 Clock ticks */
    clockParams.startFlag = TRUE;/* start immediately */
    clock = Clock_create((Clock_FuncPtr)clockFunction, 4, &clockParams, &eb);
    if (clock == NULL) {
       System_abort("clock create failed");
    }

    System_flush();
    BIOS_start();

    return (0);
}