On this page Request the right SDKProvision each deviceAdd the SDK to your FreeRTOS projectStore the phone pairingEnable product features
SDK / FreeRTOS

SDK & device setup

Get the matching package and provision device licenses.

The target must run FreeRTOS. Chips and boards are not tied to one vendor. This chapter covers selecting a compatible SDK and provisioning device licenses.

Request the right SDK

Send the following to the integration team. If you do not know the architecture or compiler settings, start with the board and toolchain names.

Information Example
Chip and operating system Chip model, CPU architecture, FreeRTOS version and configuration
Bluetooth and Wi-Fi Wireless chip, Bluetooth stack, hotspot support
Screen 1024×600, landscape, RGB565
Features Controls; video + HUD on large screens, HUD only on small screens unable to mirror
Resources and vehicle interfaces Available RAM / Flash, CAN or UART

The package contains a static library, public headers, examples and documentation. A static library is precompiled code: it must match your chip, system and build settings. Confirm the package again when changing platforms.

Provision each device

Register the device model and issue a device license in the management console, then write it to dedicated storage during production.

Item Purpose Output from load_license
.motolic License for this specific device 512 original bytes
Hardware ID Matches the license to this device Up to 64 characters followed by \0
Trusted public key Verifies the license signature 65-byte P-256 key beginning with 0x04

Obtain the public key through a trusted channel from the SDK provider. The hardware ID must match the one used at issuance. Store each device’s credentials separately; keep them out of shared firmware images and logs.

Add the SDK to your FreeRTOS project

  1. Add the package’s include directory to your header search path and include moto_freertos/terminal.h.
  2. Link static libraries and dependencies according to the delivery manifest. Match CPU architecture, compiler ABI and FreeRTOS configuration. Use your target package’s library names, link order and compiler options.
  3. Implement the moto_terminal_port callbacks. Initialize storage, secure random generation and the clock, then create and start the SDK from a FreeRTOS application task.
  4. Build and flash with your board’s existing toolchain. Recheck library compatibility after changing the chip, toolchain or key system settings.

See First connection for the startup sequence. Packages match specific platforms; one binary does not run on every board.

Store the phone pairing

The device license identifies the hardware. The pairing record identifies the phone authorized to control it. Store them separately.

Implement read_pairing and write_pairing to preserve the SDK’s bytes unchanged in persistent storage, such as a Flash partition or a platform key-value store.

  • When no record exists, return success with output length 0. Return an error for a damaged record or failed read.
  • Commit the whole write and return 0 only after durable storage succeeds.
  • Initialize storage before creating the SDK. Do not erase pairing records as a response to startup failure.

Also provide random for secure random bytes and now_ms for a thread-safe monotonic millisecond clock. If the target package already supplies an adapter, reuse it according to that package’s instructions.

Keep pairing across ordinary disconnects and restarts. Remove it through the APP’s unpair flow.

Enable product features

The device model’s settings in the console determine which features are available; firmware provides the corresponding drivers. Read enabled_capabilities from moto_terminal_get_status() to see the currently enabled features.

If Bluetooth connects but a feature is unavailable, check the model settings first, then its firmware integration. Return to first connection.