Yahoo Groups archive

Lpc2000

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

Thread

My own boot loader! (Or others with some help ;-)

My own boot loader! (Or others with some help ;-)

2005-12-15 by boje_d

Hello!

For my projekt i am using a lpc2292.

My problem is the following:
Since my application is without the possibllity to use the build in
bootloader, i want to write my own boot loader which can be
controlled via software!
I imagine that i can reseve a areaa of the flash for the bootloader
so it will always be present even if programming is failing.
My questions are:
how do i place the bootloader on a specific adress area in the flash
memory??

how do i reserve this area so my next application will not use this
area of the flash memory?

I expect the bootloader to use the internal programming routines to
program the flash, but the new data to be programmed will be placed
on a SD card or something like it, must the boot loader run from
flash or internal RAM?

if you have a link for some pages descibing simmilar
problems/projects or som codepieces i will be recieved with
appreciation.

Thans a lot
Best regards
Boje Demant

Re: My own boot loader! (Or others with some help ;-)

2005-12-15 by kibobo59

You cannot prevent the block code (last sector) to be executed since
at reset first vector pointes to that code (memory mapped).

But! ... you can write your own bootloader in the last sector of the
flash. It's not documented, however the code needed is in the
bootloader update archive from philips (Hex Intel format).

Be carreful, if your update fails ISP (via serial line) isn't possible
anymore.

I'm working on a debugger able to write in the ENTIRE flash through
JTAG connection.
Show quoted textHide quoted text
> Hello!
> 
> For my projekt i am using a lpc2292.
> 
> My problem is the following:
> Since my application is without the possibllity to use the build in
> bootloader, i want to write my own boot loader which can be
> controlled via software!
> I imagine that i can reseve a areaa of the flash for the bootloader
> so it will always be present even if programming is failing.
> My questions are:
> how do i place the bootloader on a specific adress area in the flash
> memory??
> 
> how do i reserve this area so my next application will not use this
> area of the flash memory?
> 
> I expect the bootloader to use the internal programming routines to
> program the flash, but the new data to be programmed will be placed
> on a SD card or something like it, must the boot loader run from
> flash or internal RAM?
> 
> if you have a link for some pages descibing simmilar
> problems/projects or som codepieces i will be recieved with
> appreciation.
> 
> Thans a lot
> Best regards
> Boje Demant

Re: My own boot loader! (Or others with some help ;-)

2005-12-15 by jayasooriah

Which part are you working on?  I have derived the code for write and
erase of any flash sector (including boot sector) by disassembling boot
loader version 1.48 for LPC2105.

Only after this, did I discover from errata sheet that that the flash
programming on boot loader versions up to 1.52 are actually not
correct and can cause the parts to fail during IAP calls.

When I get the time, I shall be updating the my boot loader and then
looking at what is different in relation to algorithm and/or timing. 

--- In lpc2000@yahoogroups.com, "kibobo59" <c45p3r@f...> wrote:
> I'm working on a debugger able to write in the ENTIRE flash through
> JTAG connection.

Re: My own boot loader! (Or others with some help ;-)

2005-12-15 by kibobo59

I have disassembled this file:
bootloader_update_ver_1_52_LPC_2104_2105_2106.hex

within lpc2000_bl_update.zip.

And I want to load in RAM (through JTAG) the code able to write in the
last sector.

PS: debugger is work in progress, further informations soon.
Show quoted textHide quoted text
> Which part are you working on?  I have derived the code for write and
> erase of any flash sector (including boot sector) by disassembling boot
> loader version 1.48 for LPC2105.
> 
> Only after this, did I discover from errata sheet that that the flash
> programming on boot loader versions up to 1.52 are actually not
> correct and can cause the parts to fail during IAP calls.
> 
> When I get the time, I shall be updating the my boot loader and then
> looking at what is different in relation to algorithm and/or timing. 
> 
> --- In lpc2000@yahoogroups.com, "kibobo59" <c45p3r@f...> wrote:
> > I'm working on a debugger able to write in the ENTIRE flash through
> > JTAG connection.
>

Re: My own boot loader! (Or others with some help ;-)

2005-12-15 by jayasooriah

Warning regarding your JTAG method:

According to Philips, JTAG may not work if boot sector is corrupted. 
I looked at the the boot sector code, and the only thing that it does
on reset that is out of the ordinary is the following:

	// setup part ident
	FMDEV[0] = 0xfff0ff22;

	// lock flash sectors
	FMDEV[9] = 0xffffffff;

I suspect if you dont setup part ident, then JTAG will not work, or
will not return the correct word for IDENT command and your JTAG
tools may refuse to talk to the part without a proper IDENT.

Good luck!

--- In lpc2000@yahoogroups.com, "kibobo59" <c45p3r@f...> wrote:
Show quoted textHide quoted text
> I have disassembled this file:
> bootloader_update_ver_1_52_LPC_2104_2105_2106.hex
> 
> within lpc2000_bl_update.zip.
> 
> And I want to load in RAM (through JTAG) the code able to write in the
> last sector.

Re: My own boot loader! (Or others with some help ;-)

2005-12-15 by kibobo59

Thanks for these informations.
I make my own JTAG tool, so JTAG IDENT can be discard.
Show quoted textHide quoted text
> Warning regarding your JTAG method:
> 
> According to Philips, JTAG may not work if boot sector is corrupted. 
> I looked at the the boot sector code, and the only thing that it does
> on reset that is out of the ordinary is the following:
> 
> 	// setup part ident
> 	FMDEV[0] = 0xfff0ff22;
> 
> 	// lock flash sectors
> 	FMDEV[9] = 0xffffffff;
> 
> I suspect if you dont setup part ident, then JTAG will not work, or
> will not return the correct word for IDENT command and your JTAG
> tools may refuse to talk to the part without a proper IDENT.
> 
> Good luck!
> 
> --- In lpc2000@yahoogroups.com, "kibobo59" <c45p3r@f...> wrote:
> > I have disassembled this file:
> > bootloader_update_ver_1_52_LPC_2104_2105_2106.hex
> > 
> > within lpc2000_bl_update.zip.
> > 
> > And I want to load in RAM (through JTAG) the code able to write in the
> > last sector.
>

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.