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.