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.

RTOS/MSP432P401R: Why can't my program go into clockFxn?

Part Number: MSP432P401R


Tool/software: TI-RTOS

Hi all,

I initial a clock as the following:

Error_Block eb;
Error_init(&eb);

Clock_Params params;
Clock_Params_init(&params);

uint32_t timeout = 0;

params.period = 10 * 1000 * 1000 / Clock_tickPeriod;    // 10s
params.startFlag = FALSE;
ClockHandle_ADP5062 = Clock_create((Clock_FuncPtr) ClockFxn_ADP5062, timeout, &params, &eb);

When timeout = 0, the program don't go into ClockFxn_ADP5062. However, when timeout = other value, the program don't go into ClockFxn_ADP5062.

Why is this ?

Best Regards,

Gilbert

  • Hi Gilbert,

    Not really sure, let me look into this. Could you please confirm that you are using the RED Launchpad? And also could please let me know which SDK version are you using??

    Thanks,

    David
  • Hi Gilbert,

    After looking at the clock documentation.

    "The 'timeout' argument is used to specify the startup timeout for both one-shot and periodic Clock instances (in Clock ticks). This timeout is applied when the Clock instance is started. For periodic instances, the configured Clock function will be called initially after an interval equal to the timeout, and will be subsequently called at the rate specified by the period parameter. For one-shot instances (where the period parameter is 0), once the Clock instance is started (with Clock_start() or automatically if startFlag is true) the configured Clock function will be called once after an interval equal to the timeout."

    Try setting your timeout equal to your period and that should do the trick. Anyway I'm attaching my example code as reference.

     Hopefully this helps.

        David

  • Hi DavidL,

    The hardware that I'm using is my custom board. And the version of SDK is tirtos_msp43x_2_16_01_14.

    Best Regards,
    Gilbert
  • Hi DavidL,

    I am sorry because of an error in the description of  my question.

    The question should be the following:

    "When timeout = 0, the program don't go into ClockFxn_ADP5062. However, when timeout = other value, the program can go into ClockFxn_ADP5062.  Why is this ?"

    Best Regards,

    Gilbert

  • Since you have params.startFlag = FALSE, you must manually start it with Clock_start(handle).
    You can look at the Clock documentation in TI-"RTOS Kernel Runtime APIs and Configuration (cdoc)" in the documentation overview html page for more details. For example, it describes periodic vs one-shot, starting/delayed starting/stopping, etc.

    Todd
  • Hi ToddMullanix,

    I am sure that my program has called Clock_start(handle) before waiting the clock timeout. Also I think it is a good idea to set timeout = period and it can work. But in my understanding, although timeout = 0, the clock will periodically call the clock_function.

    Best Regards,

    Gilbert

**Attention** This is a public forum