[En-Nut-Discussion] SAM7S128 UART0 / UART1 problem
Harald Kipp
harald.kipp at egnite.de
Sat Jul 3 13:53:12 CEST 2010
On 03.07.2010 13:12, SZABO Tamas wrote:
> Actually, of course I changed DEV_DEBUG_NAME to DEV_UART0 as well, just forgot to mention.
Your code sample uses
freopen(DEV_DEBUG_NAME, "w", stdout);
:-)
> Anyway I made my own "board". I connected only a few pins (powers, crystal, PLL passives, an IO port for a LED, and the 3 serial ports).
You may at least check the results of NutRegisterDevice and freopen.
> So, should my example work with serial0 if I only change to DEV_UART0 and DEV_UART0_NAME and nothing else?
Yes, in general it should. I'm not fully sure about SAM7S support.
Neither I wasn't involved in this port nor did I ever run Nut/OS on this
CPU. May be someone else is able to give a status. I looked into Nut/OS
4.9.9 and this version should work.
If all fails, you may copy usartat91.c, usart0at91.c and usart1at91.c
from arch/arm/dev/ to you application directory and add the latter two
to you Makefile. Then use DEV_DEBUG for stdout and
FILE * fp = fopen(DEV_UART0_NAME, "r+");
fprintf(fp, "Yes we can\n");
to test your other serial port. You may then add printf calls to the
UART code to check what it is doing.
Regards,
Harald
More information about the En-Nut-Discussion
mailing list