Skip to content

How to Configure

Libtropic can be configured using the Available CMake Options (let's say LT_CFG_OPT) in the following ways:

  1. Via a command line when building the project:
    cmake -DLT_CFG_OPT=value ..
    
  2. Using the CMake GUI. This makes the configuring process more user-friendly compared to the previous way. For more information, refer to the cmake-gui documentation.
  3. In your project's CMakeLists.txt:
    set(LT_CFG_OPT value)
    

Available CMake Options

LT_BUILD_EXAMPLES

  • boolean
  • default value: OFF

Examples will be built as part of the Libtropic library.

LT_BUILD_TESTS

  • boolean
  • default value: OFF

Functional tests will be built as part of the Libtropic library.

LT_SH0_KEYS

  • string
  • default value: "prod0"

Programs, compiled when LT_BUILD_EXAMPLES or LT_BUILD_TESTS are set, depend on the Default Pairing Keys for a Secure Channel Handshake. Keys that will be used in these programs can be changed by setting LT_SH0_KEYS to one of the available values.

See Available Values When Using CMake CLI

Pass -DLT_SH0_KEYS= to cmake, which will invoke an error, but will print the available values.

LT_HELPERS

  • boolean
  • default value: ON

Compile the helper functions.

LT_LOG_LVL

  • string
  • default value: "None"
  • default value if LT_BUILD_EXAMPLES or LT_BUILD_TESTS are set: "Info"

Specifies the log level. See Logging for more information.

LT_USE_INT_PIN

  • boolean
  • default value: OFF

Use TROPIC01's interrupt pin while waiting for TROPIC01's response.

LT_SEPARATE_L3_BUFF

  • boolean
  • default value: OFF

Buffer used for sending and receiving L3 Layer data will be defined by the user. The user then has to pass a pointer to their buffer into the instance of lt_handle_t:

#include "libtropic_common.h"

lt_handle_t handle;
uint8_t user_l3_buffer[LT_SIZE_OF_L3_BUFF] __attribute__((aligned(16)));

handle.l3.buff = user_l3_buffer;
handle.l3.buff_len = sizeof(user_l3_buffer);

LT_PRINT_SPI_DATA

  • boolean
  • default value: OFF

Log SPI communication using printf. Handy to debug low level communication.

LT_SILICON_REV

  • string
  • default value: latest silicon revision available in the current Libtropic release

Silicon version (e.g. "ACAB") of the currently used TROPIC01 has to be set in this option. It is needed for TROPIC01's firmware update and functional tests, as some behavior differs between the TROPIC01 revisions.

What Is the Silicon Revision of My TROPIC01?

Refer to the dedicated section in the FAQ.

Warning

Because the implementation of Libtropic's FW update functions is chosen at compile-time based on LT_SILICON_REV, in one compiled instance of Libtropic, FW update can be done only with TROPIC01 of this silicon revision.

Example

I passed -DLT_SILICON_REV=ACAB to cmake during the build. I will be able to do FW updates with TROPIC01 chips that have silicon revision ACAB only. Updating a TROPIC01 chip with e.g. ABAB silicon revision will not work.

See Available Values When Using CMake CLI

Pass -DLT_SILICON_REV= to cmake, which will invoke an error, but will print the available values.

LT_CPU_FW_UPDATE_DATA_VER

  • string
  • default value: latest FW version available in the current Libtropic release

Defines the TROPIC01's RISC-V CPU FW version (e.g. "1_0_1") to update to. It is used for compiling the correct FW update files for both the RISC-V CPU and SPECT. Available versions can be seen in the compatibility table in the repository's main README.md.

See Available Values When Using CMake CLI

Pass -DLT_CPU_FW_VERSION= to cmake, which will invoke an error, but will print the available values.

See Current Configuration

Use cmake -LAH | grep -B 1 LT_ to check current value of all Libtropic options.