Nios® V Embedded Processor Design Handbook

ID 726952
Date 4/04/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

6.5.2.5. HEX File Generation

A .hex file must be generated from the .elf file so that the .hex file can be used for memory initialization.

  1. Launch the Nios V Command Shell.
  2. Use the following command line to convert the .elf to .hex for your application. This command creates the application (app.hex) file.
    elf2hex software/app/build/app.elf -o app.hex \
        -b <base address of OCRAM> -w <data width of OCRAM> \
        -e <end address of OCRAM>
    
  3. Recompile the hardware design to memory-initialize the app.hex into the On-Chip RAM.
Note: You must ensure that the .hex filename is exactly the same as configured in the system memory for a successful recompilation.