Content originally posted in LPCWare by starblue on Thu Mar 10 01:33:42 MST 2016
Quote: DF9DQ
If you download an image that begins with a Cortex-M vector table, you need to know yourself where the entry address is, and specify it with the GO command. The vector table doesn't start with executable code, so jumping there would crash the CPU.
In such an image the second word (at offset 4) contains the Reset vector, which should be a good start address. You'll need to clear bit 0, which is not really part of the address (it signals thumb mode and is always set on Cortex-M).
Now according to the user manual the 'G' command expects a value at a word boundary (divisible by 4), which is a bit strange because the hardware only requires alignment to halfwords (divisible by 2). So if you find an address that is divisible by 2 but not by 4 you may be out of luck.
Note I haven't tried this myself.
Also, note that the image needs to be linked for running at the RAM address you are using. You can't take the same image that is used in flash memory.
*Edit*: Stack size could still be a problem, because this method wouldn't set up the stack properly, unless the image does that itself (normal images don't, as it is done by the hardware before anything else).