On Mon, Nov 14, 2011 at 12:15 PM, Sergio Campamá <sergiocamp...@gmail.com> wrote: > Hello, > > I'm developing an app that uses heavily printf for debugging... Now, when > activated (through a DEBUG macro), the app crashes very rapidly, being > random the moment it crashes (almost always it crashes mid sentence)... > > I just found this page: > http://processors.wiki.ti.com/index.php/Tips_for_using_printf > > How much of it correlates to the way mspgcc handles printf? Is it the same? > Can I use the same techniques for using static memory for printf? > > Basically, i want to use this (I'm trying to extract the most important > info of the page) > > char static_array[20]; > setvbuf(stdout, static_array, _IOLBF, sizeof(static_array)); > > > Does this work on mspgcc?
As Chris responded, virtually none of that page is relevant to mspgcc. What you can do with printf depends on how your putchar() is implemented. mspgcc doesn't deliver one since it's board-specific. Check with whoever provided the Z1 putchar() implementation to find out whether you are allowed to invoke printf from interrupt handlers or with interrupts disabled, and other limitations. It's fairly likely that you can't print anything from an interrupt handler. (At one point Zolertia delivered an mspgcc toolchain based on the CPUX branch. If you're using that instead of the current LTS mspgcc, you definitely need to ask them for support. Based on old bug reports, I suspect that version would not handle varargs correctly, especially if you're using its far memory support.) Peter > > Best regards, > > -- > -------------------------------------- > Sergio Campamá > sergiocamp...@gmail.com > > ------------------------------------------------------------------------------ > RSA(R) Conference 2012 > Save $700 by Nov 18 > Register now > http://p.sf.net/sfu/rsa-sfdev2dev1 > _______________________________________________ > Mspgcc-users mailing list > Mspgcc-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/mspgcc-users > > ------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ Mspgcc-users mailing list Mspgcc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mspgcc-users