LPC2136 can't program app to Flash, verify error at address 0

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC2136 can't program app to Flash, verify error at address 0

365 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Oliver Sedlacek on Fri Aug 23 07:56:00 MST 2013
I can't get any of the demo examples (Keil or IAR) to run from Flash. My current theory is that the linker files don't accommodate the boot loader so they try to write the reset vector at address 0. Does anyone have any ideas as to where I need to put the Vector table and/or anything else I need to do?
Labels (1)
0 Kudos
3 Replies

320 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MarcVonWindscooting on Tue Aug 27 04:55:17 MST 2013
Ah, no! If you're using the bootloader: it remaps its own vector table to address 0 and doesn't undo that before reading flash.
That way, you can never read the first 64 (i think) Bytes.
Just raise your eyebrows, turn verify off and go on ;-)
0 Kudos

320 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Oliver Sedlacek on Tue Aug 27 01:28:32 MST 2013
Thanks for your input. I guess the problem must just be that there is some form of protection on address 0.
0 Kudos

320 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MarcVonWindscooting on Fri Aug 23 08:55:21 MST 2013
Vector table at 0 is fine.
When your program is in FLASH, you don't need to care about the bootloader anymore. bootloader changes some RAM contents at bootup, but that will definitely not affect any demo programs.

But you linker must know about the destination address of your code. Otherwise your program is going to load from/jump to some unintended location.
That's not position-independend code, what is generated from your compiler.

(Edit)
I'm a GNU Toolchain user. If I have such problems I use objdump -h to find out if everything is where it should be: .text, .rodata at 0x0; .data, .bss, at 0x4000 0000.
Your stack pointer to 0x4000 0000 + 16k as an example. However, SP is set by crt0, so maybe you have to dig deeper to get to know its value.
0 Kudos