snprintf with floating point numbers
System Details:
RTOS - FreeRTOSV8.1.2
Compiler - "GNU Tools ARM Embedded" toolchain version 4.8 2014q3
IDE - Eclipse Luna Service Release 1 (4.4.1)
Controller - STM32F429i Discovery board.
Problem:
2 of the several tasks running in my application use snprintf to format floating point numbers
into independent buffers. One formats a single float, the other a list of about 14 floats.
If both tasks are allowed to call snprintf I receive corruption in the larger buffer.
A null is embedded. Interestingly, snprintf returns the correct string length processed but
strlen obviously reports a shorter string.
Is snprintf thread safe or can you suggest what may be wrong.
Many thanks.
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
This question was reopened
- by David Regan
Can you help with this problem?
Provide an answer of your own, or ask David Regan for more information if necessary.