Selecting the programming files

Running XJFlashSelectProgrammingFiles will show this dialog, which allows you to choose the files to program into the flash and set programming options.

The following general options are available:

  • Erase mode
    • ALL - erase all of the contents of the flash.
    • MINIMAL - erase only those areas of the flash corresponding to the selected files.

    Only erase when required - if this checkbox is selected, XJFlash will read the flash before erasing, and only perform the erase if data is found. As reading is much faster than erasing, this can increase the speed of the operation.

    Verify erase - check that the region selected has been erased.

    N.B. If you are using the Only erase when required feature, then the erase is verified as part of this process, as the checking continues from the address which was due to be erased.

  • Verify after programming
    • EACH FILE - verify each file after it has been programmed. This can be quicker, as each file is only loaded once from disk.
    • ALL FILES - verify all files after all programming has finished. This guarantees that all files have been programmed without causing errors in other regions. It also allows for overlapping files, e.g. when a region is left unprogrammed in one file and programmed in a following file.

You then need to select files to program to the flash. Click Add file to add an entry, and fill in the following details:

  • Erase, Program, Verify - select which tasks should be run for this file.
  • File name - click on the button to select the file from your computer.
  • File type - select BIT, BIN, HEX or SREC, corresponding to the format of your file.

    If your file is a .MCS file, select HEX as the file type.

  • Byte offset - the address at which the file will be programmed into the flash. This offset can be a negative number for files in SRecord or Intel Hex formats.
  • Bit swap - this field allows for several re-arrangements of bit order in your file. Enter an integer whose bits have the following meanings:
    • bit 0 - swap adjacent bits.
    • bit 1 - swap adjacent pairs of bits.
    • bit 2 - swap adjacent nibbles (4 bits, half a byte).
    • bit 3 - swap adjacent bytes.
    • and so on, until it swaps the entire width of the data bus of the flash.

    The value is best expressed in binary, starting 0b. The values can be combined, so to bit-reverse each byte, the value would be set to 0b111.