[En-Nut-Discussion] How to read from DEV_DEBUG (uart) on AT91SAM7x?

Morten Kvistgaard MK at pch-engineering.dk
Tue Feb 22 08:56:53 CET 2011


I've completely forgotten to thank you for the fix.

The code below works like a charm.

It seems to be using a bit more of the processor than the real uart. (Fair enough.)

Regards,
Morten Kvistgaard

-----Original Message-----
From: en-nut-discussion-bounces at egnite.de [mailto:en-nut-discussion-bounces at egnite.de] On Behalf Of Ulrich Prinz
Sent: 4. februar 2011 00:03
To: ticso at cicely.de; Ethernut User Chat (English)
Subject: Re: [En-Nut-Discussion] How to read from DEV_DEBUG (uart) on AT91SAM7x?



Am 31.01.2011 20:10, schrieb Bernd Walter:
>
> In short: DEV_DEBUG is write only.
> DEV_DEBUG is just a simplified polling device driver for debug outputs.
> It won't add much code.
>
> If you want to read from the DBGU device you need another driver, 
> which you can use it via DEV_UARTD/DEV_UARTD_NAME.
>
That was true in the past.

In actual trunk AT91SAMxxx handles DBGU as a real USART ( in fact it is one with some missing features) and you can use it with read an write like any other usart too.

For me it worked like this:

     NutRegisterDevice(&DEV_UARTD, 0, 0);
     freopen(DEV_UARTD_NAME, "w+", stdout);
     stdin = stderr = stdout;

but it should work in separate fopen / freopen calls for stdin and stdout too.

Best regards
Ulrich
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion



More information about the En-Nut-Discussion mailing list