cascoda-sdk-pages

Flashing Guide

For flashing binaries built for embedded targets, or downloaded from the GitHub releases page there are multiple approaches.

  1. Using the chilictl command line application to flash over USB or UART
  2. Using a SEGGER J-Link
  3. Using a Nu-Link Pro

For flashing the Chili 2D with TrustZone (CSME) binaries, please refer to the TrustZone development guide. This guide is only for non-TrustZone binaries.

** Warning: If a device has previously been flashed with a TrustZone binary, it must be fully erased using the Nu-Link Pro and the ICP tool. **

USB and UART Flashing with chilictl

For simple evaluation and reflashing of Chili devices over USB or UART, the chilictl application can be used. This is a command line application, that allows high level control of connected Chili devices, including listing, inspecting, flashing and issuing them commands. More detailed information is available here.

In order to flash a connected Chili, it must have a version of the Cascoda SDK firmware on it of v0.14 or later, with either USB or UART enabled. The new firmware has the same requirement, which is met by every example application that isn’t sleepy.

Chilictl is failsafe, so if anything goes wrong during flashing, simply power cycle the device, and it will reboot into DFU mode where it can be reflashed.

Software requirements:

Hardware requirements:

Procedure

Chilictl is a command line application used for working with Chili devices. A binary can be flashed using the chilictl flash command, with the -f flag specifying the binary file to flash.

# The -s argument is optional, and specifies the specific chili to flash (by serial number)
# Replace the path with your own path to the desired binary
$ ./chilictl.exe flash -s FBC647CDB300A0DA -f "../Chili2D-USB/ot-cli.bin"
2020-12-16 12:56:12.130 NOTE:  Cascoda SDK v0.14 Dec 16 2020
Flasher [FBC647CDB300A0DA]: INIT -> REBOOT
Flasher [FBC647CDB300A0DA]: REBOOT -> ERASE
Flasher [FBC647CDB300A0DA]: ERASE -> FLASH
Flasher [FBC647CDB300A0DA]: FLASH -> VERIFY
Flasher [FBC647CDB300A0DA]: VERIFY -> VALIDATE
Flasher [FBC647CDB300A0DA]: VALIDATE -> COMPLETE

Chili2Ds ship with the USB bootloader pre-installed - in normal operation you will not need to flash the bootloader. However, Chilictl allows you to do so using the -df flag.

$ ./chilictl.exe flash -s FBC647CDB300A0DA -df "../Chili2D-USB/ldrom_hid.bin"
2020-12-16 12:59:46.510 NOTE:  Cascoda SDK v0.14 Dec 16 2020
Flasher [FBC647CDB300A0DA]: INIT -> REBOOT
Flasher [FBC647CDB300A0DA]: REBOOT -> ERASE
Flasher [FBC647CDB300A0DA]: ERASE -> FLASH
Flasher [FBC647CDB300A0DA]: FLASH -> VERIFY
Flasher [FBC647CDB300A0DA]: VERIFY -> VALIDATE
Flasher [FBC647CDB300A0DA]: VALIDATE -> COMPLETE

Note that when using the SEGGER J-Link, it is also possible to flash and debug from GDB.

The SEGGER J-Link in combination with J-Flash Lite can be used to simply flash a device with a given binary.

Software Requirements:

Hardware Requirements:

Procedure

  1. Connect J-Link to Chili2D via debug adapter
  2. Power the Chili2D
  3. Connect the J-Link to the the host PC
  4. Run the SEGGER J-Flash Lite
  5. Set the target device (M2351… For Chili2, NANO120… for Chili1)
  6. Set the target interface to SWD
  7. Click OK

  1. Browse to the desired binary file using the […] button, and then click ‘Program Device’.
  2. Verify that there are no errors in the Log pane

The Nu-Link Pro in combination with the Nuvoton ICP programming tool can be used to flash a device, change chip settings and fully factory erase a device.

Software Requirements:

Hardware Requirements:

Procedure

  1. Connect the Nu-Link Pro to the Chili2D via debug adapter
  2. Do NOT power the Chili2D (It is powered by the Nu-Link Pro)
  3. Start the Nuvoton NuMicro ICP Programming Tool
  4. Select M2351 Series target chip
  5. Click ‘Connect’ to connect to M2351
  6. Click the ‘APROM’ button to browse to the APROM binary file
  7. Ensure that only the ‘APROM’ checkbox is selected
  8. Click ‘Start’ to program the device
  9. Click ‘No’ on the batch programming prompt


Copyright (c) 2021 Cascoda Ltd.