Using commands

The manage flash memory, type the following commands in the command prompt. To get help on a certain command, type that command with the –h or --help parameter, for example, fl_blankcheck –h.

Table 1. Flash programmer - commands
Command Description
fl_blankcheck
To check if flash memory is blank, use the following command:
fl_blankcheck [-n {NUMBER | all}] offset size 
where:
  • offset: Specifies the offset in the device's address range.
  • size: Specifies the size of flash memory (in bytes) to be checked.
  • -n: Specifies the number of mismatches to be shown in the console.
fl_dump
Flash memory can be written to a binary file or output to the console. To dump a flash device, use the following command:
fl_dump offset size [-c {1, 2, 4, 8, 16} | –f [FILE]]
where:
  • offset: Specifies the offset in the device's address range.
  • size: Specifies the size of flash memory (in bytes) to be dumped.
  • -f [FILE] (--file [FILE]): Specifies the path of the binary file where the dump will be saved. The file path must not contain spaces.
  • -c {1, 2, 4, 8, 16} (--cell {1, 2, 4, 8, 16}): Specifies the number of bytes per cell. This option applies when the –f option is not used and the output is shown in the console.
For example, to dump flash memory to a binary file:
fl_dump 0x40000 0x20000 –f dump.bin
If the –f option is not used, the dump is displayed in the console. For example:
fl_dump 0x40000 0x20000
fl_erase
To erase flash, use the following command:
fl_erase offset size
where:
  • offset: Specifies the offset in the device's address range.
  • size: Specifies the size of flash memory (in bytes) to be erased.
For example:
fl_erase 0x40000 0x100
fl_erase_all
To erase all flash memory, use the following command:
fl_erase_all
fl_protect
To protect flash from erasing or reprogramming, use the following command:
fl_protect offset size
where:
  • offset: Specifies the offset in the device's address range.
  • size: Specifies the size of flash memory (in bytes) to be protected.
For example:
fl_protect 0x100000 0x100
fl_current
If multiple flash devices are connected to your computer, select a certain device using the following command:
fl_current dev
where dev specifies the name of the current device.
fl_unprotect
To make protected flash ready for erasing or reprogramming, remove protection using the following command:
fl_unprotect offset size
where:
  • offset: Specifies the offset in the device's address range.
  • size: Specifies the size of flash memory (in bytes) from which protection will be removed.
For example:
fl_unprotect 0x100000 0x100
fl_info
To view the details about the selected flash device, use the following command:
fl_info
fl_write
To write a binary file or a hex value to flash memory, use the following command:
fl_write [-s [SIZE]] [-–erase] offset data [--verify]
where:
  • offset: Specifies the offset in the device's address range.
  • data: Specifies a hex value or a binary file that will be written to flash. The file path must not contain spaces.
  • -s [SIZE], --size [SIZE]: Specifies the size of flash memory (in bytes) to be written.
  • -e, --erase: Erases flash before writing new data.
  • -v, --verify: Verifies data written to flash. The data is compared with the file or value specified in the data parameter.
For example:
fl_write –-erase 0x40000 u-boot.bin --verify
fl_write_elf
To write an ELF file to flash memory, use the following command:
fl_write_elf [--erase][--verify][--base address] filename
where:
  • -e, --erase: Erases flash before writing new data.
  • -v, --verify: Verifies data written to flash. The result is “OK” or “ERROR”.
  • -b, --base: Specifies the base address of the ELF file in flash memory. This option is required if the ELF file is built for the aliased region of flash memory.
  • filename: Specifies the file name and the path at which the ELF file is located. Spaces are not allowed.
For example:
fl_write_elf –-erase --verify –-base 0x10000000 f:\test.elf