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.

CC2652R: Code is hanging because of Display_printf

Part Number: CC2652R


Hi 

If we are call the function "Display_printf" continuously then code is getting hang. The implmentation is below,

Initialization ---------------------------------------

#define Display_Type_UART    0x40000000 /*!< All UART virtual displays    */


int customprint_LogInit()
{

     Display_Params params;
     Display_init();
     params.lineClearMode = DISPLAY_CLEAR_NONE;
     dispHandle = Display_open(Display_Type_UART, &params);

return 0;
}

Print function---------------------------------------------------------------

static int row;

#define custom_printf(level, fmt, args...) \
Display_printf(dispHandle, row, 0, "%s:%d %s "fmt, __func__,__LINE__, level, ##args); \
row++;

1) why it is getting hang ?

2) If we continuously printing It is getting hanged also It is not recovering so, reset is required during is hanging.

3) Also we are not able to scroll the terminal. Once the current page is completed in minicom terminal then It is overwriting on the old prints itself 

Can you please provide some solution for the above quries.

  • Hello Mohan Prasanna R,

    To further understand your issue could you provide your SDK (version), CCS (version), and what example you used as a baseline for the code. I took a look at the "display_LP_CC2652R7" example, and similar to your point 2 we don't get to see the "history" of the print, but rather the most up to date output. Try the adcbufcontinuous example, this one also includes the display driver, and keeps the scroll history (when you fullscreen PuTTy). as a question did you try to check if the display is opened at all; try debugging these with steps to see if display is actually opened and figure out specifically what line the program hangs. 

    Thanks,
    Alex F

  • Hi 

    SDK using : simplelink_cc13xx_cc26xx_sdk_7_10_01_24

    Code Using : simple_peripheral_CC26X2R1_LAUNCHXL_tirtos7_ticlang

    CCS Version : 12.1.0.00007 

    If I used the same procedure which used in "adcbufcontinuous" example was not working in " simple_peripheral_CC26X2R1_LAUNCHXL_tirtos7_ticlang" code. 

    Initilaization for both code is same like below,

    Display_Handle displayHandle;

    Display_init();
    Display_Params_init(&displayParams);
    displayParams.lineClearMode = DISPLAY_CLEAR_BOTH;
    displayHandle = Display_open(Display_Type_UART, &displayParams);

    In "adcbufcontinuous" code also they are using the format like below,

    Display_printf(displayHandle, 0, 0, "Error creating displayHandle\n");   

    Here row and column is passed as zero but, It is automatically printing the new prints in the next next lines. but In  " simple_peripheral_CC26X2R1_LAUNCHXL_tirtos7_ticlang"  code If i used the same way, It is overwriting on the same line. 

    Can you provide some solution for this.

  • Hello Mohan Prasanna R,

    On your question of printing the new prints on the same line, could you try to add \r\n (return, newline, to the end of "error creating displayHandle\r\n")?  Using the return, newline we should see the prints on a new line this time, could you see if that fixes your issues in simple_peripheral? So for my understanding, is "Display_printf(displayHandle, 0, 0, "Error creating displayHandle\n");   " called more than once in your implementation in simple_peripheral? 

    Thanks,
    Alex F