AR# 51956


Zynq-7000 Example Design - Modify the 14.2 FSBL to load multiple executable partitions


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.



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: This code has NOT being tested for FALLBACK mechanism.

Note: The current plan is to implement a better, more stable and tested solution for FSBL in future releases.



if (IsLastPartition(Hap)) {
debug_xil_printf("There are no more partitions to load\r\n");

 NextPartition = PartitionNum;

 // CHANGED: the last partition has benn loaded, what to do next?

if ( ExecutionAddress ) {
// CHANGED: a previous "code partition" has been loaded


debug_xil_printf("CHANGED: ready to execute at %x\r\n",ExecutionAddress);

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) {


} else if(IsEmptyHeader(Hap)) {

debug_xil_printf("Empty partition header %x\r\n", NextPartitionAddr);

} 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 综合文章
People Also Viewed