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.

CC2652R7: Code got hanging when executing formatted string before display printf

Part Number: CC2652R7

Hi 

SDK Used : simplelink_cc13xx_cc26xx_sdk_7_10_01_24

Code Used : simple_peripheral_LP_CC2652R7_tirtos7_ticlang

EVK Using : CC2652-R7 Development kit

While using the below code, before send a string to the display printf. Execution is getting hanged

va_list ap;
char str_buffer[71] = {0};

va_start(ap, fmt);
vsnprintf(str_buffer, 70, fmt, ap);
va_end(ap);

The above highlighted portion getting hanged. Without this portion It is not hanged but It will send as non formatted string eg : "Hello World %d" . Can you please tell any solution for this

Display_printf(dispHandle, 0, 0, "%s ", str_buffer);

  • Part Number: CC2652R7

    Hi 

    SDK Used : simplelink_cc13xx_cc26xx_sdk_7_10_01_24

    Code Used : simple_peripheral_LP_CC2652R7_tirtos7_ticlang

    EVK Using : CC2652-R7 Development kit

    While using the below code, before send a string to the display printf. Execution is getting hanged

    va_list ap;
    char str_buffer[71] = {0};

    va_start(ap, fmt);
    vsnprintf(str_buffer, 70, fmt, ap);
    va_end(ap);

    The above highlighted portion getting hanged. Without this portion It is not hanged but It will send as non formatted string eg : "Hello World %d" . Can you please tell any solution for this

    Display_printf(dispHandle, 0, 0, "%s ", str_buffer);

  • Hi,

    I am unfamiliar with the vsnprintf() function. Can you share the function description for that?

    Best Regards,

    Jan

  • Hi,

    I have joined the two threads as they seem to be referring to the same behavior. In the future, please avoid from posting duplicate threads if possible as this can delay support and issue resolution.

    Best Regards,

    Jan

  • Hi Jan,

    Here is the "vsnprintf" function link

    https://linux.die.net/man/3/vsnprintf

    I hope TI also used the "vprintf" in display_printf function in Display.h file

    void Display_doPrintf(Display_Handle handle, uint8_t line, uint8_t column, const char *fmt, ...)
     {
     if (NULL == handle)
     {
     DebugP_log0("Trying to use NULL-handle.");
     return;
     }

     va_list va;
     va_start(va, fmt);

     handle->fxnTablePtr->vprintfFxn(handle, line, column, fmt, va);

     va_end(va);
     }

  • Hi,

    Understood. To clarify, are you attempting to print via UART or simply through a debug JTAG connection? This will help us identify what may be the best path to follow.

    Best Regards,

    Jan

  • Hi jan,

    We are using UART only We are not using "UART2" API Instead of that "Display_printf" is using. without "vsnprintf" It is not getting hang but if we used "vsnprintf" It is getting hanged.

  • Hi,

    Understood. To use the UART for message transmission, then I would highly recommend using the UART2 driver or the Display_printf driver. BLE projects use the display_printf driver by default, but can use the uart2 driver as well. I would recommend referencing the UART2 examples we have included in the SDK. If you would like to send messages via JTAG for logging purposes, the log driver may be helpful as well.

    Best Regards,

    Jan