[En-Nut-Discussion] SAM7S128 UART0 / UART1 problem

Bernd Walter enut at cicely.de
Thu Jul 8 17:18:13 CEST 2010


On Thu, Jul 08, 2010 at 11:37:18AM +0200, SZABO Tamas wrote:
> > I put some LED blinking code to the very beginning of the application. 
> > With DEV_DEBUG / DEV_DEBUG_NAME it is OK, LED blinks a few times after 
> > reset.
> 
> > However, in case of DEV_UART (or DEV_UART0, DEV_UART1) and DEV_UART_NAME 
> > (or DEV_UART0_NAME, DEV_UART1_NAME) - there is no activity et al.
> 
> So finally I found (even that a minor modification should be make on nut source as well) the real cause.
> 
> I used sam7_pgm (http://www.pjrc.com/arm/sam7_pgm/) to program my AT91SAM7S128. But the programmer only flashed the first 16kB, since the method for unlocking flash areas wasn't the right one and unlocked only the first region and the second remained locked. But with an extremely small modification it can be make working, by changing

This is absolutely the same reason why I had troubles with my SAM7S32.
I also used something originating from sam7_pgm.
I'm really tempted to enhance this programm to use helpercode in
the controller to speed up transfers so verifying wouldn't be
a performance point anymore.
I can send you my current version, but it conatins FreeBSD related
changes as well.

> r = write_word(MC_FCR, (region << 8 | 0x5A000004);
> to
> r = write_word(MC_FCR, ((region * 0x40) << 8) | 0x5A000004);
> 
> It was an unfortunate case that with DEV_DEBUG the size was a bit below 16kB and with DEV_UART it was somewhat larger than 16kB.
> 
> By the way, it was necessary to add MCU_AT91SAM7S128 to debug.h, irqreg.h and spimmc_at91.c, and
> 
> extern NUTDEVICE devUsartAt910;
> extern NUTDEVICE devUsartAt911;
> 
> to debug.h
> 
> So now it works as expected:-)

-- 
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