This is the mail archive of the ecos-discuss@sourceware.cygnus.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: printf debugging using serial


Dave Airlie wrote:
> 
> Hi,
>         I've a PID board with 2 serial ports, I'm using one for code
> download and debugging, and the other for my application, does using
> printf affect the use of the second serial port heavily? do interrupts get
> turned off when I'm in printf, I've noticed a lot greater byte loss when
> using debugging ..

Not in printf itself, but obviously it will use the underlying serial
driver, which will have interrupts disabled for a while while processing
the interrupt. I wouldn't have thought it would be too bad though because
the two ports have separate interrupt lines.

But the most likely reason is the GDB stub, which runs with interrupts
disabled. So if you minimize use of GDB (i.e. don't let it stop your
program very often), that should minimize the lost interrupts.

> Any suggestions on how to work around apart from binary debugging using
> LEDS :-)

You could sprintf into a static buffer. But if you are going to do that, it
may be even easier to use the tracing functions in
packages/infra/VERSION/include/cyg_trac.h. You can configure that for
buffered tracing.

Jifl
-- 
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]