FreeRTOS using vsnprintf
Posted: Sat Jan 17, 2015 10:48 am
LS,
Working on a ESP8266/Arduino combination.
I will be redirecting the "normal" printf output to NULL or telnet for debug output.
That then leaves the uart0 clean for communication to the arduino.
I saw a nice implementation of printf functionality in the frankenstein implementation.
This is my slightly adapted version.
This compiles OK but at linking I get the error
user/firmware/eagle/debug/lib/libuser.a(app_utils.o):(.text+0x0): undefined reference to `vsnprintf'
Tried to add -lc (libc ?) to the link command in makefile but that gives a lot of other errors.
Is there an easy way to include the vsnprintf into a RTOS SDK project ?
Regards,
Herman
Working on a ESP8266/Arduino combination.
I will be redirecting the "normal" printf output to NULL or telnet for debug output.
That then leaves the uart0 clean for communication to the arduino.
I saw a nice implementation of printf functionality in the frankenstein implementation.
This is my slightly adapted version.
Code: Select all
int uart0_printf(const char *fmt, ...)
{
int ret;
va_list ap;
char p[256];
va_start(ap, fmt);
ret = vsnprintf(p,256,fmt,ap);
va_end(ap);
for (int i = 0;i<ret;i++){
uart0_write_char(p[i]);
}
return ret;
}
This compiles OK but at linking I get the error
user/firmware/eagle/debug/lib/libuser.a(app_utils.o):(.text+0x0): undefined reference to `vsnprintf'
Tried to add -lc (libc ?) to the link command in makefile but that gives a lot of other errors.
Is there an easy way to include the vsnprintf into a RTOS SDK project ?
Regards,
Herman