Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: loading hex-es....(Tricky Situation)

2004-07-01 by Leighton Rowe

sorry for the delay...thanks Steve,

After some trials, I'm totally convinced the lpc2129 won't overun 
the UART buffer (with or without using the Xmodem u mentioned)...as 
long as I code it correctly. Currently I plan to use the HEX data by 
loading an empty block of flash with the data & attempt to execute 
it like normal code.

Now here's a tricky situation:
You're uploading code from the Host(PC) thru UART to flash-program 
the target system(LPC)
- The code (data) could be any size within 8k.
- IAP flash bootloader is configured to program only 512 bytes at a 
time (smallest available chunk)
- Given the PC/Target communication protocol, command & data packets 
can be transmitted. But data packets are limited to only 150 bytes 
(maximum) per packet...had it been >=512 bytes I probably wouldn't 
write this question. 

I know the IAP & UART routines to use but this is new stuff that I 
haven't tried before. Any Advice? Thanks.

Leighton


 

--- In lpc2000@yahoogroups.com, "Stephen Pelc" <stephen@m...> wrote:
> > I'm looking for routines that enables my lpc2129 to safely read a
> > .hex data file through the serial port into temporary RAM. Any
> > ideas or code examples?
>  
> > Although the LPCs operate at high frequencies, I'm a bit
> > concerened about just sending hex data just like an ordinary
> > ASCII string because of possible problems which can cause data
> > loss...for example, reading 1 ASCII value into memory too slowly
> > between uart (RDA) interrupts.
> 
> What are you going to do with the HEX data? If you are going to 
> turn it back into binary, just reduce to binary before sending. 
> If you send it with (say) 128-byte Xmodem, overrun can be 
> prevented by using a 131 byte serial buffer and enabling the 
> FIFOs to reduce interrupt overhead. We run our USB Stamps this 
> way and have no problems - I *never* see the retry counter go 
> up. We process the incoming data before sending the block 
> acknowledgement, so flow control is automatic. This is done on 
> an LPC2106 at 60MHz with MAM fully enabled. The 2129 should be 
> the same.
> 
> Stephen
> 
> --
> Stephen Pelc, stephen@m...
> MicroProcessor Engineering Ltd - More Real, Less Time
> 133 Hill Lane, Southampton SO15 5AF, England
> tel: +44 23 80 631441, fax: +44 23 80 339691
> web: http://www.mpeltd.demon.co.uk - free VFX Forth downloads

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.