When placing code and data using scatterloading, you might need to place more than one execution region at a fixed address in e.g. ROM or Flash, which must not be moved or copied to another location. To do this with ADS 1.0.1 and SDT, you have to introduce another load region, and place the second execution region in it so that it becomes a 'root' region, like this:
ROM_1 0x0 0x10000 { ER_1 0x0 { init.o (+RO, +FIRST) * (+RO) } RAM 0x20000 { * (+RW, +ZI) } }
ROM_2 0x10000 0x10000 { ER_2 0x10000 { app.o (+RO) } }
Unfortunately, when converting the ELF linker output to a binary format with a fromelf step, fromelf will generate one output file for each load region (in the case above, two files, named ER_1 and ER_2). There is no direct way to create only one file that contains both load regions. Some workarounds for ADS 1.0.1 and SDT are described in Merging binary images together, BIN2AOF . This restriction is solved in ADS 1.1 with the introduction of the 'FIXED' attribute for regions within the scatter file. The 'FIXED' attribute forces the load address and execution address of a region to be the same (making it a 'root region'), so that it will not be moved/copied. With ADS 1.1 and later, you can change the scatter description above to:
ROM_1 0x0 0x20000 { ER_1 0x0 { init.o (+RO, +FIRST) * (+RO) } ER_2 0x10000 FIXED { app.o (+RO) } RAM 0x20000 { * (+RW, +ZI) } }
Note the use of 'FIXED', so that both ER_1 and ER_2 are root regions, and only one output file is created by fromelf (named ER_1).
|