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.

RTOS/CC2640: sprintf issue using float format

Part Number: CC2640

Tool/software: TI-RTOS

I am using the TI-SDK  ble_sdk_2_02_01_18 release on CC2640.

When I tried to convert a float into string for print out, the system will crash.

I created the test code as below, function will never return.

However, if I use "%6d" instead, function will return just fine.

I had already checked suggestion which 

  • #include <stdio.h> is there
  • increase the stack size from 700 to 1000

void test1(float value)
{
char buf[50];

sprintf(buf, "%.4f", value);
// sprintf(buf, "%f", value);
// sprintf(buf, "%6d", (int)value);

System_printf(buf);
System_printf("\n");System_flush();
}

Thanks for advice and suggestions