I’m using vsnprintf() to try to create a version of printf() that will work with preemtive multi tasking - preventing output text being mixed up.
I am using the serial.c library distributed with the source, modified to support two serial ports and called with a new function that replaces printf() using vsnprintf() to format the text before being sent to vSerialPutString(). A semaphore prevents the output texts from numerours tasks being mixed up.
The trouble is my code crashes with a memory access exception within the call to vsnprintf().
I’ve even tried it with const text and sprintf() and it does the same.
Why would these functions not work when the RTOS is running, yet I can use them before the scheduler starts without a problem?
If I replace them with puts() instead I get the format text as expected (obviously via a different software route)
Any suggestions of other tests I can do to isolate the problem which appears to be an interaction between FreeRTOS and libc or libgcc.