FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [August 2014 Threads] printf using printf-stdarg.cPosted by roujesky on August 1, 2014 I had this working on an old mplab8 project running FreeRTOS. But I have a brand new project running the latest version of FreeRTOS on a PIC32MX795. Now, tho, when i call printf, it goes straight to this function in printf-stdarg.c
/* To keep linker happy. /
int write( int i, char c, int n)
{
return 0;
}
what am I doing wrong? Like I said, this worked for me years ago. I should see it stepping thru all the functions in printf-stdarg.c....
thanks!
printf using printf-stdarg.cPosted by rtel on August 2, 2014 printf-stdarg.c contains an extremely light weight version of some of the stdio functions. It is a useful way of keeping the code size of GCC built programs (XC32 is GCC by another name) down as bringing in a lot of GCC libraries can really bloat code and massively increase your stack usage. In printf-stdarg.c you can direct the output of printf() wherever you like (UART, console, USB CDC etc.) or just provide a dummy write() function if you are not actually going to use printf() at all.
If the libraries that come with your compiler (presumably XC32) come with an implementation of write() that does what you want then you can simply remove printf-stdarg.c from the project all together - if you do that I would strongly suggest you have stack overflow checking turned on in FreeRTOSConfig.h.
Regards.
printf using printf-stdarg.cPosted by bowerymarc on August 2, 2014 You need to implement the actual output function yourself, or use sprintf and deal with the resultant char array.
So overload write(). Your old project probably did that somewhere.
printf using printf-stdarg.cPosted by roujesky on August 3, 2014 thanks! I will implement the necessary code in write().
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|