My issue is that I would like to load my application into flash at a specific address (my goal: eventually download a 2nd application to yet some other flash location, and when the system is reset, execute using this newly downloaded application).
In my .lcf link control file, I specify:
MEMORY {
vectorrom (RX) : ORIGIN = 0x00002000, LENGTH = 0x00000400
cfmprotrom (RX) : ORIGIN = 0x00002400, LENGTH = 0x00000020
code (RX) : ORIGIN = 0x00002A00, LENGTH = 0x0003FB00
vectorram (RWX) : ORIGIN = 0x20000000, LENGTH = 0x00000400
userram (RWX) : ORIGIN = 0x20000400, LENGTH = 0x00007C00
}
This will load and launch my application in flash from 0x2A00. The vector table is located in 0x2000 which I verify via the debugger, data is valid. But the system crashes ("Exception name vector: Address Error") if I "Run" it or attempt to step through the _startup entry routine.
If vectorrom is not at 0x00000000 then the system crashes - always. If the vectorrom is at the ZERO address, the system runs fine, entering the "code" as per its specification in the MEMORY section. So I can run code from anywhere in flash. But I need to have the vector table in flash also at a specific location in flash.
Any help to get me past this problem would be greatly appreciated.