16. SPI Flash Programmer¶

Note

This tool applies to DA14580/581/583, DA14585/6 and DA14531 chip family.

SPI Flash Programmer is used for downloading an image file to the SPI Flash Memory.

../_images/spiFlashProgrammer.png

Figure 64 SPI Flash Programmer for DA14585/6

../_images/spiFlashProgrammer531.jpg

Figure 65 SPI Flash Programmer for DA14531

  • Load hex/bin file: User can select a .hex or .bin image file in order to program it (see Program SPI/EEPROM) and burn it to the SPI Flash Memory.

  • Show info: Form here user can see how the current image was programed.

  • Offset in SPI Flash memory (HEX): Optionally user can specify an offset in hex for the SPI memory. Actions (read, write) will respect that offset.

  • SPI Flash memory size (HEX, in Bytes): User set the size of SPI Flash memory. The value is used for validating that the data range to be read/written does not go beyond the boundaries of the available memory space. In this way, Toolbox makes an initial check before the command is sent to the underlying library.
    If this value is smaller than the actual size, please update the value to prevent Toolbox from issuing the following message:
    Size of data of selected file plus offset exceeds SPI FLASH memory size
    If this value is higher than the actual size, the underlying library will fail to read/write beyond the max memory size and the following message will be displayed:
    Memory burning failed

After selecting the image file the following actions are available:

  • Connect: Special firmware is downloaded to the chip to allow the user interact with the SPI Flash memory. This is a mandatory step before enabling the other actions. Please note that this firmware is different from the firmware downloaded when pressing the ‘Connect’ button on the OTP Image tab. If a ‘CRC does not match’ shows up, please press the ‘Connect’ button again and then the hardware reset button on the board to restart the download process.
  • Read 32KB: The SPI Flash memory is always read in 32KByte blocks starting from the specified offset. This offset cannot be greater than the maximum SPI Flash Memory size. Since the application does not know the SPI Flash memory size, the user can specify it by filling the ‘SPI Flash Memory size (HEX, in bytes)’ field. If the user does not know the size of the SPI Flash memory, a default value of 128KB (0x20000 bytes) is used for DA14580/581/583 family and a value of 256KB (0x40000 bytes) is used for DA14585/6 family.
  • Erase: Erases the entire SPI Flash Memory
  • Erase sector: Erases the sectors included between the start and end address specified by the user.
  • Burn: Data is written starting at the selected offset. Please note that before downloading data to the SPI Flash, the firmware erases the appropriate 4KB sectors in the area that the data is about to be written.
  • Burn & Verify: Adds a verification step after the burn process. After burning data to SPI Flash memory, it is verified that the contents of the memory are the same with the contents of the file that has been burned.
  • Save: By pressing the Save button, the user has ability to save SPI Flash memory contents to a file. A dialog will popup, in order to select the output file, the offset and the number of SPI Flash memory bytes to save.
../_images/saveToFile.png

Figure 66 SPI save memory to file

Please note that currently SPI Flash Programmer has been tested in BUCK mode at 3V and BOOST mode at 2.7V.

For the Bypass mode the flash programmer binary needs to be updated.

Please Follow below steps to generate the new binary with bypass support:

  1. Open the flash programmer KEIL project under 6.0.14.1114\utilities\flash_programmer . See Figure 67
  2. Enable the CFG_POWER_MODE_BYPASS flag in arch.h file
  3. Compile. jtag_programmer_531.bin is generated
  4. Rename jtag_programmer_531.bin to jtag_programmer.bin
  5. Under your SmartSnippets™ Toolbox directory installation: For example

C:\Program Files (x86)\SmartSnippetsToolbox\SmartSnippetsToolbox5.0.12\common_resources\SupportPackages\DA1453x\toolbox_resources\common\jtag_programmer.bin

or

C:\DiaSemi\SmartSnippetsStudio2.0.12\Toolbox\common_resources\SupportPackages\DA1453x\toolbox_resources\common\jtag_programmer.bin.

Remove the jtag_programmer.bin and replace it by the new one.

../_images/bypassmode531.jpg

Figure 67 Generate flash programmer binary on KEIL to support bypass mode for DA14531