Yahoo Groups archive

Lpc2000

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

Thread

Start from flash

Start from flash

2004-05-25 by tendoskeleton

Hello,

I have written code that download an AIF into flash, so it doesn't 
have to download eacht time. Just by power up, the code will execute. 

Now this downloading goes great and it even works :), but not in the 
way I want to.

When I manualy put the uC in user boot mode (register MEMMAP = 0x1)
and I manually set the PC to 0x00000000 (reset vector) with a 
debugger and let it run, the program works great (read: it blinks the 
leds like I programmed)

So now comes the problem; it doesn't do this automatically by power 
up. The LPC2104 has to detect valid user code and will check 0x14 for 
this. In my case there is 0x99FFFF68 (the two complements of the 
checksum of the other vectors.

My situation

Interrupt vector table Flash: 

0x00 ea00001c
0x04 ea000015
0x08 ea000015
0x0c ea000015
0x10 ea000015
0x14 99ffff68
0x18 ea000014
0x1c ea000014

I think the reason why it doesn't work is because the uC doesn't 
detect valid user code and so it doesn't goes into user boot mode, 
put the pc to 0 and execute (like what I did manually)

Can you guys confirm that I calculated the right 2 compl. checksum, 
or did I understand something wrong:

ea00001c + ea000015 + ea000015 + ea000015 + ea000015 + 99ffff68 + 
ea000014 + ea000014 = 0 (32 bits). Right????

So any suggestion what I have to do to get it execute my user code 
automatically after powerup?

Thanks alot

Bob

Re: [lpc2000] Start from flash

2004-05-25 by Robert Adsett

At 12:21 PM 5/25/04 +0000, you wrote:
>I have written code that download an AIF into flash, so it doesn't
>have to download eacht time. Just by power up, the code will execute.

What's an AIF?   Any way to just convert that to a hex file and just use 
one of the standard available download programs?

>I think the reason why it doesn't work is because the uC doesn't
>detect valid user code and so it doesn't goes into user boot mode,
>put the pc to 0 and execute (like what I did manually)

You could verify against lpc2isp.

Robert


" 'Freedom' has no meaning of itself.  There are always restrictions,
be they legal, genetic, or physical.  If you don't believe me, try to
chew a radio signal. "

                         Kelvin Throop, III

Re: Start from flash

2004-05-25 by tendoskeleton

> What's an AIF? Any way to just convert that to a hex file and
just use
> one of the standard available download programs?

An AIF file is an ARM IMAGE FORMAT. It's a linker output format.

Its is a special made embedded system that has to be programmed via
the debug JTAG port with a multi ice.


> You could verify against lpc2isp.

Oke, thx, I have verified that I do the same thing.

Someone else an idee why I can run the code if I manually set the PC
to 0x0 (first manually set user boot mode) and why the program is not
running direct after a reset? (See more detail previous mail)

Kind Regards,

Bob

Re: [lpc2000] Re: Start from flash

2004-05-25 by Shannon Holland

On May 25, 2004, at 7:01 AM, tendoskeleton wrote:

> Only one else an idee why I can run the code if I manually set the PC
> to 0x0 (first manually set user boot mode) and why the program is not
> running direct after a reset? (See more detail previous mail)
>

What does your boot code do? How early does it switch to user mode? Are 
all the stacks, etc set up before you do the switch? In the case where 
you manually set user mode and the pc to 0 what might have been already 
initialized by any boot code so far that isn't done by your code when 
you boot from flash?

Shannon

Re: Start from flash

2004-05-25 by embyy27

Is P0.14 at a HIGH level after reset?  If it is LOW, the boot code 
will execute the ISP command handler, even if checksum is valid.  See 
page 177 of User Manual.


--- In lpc2000@yahoogroups.com, "tendoskeleton" <tendoskeleton@y...> 
wrote:
> Hello,
> 
> I have written code that download an AIF into flash, so it doesn't 
> have to download eacht time. Just by power up, the code will 
execute. 
> 
> Now this downloading goes great and it even works :), but not in 
the 
> way I want to.
> 
> When I manualy put the uC in user boot mode (register MEMMAP = 0x1)
> and I manually set the PC to 0x00000000 (reset vector) with a 
> debugger and let it run, the program works great (read: it blinks 
the 
> leds like I programmed)
> 
> So now comes the problem; it doesn't do this automatically by power 
> up. The LPC2104 has to detect valid user code and will check 0x14 
for 
Show quoted textHide quoted text
> this. In my case there is 0x99FFFF68 (the two complements of the 
> checksum of the other vectors.
> 
> My situation
> 
> Interrupt vector table Flash: 
> 
> 0x00 ea00001c
> 0x04 ea000015
> 0x08 ea000015
> 0x0c ea000015
> 0x10 ea000015
> 0x14 99ffff68
> 0x18 ea000014
> 0x1c ea000014
> 
> I think the reason why it doesn't work is because the uC doesn't 
> detect valid user code and so it doesn't goes into user boot mode, 
> put the pc to 0 and execute (like what I did manually)
> 
> Can you guys confirm that I calculated the right 2 compl. checksum, 
> or did I understand something wrong:
> 
> ea00001c + ea000015 + ea000015 + ea000015 + ea000015 + 99ffff68 + 
> ea000014 + ea000014 = 0 (32 bits). Right????
> 
> So any suggestion what I have to do to get it execute my user code 
> automatically after powerup?
> 
> Thanks alot
> 
> Bob

Re: Start from flash

2004-05-26 by tendoskeleton

Hio Guys,

I wanted to write a post that I found the problem and here I find the 
correct answer also. Thanks alot!!!

It was indeed the P0.14. What did go wrong? When I wanted to check 
this (I red it also in the user manual), I was to fast and red P14 
and with the scoop I saw a logic '1'. But thats the wrong pin, P0.14 
is P44.

Bob

Re: Start from flash

2004-05-26 by tendoskeleton

Hio Guys,

I wanted to write a post that I found the problem and here I find the 
correct answer also. Thanks alot!!!

It was indeed the P0.14. What did go wrong? When I wanted to check 
this (I red it also in the user manual), I was to fast and red P14 
and with the scoop I saw a logic '1'. But thats the wrong pin, P0.14 
is P44.

Bob

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.