Application Debug | Developers

Application Debug

Making testing easier

Estimated reading time: 2 minutes

Introduction

Important
The BOLOS development environment is required for the following article. It applies only for the Nano S, with its SE (Secure Element) firmware either in version 1.5.5 or 1.6.0.

It is possible to install a debugging firmware on the device’s MCU (Microcontroller) that will enable printing text outputs from the device to a terminal. To do so, follow these steps:

  1. Download the updater and the debug firmware and install the Python Loader with pip install ledgerblue.

  2. Exit any instance of Ledger Live or any other program able to communicate with a Ledger device.

  3. Plug your Nano S to your computer while keeping the left button pressed. Keep it pressed until the screen displays BOOTLOADER.

  4. Open a terminal and move to the directory containing the files downloaded at step 1.

  5. Install the updater (only if you MCU firmware is not already in version 1.11, otherwise just go to step 6):

    python3 -m ledgerblue.loadMCU --targetId 0x01000001 --fileName blup_0.11_misc_m1.hex --nocrc
    

    Wait until BOOTLOADER is displayed again on the device’s screen.

  6. Install the debugging firmware:

    python3 -m ledgerblue.loadMCU --targetId 0x01000001 --fileName mcu_1.11-printf_over_0.11.hex --reverse --nocrc
    

If you can notice a small dbg block at the bottom of the screen, it’s a success !

A Nano S with the debugging firmware
A Nano S with the debugging firmware

Uninstalling this debugging firmware is also very easy:

  1. Download the normal firmware.
  2. Repeat the installation from step 2 to 5.
  3. Flash the normal firmware with this command:
     python3 -m ledgerblue.loadMCU --targetId 0x01000001 --fileName mcu_1.11_over_0.11.hex --reverse --nocrc
    

The dbg block should now be gone.

APDU / REPL

https://repl.ledger.tools/

Coverity


Did you find this page helpful?


How would you improve this page for developers?



Mac Users
Speculos emulator
Getting Started
Theme Features
Customization

Embedded Apps