Yahoo Groups archive

Lpc2000

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

Message

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

2004-07-03 by Stephen Pelc

> 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.
Our Xmodem system works fine on a 2129 - the hardware/software 
combination should be available in a few weeks from MPE and New 
Micros. The software will be an extension of that for the 
TiniARM.

> 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.
Why is this tricky? Buffer four 128 byte blocks to get a 512 
byte block. The only times you fail totally is if you do not 
implement retries on a block error or the link fails 
permanently. The ISP loader is then your saviour. If you can 
afford to buffer all 8kb, then you have an extra level of 
safety. The code we load into RAM to do this is about 3kb, uses 
a few hundred bytes of RAM for stacks and so on, so even the 
smallest LPC has 12k of RAM for buffering.

If you have a lot of RAM data you need to preserve, why not put 
in spare Flash, perform the load, and restore the RAM?

As a caution, I suspect but have no proof that most Flash write 
failures are down to poor power supplies.

Stephen
--
Stephen Pelc, stephen@...
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.