30. Command-line implementation

SmartSnippets™ Toolbox also provides a command line implementation of its functionality. In order to run the command-line version of SmartSnippets™ Toolbox, the user has to open the command prompt, change folder to SmartSnippets™ Toolbox installation folder under SmartSnippetsStudio/Toolbox and execute one of the available commands listed below. The commands are slightly different depending on the chip family.

In what follows, by Executable we refer to the SmartSnippets™ Toolbox executable. On windows use the full path to the SmartSnippetsToolbox.exe (e.g. C:\DiaSemi\SmartSnippetsStudio<version>\Toolbox\SmartSnippetsToolbox.exe. On Linux use java -jar <path_to_SmartSnippetsToolbox.jar> . You may find a bundled java under SmartSnippetsStudio\jre folder

Options enclosed in square bracket are optional. For commands with type power COM port is mandatory and is used for data capturing. If also jtag serial number is specified, jtag interface will be used for firmware download. A special note on -firmware option. If no present, it is assumed that the appropriate firmware has been downloaded and running previously e.g. with booter command. If no firmware has been downloaded then use the -firmware option. This option will first download the firmware and then execute the command. Usually the firmware for all commands except power is uartboot.bin for DA1468x and DA1469x or flash_programmer.bin (UART communication) and jtag_programmer.bin (JTAG communication) for the rest families.

30.1. Common CLI commands for all chip families

  1. Executable -help -chip chip_version

    Displays the available commands and examples.

  2. Executable -bundle commands_file

    Executes bundle of commands from input txt file. This would save time when executing multiple commands. For example the following bundle commands burn a bootable image on SPI for DA14531.
    Example:
    SmartSnippetsToolbox.exe -bundle input.txt
    Where the contents of input.txt are shown on Code 3
    Code 3 CLI bundle example. Burn a bootable image on DA14531 SPI
    -type booter -chip DA14531 -com_port 13 -file "C:\DA145xx_SDK\6.0.14.1114\config\toolbox_resources\DA1453x\common\flash_programmer.bin" -uart P0_5
    -type spi -chip DA14531 -com_port 13 -cmd erase -uart P0_5
    -type spi -chip DA14531 -com_port 13 -cmd write -file "C:\DA145xx_SDK\6.0.14.1114\projects\target_apps\peripheral_examples\blinky\Keil_5\out_DA14531\Objects\blinky_531.bin" -uart P0_5 -bootable
    

30.2. CLI for DA14580/581/583, DA14585/6 and DA1453x family chips

  1. Executable [-sdk sdk_path] -type booter -chip chip_version [-jtag jtag_serialNumber | -com_port portNumber] [-sys_ctrl_reg b1] [-gp_ctrl_reg b2] [-close] [-gpio pinId] [-uart TxId] -file filename [-y] [-nomessages messageFilter]

    Downloads file to the chip using UART Booter tool. If a CRC does not match shows up, please run the command again and then press the hardware reset button on the board to restart the download process.
    Example:
    SmartSnippetsToolbox.exe -type booter -chip DA14531 -com_port 13 -uart P0_5 -file "C:\DA145xx_SDK\6.0.14.1114\config\toolbox_resources\DA1453x\common\flash_programmer.bin"
    Note: Option “-uart P0_5” is used to define 1-wire communication over P0_5, P0_5.
  2. Executable [-sdk sdk_path] -type otp -chip chip_version [-jtag jtag_serialNumber | -com_port portNumber] [-baudrate rate] [-gpio pinId] [-uart TxId] [-firmware firmware_file] -cmd write_header -file filename [-writeReadOnlyOTPHeaderFields] [-y] [-nomessages messageFilter]

    Burns file to OTP Header. Makes the assumption that a valid firmware file has already been downloaded (e.g. through use of the uartBooter command above). In order to disable validations that stop the header writing process waiting for user confirmation, the following line should be added to the “<user home directory>\properties.txt” file: DISABLEVALIDATIONS = true.
    Example 1:
    SmartSnippetsToolbox.exe -type otp -chip DA14531 -com_port 13 -uart P0_5 -cmd write_header -file 531_header.hex

    Example 2 (configuration script):
    SmartSnippetsToolbox.exe -type otp -chip DA14531 -com_port 13 -uart P0_5 -cmd write_header -file 531_header_with_updated_conf_script.bin
    User can edit the configuration script from GUI OTP Header tab, export contents (button export) to “531_header_with_updated_conf_script.bin” and burn the updated header file with the above command.
  3. Executable [-sdk sdk_path] -type otp -chip chip_version [-jtag jtag_serialNumber | -com_port portNumber] [-baudrate rate] [-gpio pinId] [-uart TxId] [-firmware firmware_file] -cmd write_nvds -file filename [-offset ofst] [-y] [-nomessages messageFilter]

    Burns file to OTP NVDS. Makes the assumption that a valid firmware file has already been downloaded (e.g. through use of the uartBooter command above). Not applicable for DA14585/6 and DA1453x

  4. Executable [-sdk sdk_path] -type otp -chip chip_version [-jtag jtag_serialNumber | -com_port portNumber] [-baudrate rate] [-gpio pinId] [-uart TxId] [-firmware firmware_file] -cmd write_custom_code -file filename [-offset ofst] [-writeReadOnlyOTPHeaderFields] [-y] [-nomessages messageFilter]

    Burns file to OTP memory. Makes the assumption that a valid firmware file has already been downloaded (e.g. through use of the uartBooter command above). On DA14583-01 chip asks for confirmation even with option ‘-y’
    Example 1
    SmartSnippetsToolbox.exe -type otp -chip DA14531 -com_port 13 -uart P0_5 -cmd write_custom_code -file  files\code.bin -offset 0x200 -firmware C:\DA145xx_SDK\6.0.14.1114\config\toolbox_resources\DA1453x\common\flash_programmer.bin

    Example 2 (configuration script):
    SmartSnippetsToolbox.exe -type otp -chip DA14531 -com_port 13 -uart P0_5 -cmd write_custom_code -file  files\configuration_script.bin -offset 0x7ED0 -firmware "C:\DA145xx_SDK\6.0.14.1114\config\toolbox_resources\DA1453x\common\flash_programmer.bin"
    Offset 0x7ED0 indicates the start of configuration script. configuration_script.bin contains the data of the configuration script (240 bytes for DA14531).
  5. Executable [-sdk sdk_path] -type otp -chip chip_version [-jtag jtag_serialNumber | -com_port portNumber] [-baudrate rate] [-gpio pinId] [-uart TxId] [-firmware firmware_file] -cmd read_header -file filename [-y] [-nomessages messageFilter]

    Reads OTP Header and writes its contents to a file. Makes the assumption that a valid firmware file has already been downloaded (e.g. through use of the uartBooter command above).

  6. Executable [-sdk sdk_path] -type otp -chip chip_version [-jtag jtag_serialNumber | -com_port portNumber] [-baudrate rate] [-gpio pinId] [-uart TxId] [-firmware firmware_file] -cmd read_nvds -file filename [-offset ofst] [-y] [-nomessages messageFilter]

    Reads OTP NVDS and writes its contents to a file. Makes the assumption that a valid firmware file has already been downloaded (e.g. through use of the uartBooter command above). Not applicable for DA14585-00 and DA14586-00

  7. Executable [-sdk sdk_path] -type otp -chip chip_version [-jtag jtag_serialNumber | -com_port portNumber] [-baudrate rate] [-gpio pinId] [-uart TxId] [-firmware firmware_file] -cmd read_custom_code -file filename [-offset ofst] [-length byteLength] [-y] [-nomessages messageFilter]

    Reads OTP memory contents and writes its contents to a file. Makes the assumption that a valid firmware file has already been downloaded (e.g. through use of the uartBooter command above). If length not specified it takes the value of OTP size.

  8. Executable [-sdk sdk_path] -type otp -chip chip_version [-jtag jtag_serialNumber | -com_port portNumber] [-baudrate rate] [-gpio pinId] [-uart TxId] [-firmware firmware_file] -cmd write_field [-offset ofst] -data dataInHex [-nvds_address_offset nvdsAddrOfst] [-writeReadOnlyOTPHeaderFields] [-y] [-nomessages messageFilter]

    Burns dataInHex to OTP starting from address 0x40000 + ofst.
    Example:
    SmartSnippetsToolbox.exe -type otp -chip DA14531 -jtag 480071025 -cmd  write_field  -data 12345678 -offset 0x100 -firmware "C:\DA145xx_SDK\6.0.14.1114\config\toolbox_resources\DA1453x\common\jtag_programmer.bin"
  9. Executable [-sdk sdk_path] -type power -chip chip_version -com_port portNumber [-gpio pinId] [-uart TxId] [-jtag jtag_serialNumber] [-firmware firmware_file] -cmd capture_data -duration durationInmSecs [-time_offset time_offset] [-threshold threshold] [-zero_samples_for_sw_cursor samples] [-sw_cursor_tolerance tolerance] [-sw_cursors_to_stop cursors_to_stop] -data_file data_file -stat_file stat_file [-y] [-nomessages messageFilter]

    Captures Current data measured by Power Profiler, writes them to a file and exports final statistics. This command applies only to devices with SPI interface.
    Example:
    SmartSnippetsToolbox.exe -type power -chip DA14531 -com_port 13 -uart P0_5 -cmd capture_data -duration 6000 -data_file data_file.csv -stat_file stat_file.csv -firmware "C:\DA145xx_SDK\6.0.14.1114\projects\target_apps\ble_examples\ble_app_barebone\Keil_5\out_DA14531\Objects\ble_app_barebone_531.hex"
  10. Executable [-sdk sdk_path] -type power -chip chip_version -com_port portNumber [-gpio pinId] [-uart TxId] [-jtag jtag_serialNumber] [-firmware firmware_file] -cmd export_stats -duration durationInSecs -sampling_interval sampling_interval -stat_file stat_file [-y] [-nomessages messageFilter]

    Captures statistics for a period of time and exports to a file statistic samples every sampling interval. Makes the assumption that a valid firmware file has already been downloaded (e.g. through use of the uartBooter command above). This command applies only to devices with SPI interface.
    Example:
    SmartSnippetsToolbox.exe -type power -chip DA14531 -com_port 13 -uart P0_5 -cmd export_stats -duration 6 -stat_file stats.csv -sampling_interval 1
    Assumes that firmware has been already downloaded.
  11. Executable [-sdk sdk_path] -type spi -chip chip_version [-clk clk] [-cs cs] [-miso miso] [-mosi mosi] [-jtag jtag_serialNumber | -com_port portNumber] [-baudrate rate] [-gpio pinId] [-uart TxId] [-firmware firmware_file] -cmd read -file filename [-offset ofst] [-length byteLength] [-max size] [-y] [-nomessages messageFilter]

    Reads SPI FLASH memory contents and writes them to a file.

  12. Executable [-sdk sdk_path] -type spi -chip chip_version [-clk clk] [-cs cs] [-miso miso] [-mosi mosi] [-jtag jtag_serialNumber | -com_port portNumber] [-baudrate rate] [-gpio pinId] [-uart TxId] [-firmware firmware_file] -cmd write -file filename [-offset ofst] [-max size] [-verify] [-bootable] [-y] [-nomessages messageFilter]

    Burns file to SPI FLASH memory.
    Example:
    SmartSnippetsToolbox.exe -type spi -chip DA14531 -com_port 13 -uart P0_5 -cmd write -offset 0x0100 -file files\prox_reporter.bin -max 0x400000 -firmware "C:\\DA145xx_SDK\\6.0.14.1114\\config\\toolbox_resources\\DA1453x\\common\\flash_programmer.bin"
  13. Executable [-sdk sdk_path] -type spi -chip chip_version [-clk clk] [-cs cs] [-miso miso] [-mosi mosi] [-jtag jtag_serialNumber | -com_port portNumber] [-gpio pinId] [-uart TxId] [-firmware firmware_file] -cmd erase [-verify] [-offset ofst] [-max size] [-sectors num] [-end address] [-y] [-nomessages messageFilter]

    Erases all the SPI FLASH memory when -offset, -sectors and -end have not been specified. User can erase specific sectors by either using -sectors or -end. In the first case the specified number of sectors is erased. In the second case the sectors included between offset and end address are erased. If offset is specified without -end or -sectors, only the sector that includes the offset is erased. Sector size is 4KB.

  14. Executable [-sdk sdk_path] -type spi -chip chip_version [-clk clk] [-cs cs] [-miso miso] [-mosi mosi] [-jtag jtag_serialNumber | -com_port portNumber] [-baudrate rate] [-gpio pinId] [-uart TxId] [-firmware firmware_file] -cmd write_field [-offset ofst] -data dataInHex [-max size] [-y] [-nomessages messageFilter]

    Burns dataInHex to SPI FLASH starting from address ofst.
    Example:
    SmartSnippetsToolbox.exe -type spi -chip DA14531 -com_port 13 -cmd write_field -offset 0x1000 -data 01234567890123456789 "C:\DA145xx_SDK\6.0.14.1114\config\toolbox_resources\DA1453x\common\flash_programmer.bin"
  15. Executable [-sdk sdk_path] -type eeprom -chip chip_version [-scl scl] [-sda sda] [-jtag jtag_serialNumber | -com_port portNumber] [-baudrate rate] [-gpio pinId] [-uart TxId] [-firmware firmware_file] -cmd read -file filename [-offset ofst] [-length byteLength] [-max size] [-y] [-nomessages messageFilter]

    Reads EEPROM memory contents and writes them to a file.

  16. Executable [-sdk sdk_path] -type eeprom -chip chip_version [-scl scl] [-sda sda] [-jtag jtag_serialNumber | -com_port portNumber] [-baudrate rate] [-gpio pinId] [-uart TxId] [-firmware firmware_file] -cmd write -file filename [-offset ofst] [-max size] [-verify] [-bootable] [-y] [-nomessages messageFilter]

    Burns file to EEPROM memory.

  17. Executable [-sdk sdk_path] -type eeprom -chip chip_version [-scl scl] [-sda sda] [-jtag jtag_serialNumber | -com_port portNumber] [-baudrate rate] [-gpio pinId] [-uart TxId] [-firmware firmware_file] -cmd erase [-bit_value val] [-verify] [-max size] [-y] [-nomessages messageFilter]

    Erases EEPROM memory by writing the bit value to every bit of memory. Default value is 0.

  18. Executable [-sdk sdk_path] -type eeprom -chip chip_version [-scl scl] [-sda sda] [-jtag jtag_serialNumber | -com_port portNumber] [-baudrate rate] [-gpio pinId] [-uart TxId] [-firmware firmware_file] -cmd write_field [-offset ofst] -data dataInHex [-max size] [-y] [-nomessages messageFilter]

    Burns dataInHex to EEPROM starting from address ofst.

  19. Executable [-sdk sdk_path] -type suota -chip chip_version -initiator portNumber -receiver ble_addr -file img_file [-memtype memoryType] [-bank bank_num] [-i2c_addr addr] [-block_size b_size] [-scl scl] [-sda sda] [-miso miso] [-mosi mosi] [-cs cs] [-sck sck] [-y] [-nomessages messageFilter]

    SUOTA (Software Update Over the Air). Applicable only for DA14580-01.

  20. Executable [-sdk sdk_path] -type spota -chip chip_version -initiator portNumber -receiver ble_addr -file img_file [-memtype memoryType] [-base_addr addr ] [-i2c_addr addr] [-scl scl] [-sda sda] [-miso miso] [-mosi mosi] [-cs cs] [-sck sck] [-y] [-nomessages messageFilter]

    SPOTA (Software Patch Over the Air). Applicable only for DA14580-01.

  21. Executable [-sdk sdk_path] -type battery_life -chip chip_version -input input_file [-params params_file]

    Battery Lifetime Estimation. input_file contains the input values to be used for the calculations. Optionally, params_file can be used to override the default values per chip family that are used in the calculations.
    Example:
    SmartSnippetsToolbox.exe -type battery_life -chip DA14531 -input "C:\DiaSemi\SmartSnippetsStudio2.0.14\Toolbox\common_resources\SupportPackages\DA1453x\toolbox_resources\common\lifetimeEstimator_defaults_Boost.txt"

Table 6 provides a description for above options.

30.3. CLI for DA1468x and DA1469x family chips

Note: Communication with JTAG on Linux requires netstat utility for DA1468x and DA1469x. Before run java -jar <path_to_SmartSnippetsToolbox.jar> check that utility exists in PATH. If not, either install with system’s package manager e.g. sudo apt-get install net-tools or use the net-tools included on SmartSnippets Toolbox installation: export PATH=$PATH:<toolbox_installation_folder>/net-tools-1.60/bin

  1. Executable [-sdk sdk_path] -type booter -chip chip_version [-jtag jtag_serialNumber | -com_port portNumber] -file filename [-close] [-y] [-nomessages messageFilter]

    Downloads file to the chip using UART Booter tool.
    Example:
    SmartSnippetsToolbox.exe -type booter -chip DA1469x-00 -jtag 483060192 -file "C:\SDK_10.0.8.105\binaries\uartboot.bin"
  2. Executable [-sdk sdk_path] -type otp -chip chip_version [-jtag jtag_serialNumber | -com_port portNumber] [-firmware firmware_file] -cmd write_header -file filename [-writeReadOnlyOTPHeaderFields] [-y] [-nomessages messageFilter]

    Burns file to OTP Header.
    Example:
    SmartSnippetsToolbox.exe -type otp -chip DA1469x-00 -com_port 13 -cmd write_header -file 690_header.bin
    Note: No -firmware option present, presumes firmware already download before.
  3. Executable [-sdk sdk_path] -type otp -chip chip_version [-jtag jtag_serialNumber | -com_port portNumber] [-firmware firmware_file] -cmd write_custom_code -file filename [-offset ofst] [-writeReadOnlyOTPHeaderFields] [-y] [-nomessages messageFilter]

    Burns file to OTP memory.
    Example:
    SmartSnippetsToolbox.exe -type otp -chip DA1469x-00 -com_port 13 -cmd  write_custom_code -file custom.bin -firmware "C:\SDK_10.0.8.105\binaries\uartboot.bin"
    Note: -firmware option instructs to download firmware before run the command.
  4. Executable [-sdk sdk_path] -type otp -chip chip_version [-jtag jtag_serialNumber | -com_port portNumber] [-firmware firmware_file] -cmd read_header -file filename [-y] [-nomessages messageFilter]

    Reads OTP Header and writes its contents to a file.
    Example:
    SmartSnippetsToolbox.exe -type otp -chip DA1469x-00 -com_port 13 -cmd read_header -file 690_header.bin -firmware "C:\SDK_10.0.8.105\binaries\uartboot.bin"
  5. Executable [-sdk sdk_path] -type otp -chip chip_version [-jtag jtag_serialNumber | -com_port portNumber] [-firmware firmware_file] -cmd read_custom_code -file filename [-offset ofst] [-length byteLength] [-y] [-nomessages messageFilter]

    Reads OTP memory contents and writes its contents to a file. If length not specified it takes the value of OTP size.
    Example:
    SmartSnippetsToolbox.exe -type otp -chip DA1469x-00 -com_port 13 -cmd  read_custom_code -file custom_code.hex -firmware "C:\SDK_10.0.8.105\binaries\uartboot.bin"
  6. Executable [-sdk sdk_path] -type otp -chip chip_version [-jtag jtag_serialNumber | -com_port portNumber] [-firmware firmware_file] -cmd write_field [-offset ofst] -data dataInHex [-writeReadOnlyOTPHeaderFields] [-y] [-nomessages messageFilter]

    Burns dataInHex to OTP starting from address 0x7F80000 + ofst.
    Example:
    SmartSnippetsToolbox.exe -type otp -chip DA1469x-00 -jtag 483060192 -cmd write_field -data 0123456789ABCDEF -offset 0x108
  7. Executable [-sdk sdk_path] -type power -chip chip_version -com_port portNumber [-firmware firmware_file] -cmd capture_data -duration durationInmSecs [-time_offset time_offset] [-threshold threshold] [-zero_samples_for_sw_cursor samples] [-sw_cursor_tolerance tolerance] [-sw_cursors_to_stop cursors_to_stop] -data_file data_file -stat_file stat_file [-y] [-nomessages messageFilter]

    Captures Current data measured by Power Profiler, writes them to a file and exports final statistics. This command applies only to devices with SPI interface.
    Example:
    SmartSnippetsToolbox.exe -type power -chip DA1469x-00 -com_port 13 -cmd capture_data -duration 1000 -data_file data.csv -stat_file stat.csv
  8. Executable [-sdk sdk_path] -type power -chip chip_version -com_port portNumber [-firmware firmware_file] -cmd export_stats -duration durationInSecs -sampling_interval sampling_interval -stat_file stat_file [-y] [-nomessages messageFilter]

    Captures statistics for a period of time and exports to a file statistic samples every sampling interval. Makes the assumption that a valid firmware file has already been downloaded (e.g. through use of the uartBooter command above).
    Example:
    SmartSnippetsToolbox.exe -type power -chip DA1469x-00 -com_port 13 -cmd export_stats -duration 6 -stat_file stats.csv -sampling_interval 1
  9. Executable [-sdk sdk_path] -type qspi -chip chip_version [-jtag jtag_serialNumber | -com_port portNumber] [-firmware firmware_file] -cmd read -file filename [-offset ofst] [-length byteLength] [-max size] [-y] [-nomessages messageFilter]

    Reads QSPI FLASH memory contents and writes them to a file.
    Example:
    SmartSnippetsToolbox.exe -type qspi -chip DA1469x-00 -com_port 13 -cmd read -file qspi_data.bin -offset 0x0 -length 0x1000 -firmware "C:\SDK_10.0.8.105\binaries\uartboot.bin"
  10. Executable [-sdk sdk_path] -type qspi -chip chip_version [-jtag jtag_serialNumber | -com_port portNumber] [-firmware firmware_file] -cmd write [-mode cached] -file filename [-offset ofst] [-max size] [-y] [-nomessages messageFilter]

    Burns file to QSPI FLASH memory. If -mode is specified, a header is added to make QSPI bootable. This option is applicable for DA1468x only.
    Example:
    SmartSnippetsToolbox.exe -type qspi -chip DA1469x-00 -com_port 13 -cmd write -file "C:\SDK_10.0.8.105\projects\dk_apps\demos\pxp_reporter\DA1469x-00-Release_QSPI\pxp_reporter.bin" -offset 0x0 -firmware "C:\SDK_10.0.8.105\binaries\uartboot.bin"
  11. Executable [-sdk sdk_path] -type qspi -chip chip_version [-jtag jtag_serialNumber | -com_port portNumber] [-firmware firmware_file] -cmd erase [-offset ofst] [-sectors num] [-max size] [-verify] [-y] [-nomessages messageFilter]

    Erases all the QSPI FLASH memory or part of it. Sector size is 4KB.
    Example:
    SmartSnippetsToolbox.exe -type qspi -chip DA1469x-00 -jtag 483060192 -cmd erase -sectors 85
  12. Executable [-sdk sdk_path] -type qspi -chip chip_version [-jtag jtag_serialNumber | -com_port portNumber] [-firmware firmware_file] -cmd write_field [-offset ofst] -data dataInHex [-max size] [-y] [-nomessages messageFilter]

    Burns dataInHex to QSPI FLASH starting from address ofst.
    Example:
    SmartSnippetsToolbox.exe -type qspi -chip DA1469x-00 -com_port 13 -cmd write_field -offset 0x0010 -data 01234567890123456789
  13. Executable [-sdk sdk_path] -type qspi -chip chip_version [-jtag jtag_serialNumber | -com_port portNumber] [-firmware firmware_file] -cmd write_nv -file filename [-offset ofst] [-max size] [-y] [-nomessages messageFilter]

    Burns nv params file to QSPI at offset.
    Example:
    SmartSnippetsToolbox.exe -type qspi -chip DA1469x-00 -com_port 13 -cmd write_nv -file nv_data.hex -offset 0x80000
  14. Executable [-sdk sdk_path] -type qspi -chip chip_version [-jtag jtag_serialNumber | -com_port portNumber] [-firmware firmware_file] -cmd read_nv -file filename [-offset ofst] [-max size] [-y] [-nomessages messageFilter]

    Reads nv params from QSPI and writes its contents to a file.
    Example:
    SmartSnippetsToolbox.exe -type qspi -chip DA1469x-00 -com_port 13 -cmd read_nv -file nv_params.bin
  15. Executable [-sdk sdk_path] -type qspi -chip chip_version [-jtag jtag_serialNumber | -com_port portNumber] [-firmware firmware_file] -cmd read_part_table -file filename [-y] [-nomessages messageFilter]

    Reads Partition table from QSPI memory and saves it to a file.
    Example:
    SmartSnippetsToolbox.exe -type qspi -chip DA1469x-00 -com_port 13 -cmd read_part_table -file part.txt
  16. Executable [-sdk sdk_path] -type qspi -chip chip_version [-jtag jtag_serialNumber | -com_port portNumber] [-firmware firmware_file] -cmd read_partition -index partition_index [-offset ofst] [-length byteLength] -file filename [-y] [-nomessages messageFilter]

    Reads partition specified by the index of partition table and saves it to a file. Offset, if specified, should be relative to the partition start address. Length, if specified, can be used to read byteLength bytes instead of the whole partition.
    Example: SmartSnippetsToolbox.exe -type qspi -chip DA1469x-00 -com_port 13 -cmd read_partition -index 6 -offset 0x200 -length 0x100 -file partition_data.bin
    Note: index refers to partition index. For example if partition table is as shown on Code 4 index=6 refers to NVMS_BIN_PART
    To see the partition table run read_part_table command
    Code 4 CLI partition index example.
    Name                            Start Address   Sector Count    Type
    NVMS_PRODUCT_HEADER_PART        0x00000000      2               19
    NVMS_FIRMWARE_PART              0x00002000      126             1
    NVMS_GENERIC_PART               0x000E0000      32              5
    NVMS_PLATFORM_PARAMS_PART       0x00100000      255             15
    NVMS_PARAM_PART                 0x001FF000      1               2
    NVMS_LOG_PART                   0x00200000      256             4
    NVMS_BIN_PART                   0x00300000      255             3
    NVMS_PARTITION_TABLE            0x003FF000      1               16
    
  17. Executable [-sdk sdk_path] -type qspi -chip chip_version [-jtag jtag_serialNumber | -com_port portNumber] [-firmware firmware_file] -cmd write_partition -index partition_index [-verify] [-offset ofst] -file filename [-y] [-nomessages messageFilter]

    Writes file to the partition specified by the index of partition table. Offset, if specified, should be relative to the partition start address.
    Example:
    SmartSnippetsToolbox.exe -type qspi -chip DA1469x-00 -com_port 13 -cmd write_partition -file file.bin -index 6
  18. Executable [-sdk sdk_path] -type qspi -chip chip_version [-jtag jtag_serialNumber | -com_port portNumber] [-firmware firmware_file] -cmd erase_partition -index partition_index [-verify] [-y] [-nomessages messageFilter]

    Erases the contents of the partition specified by the index of partition table.

  19. Executable [-sdk sdk_path] -chip chip_version -make_image -in_file inputFile [-out_file outputImg] [-priv_key priv_key | -generate_priv_key] [-pub_key_index pub_key_index] [-sym_key sym_key | -generate_sym_key] [-sym_key_index sym_key_index] [-nonce nonce_hex] [-rev rev_cmd]

    Applicable only for DA1469x-00.
    Prepares DA1469x family image. If any of the security related options is used (-priv_key, -generate_priv_key, -pub_key_index, -sym_key, -generate_sym_key, -sym_key_index, -nonce) a secure image will be created. The keys and nonce will be generated by default if the respective options are missing. If -rev option is also used, a secure image with device administration section will be created.
    Image produced is the same as the image when user press the “Prepare image” button in “Prepare QSPI Image” window.
    Example:
    SmartSnippetsToolbox.exe -chip DA1469x-00 -make_image -in_file files\prox_reporter.bin -out_file files\prox_reporter.out.bin  -generate_priv_key -generate_sym_key

Table 6 provides a description for above options.

30.4. CLI options table

Table 6 CLI option description
Option Description
-chip chip_version The version of the chip. Acceptable values are DA14580-01, DA14581-00, DA14583-01, DA14585-00, DA14586-00, DA14530, DA14531, DA14680-01, DA14681-01, DA14682-00, DA14683-00 and DA1469x-00. Available values differ depending on the selected SDK.
-bundle commands_file File that contains the bundle of commands to execute.
-sdk sdk_path Path to an SDK. Only devices and resources from the specified SDK are used. If the configuration xml of the SDK is invalid, the bundled support package matching the SDK’s family is used. When option is omitted, the bundled support package for the specified family is used.
-type cli_type

Specifies the memory or tool to be used. Available options are:

  • booter - Download an application to the chip RAM,
  • spi - Access SPI memory
  • eeprom - Access EEPROM
  • otp - Access OTP memory
  • qspi - Access QSPI memory
  • power - Power profile tool
  • suota - SUOTA tool
  • spota - SPOTA tool
  • battery_life - Battery Lifetime Estimator
-jtag jtag_serialNumber Use the jtag interface for communication with the chip. This option is mutually exclusive with the -com_port option.
-com_port portNumber Windows: an integer number indicating the UART COM Port. For example -com_port 3 for port COM3. Linux: the port as String, For example -com_port /dev/ttyS0
-sys_ctrl_reg b1

Used only on JTAG communication. Byte value to write at System Control Register, e.g. A4 or 0xA4. Default values per family are:

  • DA14580/581/583: 0xA4
  • DA14585/6: 0xA6
  • DA1453x: 0x02
-gp_ctrl_reg b2 Used only on JTAG communication. Byte value to write at General Purpose Control Register, e.g. E2 or 0xe2. Default value are 0x2E for DA14580/581/583. Not applicable for DA14585/6 and DA1453x
-close Close J-Link GDB Server after firmware download.
-gpio pinId Only for DA14580/581/583. The GPIO pin which controls the transistor enabling high voltage. Format: Pi_j, where P is character ‘P’, i is an integer between 0 and 3 and j is an integer between 0 and 7. E.g.: P1_2. Default value is P1_2
-uart TxId

Only for COM port communication. The Tx part of the UART port Tx-Rx Pair connecting FTDI chip with the Bluetooth chip.

Available values per family are:

  • DA14580/581/583: P0_0, P0_2, P0_4, P0_6
  • DA14585/6: P0_0, P0_2, P0_4, P0_6
  • DA1453x: P0_0, P0_3, P0_5
  • Available values differ depending on the selected SDK.
  • Default values per family are:
  • DA14580/581/583: P0_4
  • DA14585/6: P0_4
  • DA1453x: P0_0
-file filename Input or output filename. For write commands it is an input bin or hex file, containing the data to be burned to the chip. For read commands it is an output text, hex or bin file, where data should be stored.
-y Accept default values. Do not ask user.
-nomessages messageFilter Disables a message category. messageFilter is a string combined of ‘1’ and ‘0’. The message categories are INFO, WARNING, ERROR, ACTION and ARGUMENT_PARSING. 00111 disables INFO and WARNING messages. 00111 is equal to 00, since by default all message categories are enabled.
-baudrate rate

Specifies the data transfer rate through UART in bps. Available baudrates are: 57600, 9600, 115200. Default baudrates per family are:

  • DA14580/581/583: 57600
  • DA14585/6: 57600
  • DA1453x: 115200
-firmware firmware_file Firmware file that should be download to the chip before executing the command. Common values for DA14580/581/583, DA14585/6 and DA1453x is flash_programmer.bin or jtag_programmer.bin, depending on communication interface. Common values for DA1468x and DA1469x family chips is uartboot.bin Except the power measurement commands (-type power) where a custom firmware should be loaded.
-cmd command

Available commands and types are:

  • read_custom_code- Read OTP. Use with -type otp
  • read_header - Read OTP Header. Use with -type otp
  • read_nvds - Read NVDS. Use with -type otp
  • write_custom_code - Write OTP. Use with -type otp
  • write_header - Write OTP header. Use with -type otp
  • write_nvds - Write NVDS. Use with -type otp
  • write_field - Write Address. Use with -type otp or spi or eeprom or qspi
  • capture_data - Power Profiler tool. Use with -type power
  • export_stats - Power Profiler tool. Use with -type power
  • read - Read memory. Use with -type spi or eeprom or qspi
  • write - Write memory. Use with -type spi or eeprom or qspi
  • erase - Erase memory. Use with -type spi or eeprom or qspi
  • write_nv - Write NVPARAMS block. Use with -type qspi
  • read_nv - Read NVPARAMS block. Use with -type qspi
  • read_part_table - Read partition table. Use with -type qspi
  • read_partition - Read specific partition. Use with -type qspi
  • write_partition - Write specific partition. Use with -type qspi
  • erase_partition - Erase specific partition. Use with -type qspi
-writeReadOnlyOTPHeaderFields This applies to DA14585/6, DA1469x and DA1468x OTP Header and OTP NVDS for addresses denoted as Read Only (icon yellow-mark-header). By default RO addresses are replaced with empty value and only the rest of the space is written. When this option is present these addresses can be written, if not already written
-offset ofst The offset in memory, from which read or write operation should start. If ‘ofst’ starts with ‘0x’ it is parsed as hex, otherwise as decimal. Default value is 0x0
-length byteLength

The length in bytes to read from OTP, SPI, QSPI, QSPI partition or EEPROM memory. If ‘length’ starts with ‘0x’ it is parsed as hex, otherwise as decimal. If not set by the user default values are:

  • Read from OTP: OTP size
  • Read from SPI/EEPROM/QSPI: 0x8000
  • QSPI Partition (used with -cmd read_partition): Partition size
-data dataInHex Data in hex with no spaces to write in OTP, SPI Flash, EEPROM or QSPI E.g. 011234DE.
-nvds_address_offset nvdsAddrOfs The starting offset of NVDS inside OTP memory, with respect to 0x40000. If ‘nvdsAddrOfst’ starts with ‘0x’ it is parsed as hex, otherwise as decimal. If -nvds_address_offset option has been specified, write_field command will write the input data at OTP NVDS.
-duration durationInmSecs Duration of data capturing (integer number of milliseconds). Used in ‘capture_data’ Power Profiler command.
-duration durationInSecs Duration of data capturing (integer number of seconds). Used in ‘export_stats’ Power Profiler command.
-time_offset time_offset Pre-trigger sampling period (double number of milliseconds).
-threshold threshold Threshold for considering active (in mA). If set, measured values are collected, exported and aggregated as statistics only if their value is >= threshold.
-zero_samples_for_sw_cursor samples Integer value representing the number of zero samples that mark a SW cursor.
-sw_cursor_tolerance tolerance Decimal value (in uA) representing the upper threshold under which samples are considered to be equal to zero. Related to S/W cursors.
-sw_cursors_to_stop cursors_to_stop Integer value representing the number of SW cursors to trigger a stop event for data capturing.
-data_file data_filename Filename of .csv file with collected measurements
-stat_file stat_filename Filename of .csv file with collected statistics (e.g. peak current, avg current, charge)
-sampling_interval interval An integer number > 0 indicating the number of seconds between the statistic samples
-clk clk

Specifies the CLK pin configuration for SPI Flash memory. Available values: [P0_0:P0_7], [P1_0:P1_3], [P2_0:P2_9], [P3_0:P3_7]

Default values are:

  • DA14580/581/583: P2_0 for DA14583-01, P0_0 other
  • DA14585/6: P2_0 for DA14586-00, P0_0 for DA14585-00
  • DA1453x: P0_4
-cs cs

Specifies the CS pin configuration for SPI Flash memory. Available values:[P0_0:P0_7], [P1_0:P1_3], [P2_0:P2_9], [P3_0:P3_7]

Default values are:

  • DA14580/581/583: P2_3 for DA14583-01, P0_3 other
  • DA14585/6: P2_3 for DA14586-00, P0_3 for DA14585-00
  • DA1453x: P0_1
-miso miso

Specifies the MISO pin configuration for SPI Flash memory. Available values: [P0_0:P0_7], [P1_0:P1_3], [P2_0:P2_9], [P3_0:P3_7]

Default values are:

  • DA14580/581/583: P2_4 for DA14583-01, P0_5 other
  • DA14585/6: P2_4 for DA14586-00, P0_5 for DA14585-00
  • DA1453x: P0_3
-mosi mosi:

Specifies the MOSI pin configuration for SPI Flash memory. Available values: [P0_0:P0_7], [P1_0:P1_3], [P2_0:P2_9], [P3_0:P3_7]

Default values are:

  • DA14580/581/583: P2_9 for DA14583-01, P0_6 other
  • DA14585/6: P2_9 for DA14586-00, P0_6 for DA14585-00
  • DA1453x: P0_0
-max size Specifies the size of SPI, EEPROM or QSPI memory. If ‘size’ starts with 0x, it will be parsed as hex number, otherwise as decimal. Default values are 0x200000 for DA1468x, 0x2000000 for DA1469x, 0x20000 for DA14580/581/583 and 0x40000 for DA14585/6
-verify If enabled, SPI Flash or EEPROM memory contents will be verified, after write or erase action. Also verify QSPI contents after erase and partition contents after write and erase.
-bootable If specified, appropriate header is added to image file in order to make SPI Flash or EEPROM memory bootable. By default image is not bootable.
-sectors num Integer number that specifies the number of sectors to be erased from SPI/QSPI Flash memory. If ‘num’ starts with ‘0x’ it is parsed as hex, otherwise as decimal. Sector size is 4KB. This option is mutually exclusive with the -end option.
-end address Specifies where the region to be erased ends.The sector containing end address is the last sector to be erased. This option is mutually exclusive with the -sectors option.
-scl scl

Specifies the SCL pin configuration for I2C EEPROM memory.

Available values: [P0_0:P0_7], [P1_0:P1_3], [P2_0:P2_9], [P3_0:P3_7]

Default values are:

  • DA14580/581/583: P0_2
  • DA14585/6: P0_2
  • DA1453x: P0_3
-sda sda

Specifies the SDA pin configuration for I2C EEPROM memory. Available values: [P0_0:P0_7], [P1_0:P1_3], [P2_0:P2_9], [P3_0:P3_7]

  • Default values are:
  • DA14580/581/583: P0_3
  • DA14585/6: P0_3
  • DA1453x: P0_4
-bit_value val Value to write to every bit of EEPROM memory during erase. Acceptable values are 0 or 0x00 and 1 or 0x01.
-initiator portNumber The COM port number, in decimal, where the suota/spota initiator is connected. E.g. -initiator 28
-receiver ble_addr The Bluetooth address of the SUOTA/SPOTA receiver. E.g. -receiver 78:56:34:12:CD:AB
-memtype memoryType Acceptable values: I2C (or i2c), SPI (or spi) for SUOTA. For SPOTA two extra values are accepted: SYSRAM (or sysram) and RETRAM (or retram). Default value is SPI
-bank bank_num Specifies where and which image file will be loaded. It accepts only 3 values: 0, 1 or 2. Default value is 0
-i2c_addr addr Specifies the I2C device address used on SPOTA and SUOTA tools. Default value is 0x50
-block_size b_size Specifies the size of each block that will be transmitted, in bytes. Cannot be less than 20. Default value is 240
-sck sck Specifies the SCK pin configuration for SPI Flash memory in SUOTA/SPOTA. Available values: [P0_0:P0_7], [P1_0:P1_3], [P2_0:P2_9], [P3_0:P3_7] Default value: DA14580/581: P0_0. Not available for other families.
-base_addr addr Specifies the base memory address used in SPOTA tool. Default value is 0x0
-input input_file Text file containing input values to be used in the battery lifetime calculations. Each input value is related with a specific id. A sample input file can be found at Appendix.
-params params_file Text file containing values for parameters that are used in the battery lifetime calculations. Each parameter value is related with a specific id. If omitted, parameters are initialized with default values. A sample parameters’ file can be found at Appendix.
-mode cached Adds a suitable header to the file before burn in order to make qspi bootable in cached mode. By default no header added. This option is applicable for DA1468x only.
-index partition_index Index of a specific partition in partition table. Starts from 0.
-make_image Generates Da1469x family chip image from input file. Applicable only for DA1469x-00.
-in_file inputFile Input file for the DA1469x family image creation. Hex and bin files are accepted.
-out_file outputImg File where the DA1469x family image will be saved. Bin file is expected. If omitted a new file with the _image.bin suffix is created in the same folder as the input file.
-priv_key Private key which will be used in Ed25519 to create the image signature. It must have 32 bytes in length. The key is expected in hex format, e.g. -priv_key 8E05FA7509F4D3B8F96B08DEFAA204A9BCEFF67AD28306B6D4A2DBAB3C238DCA
-generate_priv_key Instead of providing the private key with the -priv_key option, the key can be automatically generated. Its length will be 32 bytes.
-pub_key_index Index of the key which should be used for signature validation. A number in decimal or hex format (starting with 0x) is expected. If omitted index=0 is assumed.
-sym_key Symmetric key which will be used in executable encryption (AES CTR mode). It must have 32 bytes in length. The key is expected in hex format, e.g. -sym_key 7CAE0D855049BF06FCBCE2F274CAB39EAFF53AF9F818F171311EBD764FE95ACB.
-generate_sym_key Instead of providing the symmetric key with the -sym_key option, the key can be automatically generated. Its length will be 32 bytes.
-sym_key_index Index of the key which should be used for executable decryption by bootloader. A number in decimal or hex format (starting with 0x) is expected. If omitted index = 0 is assumed.
-nonce String in hex format with length of 8 bytes which will be used as ‘NONCE’ in AES CTR encryption of the executable. If omitted a random nonce will be generated.
-rev Decryption keys revocation command: Contains type and indices of the keys in AES CTR encryption of the executable which should be revoked. If more than one key is passed, parameter should be given in quotation marks. If index is preceded with ‘s’ then it concerns user data symmetric key. If index is preceded with ‘d’ then it concerns executable decryption symmetric key. Index without prefix concerns public key. Examples: -rev “1 2 s1 d2”, -rev d1