In 14.2 the FSBL is built to hand-off the code to the first executable partition found in the image.
If your image is structured as follows, then application1.elf gets executed right away and application2.elf does not get copied from flash to memory.
fsbl.elf
bitstream.bit
application1.elf
application2.elf
Create the FSBL template by selecting New -> Application Project and choosing the standalone FSBL.
Modify the FSBL as follows to load both executable partitions and execute the first one ( application1.elf ).
1. In "image_mover.c" define the global variable:
u32 ExecutionAddress = 0;
2. Modify the code in "image_mover.c" under the "update_status_reg" section to implement the following algorithm:
2.1. After loading a partition, check if it is an executable partition ( for example: application1.elf). If so, store the execution address to the variable ExecutionAddress and keep looking for other partitions.
2.2. Keep loading other partitions. In our example, application2.elf
2.3. After the last partition is loaded, use the ExecutionAddress variable as hand-off address. Application1.elf will execute.
Note: The current plan is to implement a better, more stable and tested solution for FSBL in future releases.
update_status_reg:
..............................................
NextPartition = PartitionNum;
// CHANGED: the last partition has benn loaded, what to do next?
ExecAddr = ExecutionAddress;
SkipPartition = 0;
} else {
// CHANGED: no "code partition" has been found
debug_xil_printf("CHANGED: There are no partitions to execute\r\n");
while(1) {
PatWDT();
}
}
} else if(IsEmptyHeader(Hap)) {
debug_xil_printf("Empty partition header %x\r\n", NextPartitionAddr);
OutputStatus(EMPTY_PARTITION_HEADER);
return MOVE_IMAGE_FAIL;
} else { // CHANGED: it's not the last partition but it's the one to execute later.
if ( SkipPartition == 0 ) {
SkipPartition = 1;
ExecutionAddress = ExecAddr;
debug_xil_printf("CHANGED: does not execute but prepare to.\r\n");
}
}
..............................................
AR# 51956 | |
---|---|
日期 | 06/03/2013 |
状态 | Active |
Type | 综合文章 |
器件 | |
Tools |