Forum Discussion
Altera_Forum
Honored Contributor
15 years agoSince the smaller system using alt_putchar() instead of printf (which will pull in a LOT of libc stuff) works it does look like a memory space issue.
(If a real async/rs232 line were involved I'd actually suggest a baud rate problem.) For debug, you might find it enough to write a 'putstr' function based on alt_putchar(), and a 'putint' one that converts an integer into a local buffer then sends it. OTOH, you could write a printf that insn't based on stdio snd libc! I've just compiled one I have for nios2 - actually snprintf() - comes out at 1725 bytes + a call to __udivsi3 (for the divide by 10 - which could be coded differently). This version is actually optimised for speed, not size, and supports all the field width stuff but no floating point.