Application over J-Link
This article will describe how to flash application firmware in CHESTER using SEGGER J-Link.
Requirements
You will need the following hardware and software tools:
One of these operating systems:
- Ubuntu 20.04 / 22.04
- macOS 11 / 12 (with Homebrew installed)
- Windows 10 / Windows 11
Python 3 distribution installed on your system:
On Ubuntu, run this command in the Terminal app:
sudo apt install python3
On macOS, run this command in the Terminal app:
brew install python3
On Windows, download the latest stable installer from this link.
cautionEnsure the Windows installer can modify the
PATH
variable so the Python executable is available from any location.
HARDWARIO CHESTER device (you will need to open the enclosure top cover with six screws)
USB debugger/programmer SEGGER J-Link (including a 10-pin SWD adapter + flat cable)
tipHARDWARIO provides J-Link + all the required accessories on demand.
Micro-USB cable with appropriate plug type to your computer
dangerSome Micro-USB cables provide only power and no data signals. If the connection between J-Link, and your system does not work, check the cable type in the first place.
Python application bundle HARDWARIO Command Line Tools
Installation
You can install HARDWARIO Command Line Tools with these steps:
On Windows only - Install SEGGER J-Link drivers:
- Download 64-bit Intel/AMD installer
- Download 32-bit Intel/AMD installer
- Download 64-bit ARM installer
Open the Terminal (Ubuntu or macOS) or Command Prompt (Windows) application.
Initialize the Python virtual environment:
python3 -m venv hardwario-venv
Activate the Python virtual environment:
source hardwario-venv/bin/activate
cautionWhen you close the Terminal or Command Prompt, you must reactivate the Python virtual environment. Simply call the command from the above procedure:
source hardwario-venv/bin/activate
.Install HARDWARIO Command Line Tools:
pip install hardwario
You can verify the installation with the following command:
hardwario --version
It should provide output similar to this:
hardwario.chester v1.19.0
hardwario.cloud v1.4.1
hardwario.common v1.7.1
hardwario.hardwario v1.2.0
Flashing Procedure
Before you start, check that you have the application HEX file downloaded to your system; or have the firmware 128-bit unique ID available.
Usually, the firmware application is distributed via the HARDWARIO Cloud and a feature called Shareable Firmware Link from which you can get both the HEX file and the 128-bit unique ID. With the unique ID, you don't have to send any attachments - just provide the identifier, and the tool will download it automatically.
Follow these steps to flash application firmware in the CHESTER device:
Connect the 10-pin flat cable to the connector labeled APP (or
BLE
on hardware revision R3.2 and earlier).Connect the other side of the 10-pin flat cable to SEGGER J-Link adapter board (and plug the adapter board to SEGGER J-Link device).
Connect Micro-USB cable to SEGGER J-Link and your computer.
Open the Terminal (Ubuntu or macOS) or Command Prompt (Windows) application.
Activate the Python virtual environment where you have installed the HARDWARIO Command Line Tools (see the previous chapter).
The next operation depends on the scenario:
If you have an application HEX file, you can flash firmware using this command:
hardwario chester app flash <PATH-TO-APPLICATION-HEX-FILE>
Example:
hardwario chester app flash ~/Downloads/hio-chester-clime-v1.0.0.hex
If you have an application unique ID, you can flash firmware using this command:
hardwario chester app flash <APPLICATION-UNIQUE-ID>
Example:
hardwario chester app flash 071ea903ae29053ee96e0124c3454238
Disconnect the SEGGER J-Link adapter.