On the mod5270, standard out and standard error are redirected to serial port 0, the debug port. As a result iprintf sends its output to the debug port which is very convenient.
My question is: is there a problem with interleaving calls to iprintf with calls like
write(fddebug, (char *) PTR(a), u);
where fddebug is the handle of debug port?
Does this mess anything up?
Interleaving methods for debug port output
-
- Posts: 19
- Joined: Sat Apr 26, 2008 6:19 am
Re: Interleaving methods for debug port output
This should not be a problem but make sure you replace the stdio fd once you open the debug serial port:
int fd0=SimpleOpenSerial(0,115200 );
ReplaceStdio( 0, fd0 );
ReplaceStdio( 1, fd0 );
ReplaceStdio( 2, fd0 );
If you forget to do this then the stdio calls will talk with a polling serial driver while the write calls talk to the interrupt serial driver and things will go bad fast.
int fd0=SimpleOpenSerial(0,115200 );
ReplaceStdio( 0, fd0 );
ReplaceStdio( 1, fd0 );
ReplaceStdio( 2, fd0 );
If you forget to do this then the stdio calls will talk with a polling serial driver while the write calls talk to the interrupt serial driver and things will go bad fast.