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

Bernd Walter enut at cicely.de
Mon Jan 31 20:10:03 CET 2011


On Mon, Jan 31, 2011 at 05:20:23PM +0100, Morten Kvistgaard wrote:
> Hello there,
> 
> I'm all new to Nut/OS and so far I'm rather impressed.
> 
> I would like to read from my debug uart however. (dbgu) I can't seem to make it work. 
> 
> If I use:
> NutRegisterDevice(&DEV_DEBUG, 0, 0);
> freopen(DEV_DEBUG_NAME, "w", stdout);
> freopen(DEV_DEBUG_NAME, "r", stdin);
> I can write, but not read. (It will crash on read.) Fair enough.

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.

> The following works fine:
> NutRegisterDevice(&DEV_UART0, 0, 0);
> ...
> But that's not the uart I want ;) 
> 
> The DEV_UART1 doesn't seem to do anything.
> 
> 
> Is there an easy way to enable 'read access' on the DEV_DEBUG uart?
> 
> 
> PS. I'm using a Netduino Plus board with a AT91SAM7x512. I'm using both the stable Nut/OS 4.8.8 and the beta 4.9. (Whatever that works.) I'm using the YAGARTO4.4 compiler.
> 
> Regards,
> Morten Kvistgaard
> 
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion

-- 
B.Walter <bernd at bwct.de> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.



More information about the En-Nut-Discussion mailing list