Embedded Design Handbook

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

4.1.2.1.1. nios2-flash-programmer Usage Example

You can perform the following steps to program a CFI device:

  1. Follow the steps in nios2-download, or use the Nios® II EDS, to program your FPGA with a design that interfaces successfully to your CFI device.
  2. Type the following command to verify that your flash device is detected correctly:
    nios2-flash-programmer –debug –base=<base address>

    where <base address> is the base address of your flash device. The base address of each component is displayed in Platform Designer. If the flash device is detected, the flash memory’s CFI table contents are displayed.

  3. Convert your file to flash format (.flash) using one of the utilities elf2flash, bin2flash, or sof2flash described in elf2flash, bin2flash, and sof2flash.
  4. Type the following command to program the resulting .flash file in the CFI device:
    nios2-flash-programmer –base=<base address> <file>.flashr
  5. Optionally, type the following command to reset and start the processor at its reset address:
    nios2-download –g –r