printf's not displaying in Terminal Window?

So we have a situation where our printf statements suddenly do not appear in the IFI Loader terminal window even though they compile within the MPLAB code. Does anyone have any “oh duh” solutions?

We do have #include <stdio.h> in both user_routines.c and user_routines_fast.c.

I’m using Kevin Watson’s “serial_ports.c” code.

Thanks,

Our team has been having this trouble too… At least on a branch from our main code. Although in one case we were in disabled mode where there were no printouts. Check if you get the IFI> message when you go into program state. That should tell you whether it’s the code’s fault.

Well I figured out my problem. Sorry to waste the bandwidth!

In deleting Kevin’s camera code from the project, I removed a #define which enabled the programming port for serial data comms (including printf). Adding the define back in fixed the problem.

Yeah, I spent an hour chasing down that one, too. A macro like this has three states:

#ifdef ENABLE_SERIAL_PORT_ONE_TX

The states are “true,” “false,” and “the programmer forgot to define it”. By using the #ifdef approach, the last two states are equivalent, so the compiler can’t help you.

That’s why I prefer using

#if ENABLE_SERIAL_PORT_ONE_TX

where the macro value is ‘1’ for enabled and ‘0’ for disabled. If the programmer doesn’t #define it to one of those values, the compiler will complain, and an hour is saved!