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.

CCS/LAUNCHXL-CC2650: CC2650 launchXL Clock callback stuck

Part Number: LAUNCHXL-CC2650
Other Parts Discussed in Thread: CC2650

Tool/software: Code Composer Studio

Hello

I am working with CC2650 LaunchXL, working on Multi_Role project and the clock gets stuck after the first time it calls the callback function.

I've constructed a clock and added a callback function named toggleRedLed, which is supposed to toggle the red LED every period.

the clock duration is 1 second, and is currently a single shot, having the period time 0.

The clock is being started by the user, when pressing the right key inside the UART menu (I've added another menu to the Multi Role original UART menu).

The call to toggleRedLed is made a second after the user starts the clock, as supposed to be, and the led is turned on inside the callback function, but then when the callback function finishes the whole program gets stuck, as if it doesn't know how to get back.

During this 1 second the clock runs, the program works fine and I'm able to switch between the UART user menus using the launchXL keys, but when the clock duration is over it is stuck.

The code:

What is wrong?

Should I add anything at the end of the callback function?

I've tried semaphore_post and enqueueMsg but neither worked.

Thanks

Amit

  • Hello Amit,

    Clock callbacks occur in a SWI context which likewise do not permit blocking API calls. It looks like your Display print fxn may be the reason for the hang.

    Best wishes
  • Hey,

    The display is not the problem - it worked on a different computer with CCSv7 and compiler 5.2.8.
    So I've Downloaded CCSv7 instead of CCSv6 and changed the compiler version to 5.2.8 instead of 16.9.1 (which I was told to use due to a different problem, which hasn't been solved as well).
    Still, it doesn't work for me and gets stuck.

    That is extremely strange! Any other ideas?

    Thanks,
    Amit
  • Hi,

    How do you know it's getting stuck vs. nothing being scheduled? Do you restart the clock after the clock callback handler completes? We do recommend that you post an event to your task and do the processing in your task vs. directly in the clock handler as shown in the SBP periodic event from simple_peripheral.

    Best wishes