Yahoo Groups archive

Lpc2000

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

Message

Re: newbie question - booting

2006-03-24 by roger_lynx

--- In lpc2000@yahoogroups.com, "kathy_wright_ca"
<kathy_wright_ca@...> wrote:
>
> I've been developing code for several months on the Keil 2130 board 
> with a 2138 - no problems I haven't been able to figure out so far. 
> 
> Now I have my new board with 2136 and it doesn't appear to be booting.  
> I've compiled with Keil target info set as 2136 and as 2138 and they 
> both run on the demo board.  On the new board it gets through the first 
> few LDR in the startup code, then gets stuck somewhere up in the boot 
> sector.  I've also probed the flash memory contents  on both boards.  

> The code is actually different at 0x00000000 but looks the same at
the end. 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Hello Kathy,

Your observation might be worth looking more into. At reset, the
program counter, PC, is loaded with address 0x0000 0000  that contains
instruction which loads into PC the address of  the reset vector
(jumping over other entries in vector table), like this: 
            org 0x00
            ldr pc, [pc, #0x18]

When this instruction is executed, the PC is 8 bytes ahead (2 words),
so the PC=0x8+0x18 =0x20. 
At 0x20 there is an address of startup's "first" instruction.
It is really the third, but I mean this "first" from a programmer's
point of view, hm?  Two "hops" of the PC are given (0x0 -> 0x20 ->
your  first instruction)

BTW, using ldr pc, [pc, 0x18] makes the second hop to any address in 4
GB space, which is good, but in case of your board, not so good. The
code has to be *identical*, not "actually different at 0x0000000".  
This why the code beginnings have to match.

That is the theory, how do you load the program to FLASH? 
JTAG, UART/bootloader?
Can you you compare the HEX files? 

Good luck.

Best regards

Roger



> 
> Do I need to set something else in the compiler?  Do I need to set 
> something for the boot mode (I'll be reading up on that in the menn 
> time).  Any hints/advice is appreciated.
> 
> Kathy
>

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.