Embedded Design Handbook

ID 683689
Date 8/28/2023
Public
Document Table of Contents

5.3.5.5. Packing the Test Application in a Boot Record

In this section, package the test application to boot in a boot record that the boot copier can understand. To package the application, run a script from a Nios® II command shell. The following scripts are included with the design files:
  • make_flash_image_script.sh
  • make_header.pl
  • read_flash_image.pl
To package the test application to boot using the advanced boot copier, perform the following steps:
  1. Open <project> /boot_copier_sw/app/hello_world/make_flash_image_script.sh in a text editor and update the flash_base and flash_end parameters to match your system.
  2. In your Nios® II command shell, run the make_flash_image_script.sh script to package the .elf file in a boot record, by typing the following command:
    ./make_flash_image_script.sh hello_world.elf
    
    
    //Press ENTER
Note: Running this script might issue a warning about an empty loadable segment and display the name of an intermediate file fake_flash_copier.srec. You can safely ignore these messages.

The script creates the files hello_world.elf.flash.bin and hello_world.elf.flash.srec in the current directory. You now have all the binary images needed to boot a test application with the example boot copier. Next, you program these images in the appropriate locations.