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.

CC2640R2F: Get Exception On sprintf why ?

Part Number: CC2640R2F

Hi , i use cc2640r2f lounchpad and code get exception and after while fill stack size . code dont run any more . 

UART_write(uart,"-->POWER AVG:",13);
n = sprintf((char*)cc_uart_send_buffer,"%.2d\r\n",AvgPower);
UART_write(uart,(char*)cc_uart_send_buffer, n);

  • Hello Vahid Javadi,

    I hope you are well. I just tested line n = sprintf((char*)cc_uart_send_buffer,"%.2d\r\n",AvgPower); on another board, and can see that the program stops. I then tried an alternative of "n = sprintf(test, "%.2d\r\n", 345);" and the program did not stop, could you try to adapt that and see if the program still stops or not? 

    For some more help could you provide what SDK you are using, and what example you are using?

    Thanks,
    Alex F

  • Hello Alex i use your method but nothing change and my SDK  5-30-00-03 and simple_peripheral project . increase the stack will solve the problem for the while but exact solution is writing own sprintf function.