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: Multi Role problem with clock callback and display_print

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

Tool/software: Code Composer Studio

Hello

I am using the Multi Role project as a starting point for the CC2650 LaunchXL.

I've defined a clock and made it call the function toggleRedLed every 5 seconds.

The function simply toggles the red LED, but it also prints stuff to the UART using Display_print, as can be seen:

If I use one Display_print in the function, it works good. But if I call Display_print twice or more, it only prints the first line and then gets stuck.

I need to print more than just one line (for some functions other than toggleRedLed).

I thought maybe I should define an event ID and use multi_role_enqueueMsg(EVT, pData), and print what I need from some other function that will be called from multi_role_processAppMsg(mrEvt_t *pMsg), but that doesn't work either.

Any idea whats the problem?

Thanks

Amit

  • Hi Amit,

    In general, we highly discourage people from using UART in Software Interrupts (SWI) - This can cause a number of issues, including application crashes. Also - in a similar vein, we recommend keeping the routines as short as possible, again, UART transmissions aren't the fastest things.

    I recommend you use a messaging system to inform the application task to print to UART instead. For example, use events, or semaphores, to wake the application, and a Queue to store what you want UART to print.

    Hope this helps,

    Regards
    Rebel
  • Hey Rebel

    Right now I am using an event that is queued, and multi_role_processAppMsg calls another process function, which calls some other function who does all the display prints to UART.
    Even then, when I put more than one display print, the program crashes.

    Thanks
    Amit
  • Hi Amit,

    Can you post your changes?

    Regards,

    Rebel

  • Hello Rebel

    Here are the changes:

    toggleRedLed() is as above.

    One more question:

    I've built a service called Msg_service, that contains 3 integers, and is accessed using BLE. This way I can send messages between different multi roles and phones.

    For now it simply supposes to toggle the LED every time there's a value change, and I'd also want it to print the data (that is why I need the display prints)

    Would you recommend any other way to do it?

    Thanks

    Amit

  • Hi Amit,

    This seems okay! If anything, I'd probably use the get parameter function of your GATT service and print it out via UART in the processMsgValueChangeEvt.

    When you implement your UART code, how do you do it?

    As far as I can tell processMsgValueChangeEvt is performed in the application context - which is exactly where you want it. (Because it's processed in the taskFxn loop of the multirole application task)

    Regards,

    Rebel

  • Hey Rebel,

    I've done that:

    If I use more than one display print, it collapses.

    What do you mean how do I implement UART code?

    And what is the easiest way to send these values from one multi role to another?

    Thanks

    Amit