|
Debugging multiple applications I haven't done, but for release mode programming the scenario works.
Add "-Map=$(PROJECT).map" (where $(PROJECT) is your project name) to your makefile as part of your linker flags. This will generate a map file that will show you exactly where in memory the compiled objects and functions will reside.
If application A consists of e.g. 3 objects - start.o, middle.o and end.o and you do not explicitly tell the linker to put the .text section of start.o at the start address, the linker might put end.o at that address, and then your function pointer to that address will not have the desired effect.
In your linker script (.ld file) it defines sections as to what goes in flash, and what goes in ram. Also it defines where in flash and/or ram those sections are put. I have attached three linker scripts (rename them from .zip to .ld - AT91 doesn't like other extensions) use the different linker scripts for the different applications. Remember not to overlap the memory regions of the sram if you want to be able to return from the applications function calls to the apploader.
| Attachments: |
File comment: App2 linker script. Second app to run after startup. Same story as with app1, only starts at different address.
app2.zip [1.6 KiB]
Downloaded 25 times
|
File comment: App1 linker script. App is called via function pointer. Start_Function Located at start of flash1.
app1.zip [1.6 KiB]
Downloaded 27 times
|
File comment: Apploader linker script. First app to run at startup. Enters ResetException. Located in flash0, thus only GPNVM bit 1 needs to be set
apploader.zip [1.66 KiB]
Downloaded 35 times
|
|