PlatformIO Community

How to disable libc stdio on Atmel Sam, use EA prinf


#1

I’m trying to use this printf implementation: https://github.com/mpaland/printf, but I cant get the linker to prefer that version. It’s compiling fine, but calls to printf go to the libc printf that appears to be bundled with arm-none-eabi toolchain. I ran pio run --verbose, then ran the linker command with --verbose tacked on:
https://gist.github.com/Timvrakas/c3aa1dd47c0b5343b3bc71cd3d0f299b
there is a notable -lc flag that I think is the culprit. Is there a way to disable this?
Thanks
Tim


#2

Yeah sorry, this was a dumb question. You need to keep libc around, and the library has aliased functions. namely: printf_() which works like a charm.
Sorry for the clutter!
Tim