mbedhtrun command not found

In this troubleshooting guide we learn how to fix mbedhtrun command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

mbedhtrun: command not found

or when using sudo you get the following error message

sudo: mbedhtrun: command not found

Solutions to mbedhtrun: command not found

How To Fix mbedhtrun: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu mbedhtrun is provided by python3-mbed-host-tests package.

python3-mbed-host-tests is:

The mbed-host-tests module and mbedhtrun and mbedflsh utilities are used during ARM Mbed Enabled device development for:

  • Driving test binary flashing
  • Device reset
  • Test execution

The default binary flashing method is one supported by mbed-enabled devices: a binary file is copied onto the mbed-enabled DUT’s (Device Under Test) mounted drive (MSD). This procedure will automatically flash device with given binary file content.

The default DUT reset method is one supported by mbed-enabled devices: the serial port (CDC) “sendBreak” command resets the target MCU on mbed-enabled platform.

The test execution phase will consist of:

  • Opening connection between host computer and DUT
  • DUT will send to host preamble with test runner information such as:
    • test environment version
    • test timeout
    • preferred host test script (Python script which is used to supervise/instrument test execution)
  • Host will spawn host test script and test execution will be instrumented
  • Exchange data (in most cases text) between host and DUT

This package contains the Python 3 module and mbedhtrun and mbedflsh utilities.

To fix this problem, we can install more using the command below.

sudo apt-get -y install python3-mbed-host-tests

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install python3-mbed-host-tests.

sudo apt -y install python3-mbed-host-tests

Or if you have aptitude installed you can use the following command.

sudo aptitude install python3-mbed-host-tests

Summary

In this tutorial we learn how to fix mbedhtrun command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.