EmbeddedRelated.com
Forums

LPCUSB-Based USB Serial Bootloader

Started by thirdshoedrops October 18, 2008
I added a patch to the LPCUSB serial code so that flow control works,
and wrote another example that functions as a USB serial bootloader.
Patch and a flashable image are available at:

http://tech.groups.yahoo.com/group/lpc2000/files/USBoot/

If you load the image into an LPC2148, then when it reboots, it
attempts to connect to a host as a USB serial port. If it receives
data over that connection within about 10 seconds, it enters an
interactive bootloader. You can send Intel HEX records which will be
written to Flash, and you can use the "dump " command to print
out memory contents. If your hex file has a zero at address 0x3014
then a checksum is calculated and inserted before Flashing.

You don't have to connect with a terminal emulator like minicom or
hyperterminal. I just do "cat testprog.hex > /dev/ttyACM0" to load a
program and execute it.

If there's no data from the host within about 10 seconds and there is
a valid ISR vector block at 0x3000, the bootloader shuts down USB and
transfers control to the ISR vector block. ("Valid" means that
there's a correct checksum in the 6th word.) This control transfer is
mostly like a regular LPC2148 boot, but the 64 bytes at 0x3000 are
copied to RAM at 0x40000000 and the MEMMAP register is set to map the
RAM vector table to address 0.

Have fun!

An Engineer's Guide to the LPC2100 Series

Very slick!
--jc

On Sat, Oct 18, 2008 at 7:07 PM, thirdshoedrops wrote:

> I added a patch to the LPCUSB serial code so that flow control works,
> and wrote another example that functions as a USB serial bootloader.
> Patch and a flashable image are available at:
>
> http://tech.groups.yahoo.com/group/lpc2000/files/USBoot/
>
> If you load the image into an LPC2148, then when it reboots, it
> attempts to connect to a host as a USB serial port. If it receives
> data over that connection within about 10 seconds, it enters an
> interactive bootloader. You can send Intel HEX records which will be
> written to Flash, and you can use the "dump " command to print
> out memory contents. If your hex file has a zero at address 0x3014
> then a checksum is calculated and inserted before Flashing.
>
> You don't have to connect with a terminal emulator like minicom or
> hyperterminal. I just do "cat testprog.hex > /dev/ttyACM0" to load a
> program and execute it.
>
> If there's no data from the host within about 10 seconds and there is
> a valid ISR vector block at 0x3000, the bootloader shuts down USB and
> transfers control to the ISR vector block. ("Valid" means that
> there's a correct checksum in the 6th word.) This control transfer is
> mostly like a regular LPC2148 boot, but the 64 bytes at 0x3000 are
> copied to RAM at 0x40000000 and the MEMMAP register is set to map the
> RAM vector table to address 0.
>
> Have fun!
>
>
>

--- In l..., "thirdshoedrops" wrote:
>
> I added a patch to the LPCUSB serial code

Sorry, there was a bug in the patch & code: it initialized the IRQ
vector table with the wrong data. It would still work if your program
set up its own RAM vector table, but not (reliably) if you just used
the compiled/linked-in table at the beginning of your code.

I've replaced the files with fixed versions. Hope you like 'em.
Anybody have Crossworks and IAR J-Link working together.....for LPCs &/or STM32s?

Cheers
R





Yes, Crossworks (both 1.7 and 2.0) support the IAR J-link without any additional licensing from Segger.

Your crossworks project though must have a loader file specified for the J-Link though or else you won't be able to properly program/debug your boards.

I'm working with the LPC23XX and LPC17XX parts.

Regards,
Joe M

--- In l..., Rangarajan Varadan wrote:
>
> Anybody have Crossworks and IAR J-Link working together.....for LPCs &/or STM32s?
>
> Cheers
> R
>
>
>
>
>
>
>

>
> Anybody have Crossworks and IAR J-Link working together..... for LPCs
> &/or STM32s?

Yes. As you don't say anything about what you have tried or what your
problem is there is really nothing more I can say.
Regards,
Richard.

+ http://www.FreeRTOS.org
Designed for Microcontrollers. More than 7000 downloads per month.

+ http://www.SafeRTOS.com
Certified by T as meeting the requirements for safety related systems.