Host GAP CLI

Warning

The development of the host GAP CLI is still in progress. Some features may not work yet. For the same reason, there is no example yet, only a test is available if you want to do some tests, and/or get familiar with it.

The host GAP CLI provides a graphical interface to send commands easily to the GAP CLI runtime code, that aims to handle some pre-configured commands, such as flashing or SSBL related stuff for instance. See the GAP CLI Protocol for more details.

It runs on a host, usually a computer, and is connected to GAP through UART. Using it requires a USB-UART converter then.

In addition of all the features described below, host GAP CLI can also be used to print GAP’s logs. See Console IO for more details.

Usage

Hardware setup

UART flow control is optional. Make the useful connections depending on it, between a GAP UART interface and the USB-UART converter. Connect the other part of the converter to an USB port of your PC, or any other host you may use.

Default UART pads in example is:

UART0:

#define PAD_UART_RX ( PI_PAD_067 ) // CN2 Pin 6 #define PAD_UART_TX ( PI_PAD_041 ) // CN3 Pin 8 #define PAD_UART_RTS ( PI_PAD_042 ) // CN4 Pin 10 #define PAD_UART_CTS ( PI_PAD_034 ) // CN2 Pin 4

UART1

#define PAD_UART_RX ( PI_PAD_044 ) // MIKROE RX #define PAD_UART_TX ( PI_PAD_045 ) // MIKROE TX #define PAD_UART_RTS ( PI_PAD_040 ) // MIKROE SDA #define PAD_UART_CTS ( PI_PAD_034 ) // MIKROE CS

If you want to use other pads, please change the pad configs in utils/gap_cli/include/uart_cli_phy.h

Launching software

As mentioned in the presentation, the host GAP CLI is running on an host, and a runtime GAP CLI code is executed on GAP.

  1. Setup

Please open two terminals, and source and build the SDK on both of them, with the option WITH_GUI_TOOLS=1. Please check the Getting Started section if any question how to do so.

  1. Launching the runtime GAP CLI on GAP

Note

Source files are in the ~/gap_sdk/utils/gap_cli/ folder for the GAP CLI feature, and there is a tests folder for tests. Please go in this tests folder.

Note

Please find the default configuration in the sdk.config file. You can change it if needed, depending your hardware setup and needs. You can change it through the CMake menuconfig target too.

In the second terminal, (on the tests folder) run the following commands:

cmake -B build
cmake --build build -t run
  1. Launching the host GAP CLI on host

Note

Source files are in ~/gap_sdk/utils/host_gap_cli/clisender/ folder.

On the SDK top level folder, run the following commands:

cmake --build build -t install # Create and install the executable
clisender                      # Launch the application

Features

  • Check GAP CLI status

  • Flashing a binary file

    • On MRAM

    • On OctoSPI (not working yet)

  • SSBL / OTA

    • On MRAM

    • On OctoSPI (not working yet)

    • Open

    • Update a partition

      • Simple or full update

      • With or without encryption

    • Close

  • Load key

  • Secure CLI

  • Enable JTAG

  • Set power parameters

    • Frequencies

    • Voltage (only on board for now)

  • Control sleep modes

    • Deep sleep

      • Wake up from RTC

      • Wake up from GPIO (only on board)

      • Wake up from UART (only on board for now)

    • Deep sleep retentive

      • Wake up from RTC

      • Wake up from GPIO (only on board)

      • Wake up from UART (only on board for now)

    • Light sleep

      • Wake up from RTC

      • Wake up from GPIO (only on board)

      • Wake up from UART (only on board for now)