.. program:: xflash XFLASH ====== Synopsis -------- .. code-block:: xflash xe-file xflash [options] Description ----------- XFLASH creates binary files in the xCORE flash format, as illustrated in the diagram below. It can also program these files onto flash devices used to boot XMOS systems. .. _xflash_manual_flash_format_diagram: .. figure:: images/flash-format.* Flash format diagram Options ------- Overall Options ^^^^^^^^^^^^^^^ The following options are used to specify the program images and data that makes up the binary and its layout. Padding is inserted when required to ensure that images are aligned on sector boundaries. .. option:: --factory [size] Specifies as the factory image. If size is specified, padding is inserted to make the space between the start of this image and the next image at least the specified size. The default unit of size is "bytes;" the size can be postfixed with ``k`` to specify a unit of kilobytes. At most one factory image may be specified. .. option:: --upgrade [size] Specifies as an upgrade image with version . Each version number must be a unique number greater than 0. If is specified, padding is inserted to make the space between the start of this image and the next image at least the specified size. The default unit of size is "bytes;" the size can be postfixed with ``k`` to specify a unit of kilobytes. Multiple upgrade images are inserted into the boot partition in the order specified on the command line. If no factory image is specified, a single upgrade image may be specified and written to a file with the option ``-o``. .. option:: --factory-version Specifies version as the tools release master version that was used to create the factory image. Accepted values are: 13.0, 13.1, 13.2, 14.0, 14.1, 14.2, 14.3 and 15.0. This option need only be specified when :option:`--upgrade` is provided but :option:`--factory` is not. This option will ensure that the produced flash upgrade image is of the correct format for the installed factory image. .. option:: --boot-partition-size Specifies the size of the boot partition to be *n* bytes. If left unspecified, the default size used is the total size of the flash device. *n* must be greater than or equal to the minimum size required to store the boot loader, factory image and any upgrade images. XFlash will round up the actual boot partition size to the next sector boundary in flash memory. .. option:: --data Specifies the contents of to be written to the data partition. .. option:: --verbose Prints additional information about the program when loaded onto the target system. .. option:: --help Prints a description of the supported command line options. .. option:: --version Displays the version number and copyrights. .. _xflash_manual_target_options: Target Options ^^^^^^^^^^^^^^ The following options are used to specify which flash device the binary is to be programmed on. The type of flash device used determines the values for the SPI divider, sector size and memory capacity. .. option:: --list-devices, -l Prints an enumerated list of all JTAG adapters connected to the PC and the devices on each JTAG chain, in the form: ``ID Name Adapter ID Devices`` ``-- ---- ---------- -------`` The adapters are ordered by their serial numbers. .. option:: --id Specifies the adapter connected to the target hardware. XFLASH connects to the target platform and determines the type of flash device connected to it. .. option:: --adapter-id Specifies the serial number of the adapter connected to the target hardware. XFLASH connects to the target hardware and determines the type of flash device connected to it. .. option:: --jtag-speed Sets the divider for the JTAG clock to ``n``. The corresponding JTAG clock speed is 6/(n+1)MHz. The default value of the divider for the JTAG clock is 0, representing 6MHz. .. option:: --spi-spec Enables support for the flash device specified in *file* (see :ref:`add_flash_support`). .. option:: --spi-div Sets the divider for the SPI clock to *n*, producing an SPI clock speed of 100/2*nMHz. By default, if no target is specified, the divider value is set to 3 (16.7MHz). .. option:: --fast-spi-div Sets the divider for the QuadSPI clock used during fast boot to *n*, producing an QuadSPI clock speed of xcore_clock_speed/2*nMHz. By default the divider value is set to 5 (50MHz with a 500MHz xcore_clock). Supported divide values for fast boot are 3, 4, 5 and 6 .. option:: --spi-read-id Reads the spi manufacturer's id from the attached device. The *cmd* can be obtained from the spi manufacturer's datasheet. If there is more than one device in a network then all id's will be returned. .. option:: --noinq Does not run the device inquisitor program, which checks that images are aligned on sector boundaries. If ``--noinq`` is omitted XFLASH expects to be able to connect to the device via JTAG. .. option:: --force-pll-reset Will force an xCORE-200 device to reset when the PLL register is written during the boot process. By default the xCORE-200 device will not reset when the PLL register is written allowing for faster boot times. .. option:: --image-search-page Will instruct the second stage bootloader to search flash memory for potential upgrade images at every page boundry within the boot partition. This was the default search mechanism in tools 14.0 and all previous tools versions. .. option:: --image-search-sector Will instruct the second stage bootloader to search flash memory for potential upgrade images at every sector boundry within the boot partition. This is the new default search mechanism in tools 14.2. .. option:: --image-search-address
Will instruct the second stage bootloader to search flash memory for potential upgrade images at a specified address within the boot partition. This option can be provided up to a maximum of three times, allowing for 3 seperate upgrade images to be present within flash memory. .. _xflash_manual_security_options: Security Options ^^^^^^^^^^^^^^^^ The following options are used in conjunction with the :ref:`AES Module `. .. option:: --key Encrypts the images in the boot partition using the keys in *keyfile*. .. option:: --disable-otp Causes the flash loader to disable access to OTP memory after the program is booted. This is default if the option ``--key`` is used. .. option:: --enable-otp Causes the flash loader to enable access to OTP memory after the program is booted. This is default unless the option ``--key`` is used. .. _xflash_manual_programming_options: Programming Options ^^^^^^^^^^^^^^^^^^^ By default, XFLASH programs the generated binary file to the target flash device. .. option:: --outfile , -o Places output in ``file``, disabling programming. If the target platform is booted from more than one flash device, multiple output files are created, one for each device. The name of each output file is ``file_``, where is the value of the :ref:`Id attribute ` of the corresponding node. The following options perform generic read, write and erase operations on the target flash device. A target XN file must be specified, which provides ports used to communicate with the SPI device on the hardware platform. .. option:: --target-file [node] Specifies *xn-file* as the target platform. If *xn-file* specifies more than one flash device, a value for *node* must be specified. This value must correspond to the :ref:`Id attribute ` of the node connected to the target flash device. .. option:: --target [node] Specifies a target platform. The platform configuration must be specified in the file ``platform.xn``, which is searched for in the paths specified by the :envvar:`XCC_DEVICE_PATH` environment variable. If *xn-file* specifies more than one flash device, a value for *node* must be specified. This value must correspond to the :ref:`Id attribute ` of the node connected to the target flash device. .. option:: --erase-all Erases all memory on the flash device. .. option:: --read-all Reads the contents of all memory on the flash device and writes it to a file on the host. Must be used with ``-o``. .. option:: --write-all Writes the bytes in *file* to the flash device. .. option:: --no-reset-on-write Prevents XFLASH from resetting the xCORE after programming the device.