/
Updating Torizon OS on i.MX 8MP Target from the Torizon Cloud

Updating Torizon OS on i.MX 8MP Target from the Torizon Cloud

1. Overview

This page describes basic principles of using the Torizion Cloud with an i.MX 8MPlus NAVQ+ board running Torizon OS:

  • How to provision the device to the Cloud;

  • How to customize the Yocto project to automatically push the update packages to the Cloud on rebuild;

  • How to install the update packages to the device.

1.1. Reference Documentation

For detailed information, please refer to the official Toradex documentation for the Torizon Cloud:

https://developer.toradex.com/torizon/torizon-platform/

1.2. Pre-requisites

To interact with the Torizon Cloud, the following pre-requirements must be met:

2. Provisioning the i.MX 8MPlus NAVQ+ board to the Cloud

Perform the following steps:

  1. Login to the Torizon Cloud. Activate the Recent Devices menu and click + PROVISION DEVICE.

  2. Copy the command from the pop-up window.

  3. Go to the console of the i.MX 8MPlus NAVQ+ board with Torizon OS booted up on the target, paste and execute the copied command:

    torizon@imx8mp-navqp-1f1a48008ba6d944:~$ curl -fsSL https://app.torizon.io/statics/scripts/provision-device.sh | sudo bash -s -- -t eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJzYUowczhvMjY4WTdRSzA5R0dmOXJLLVNhS3RMTWNLMkhYcGlqN2pWSm5ZIn0.eyJleHAiOjE3NDEzMzI2ODIsImlhdCI6MTc0MTMzMjM4MiwianRpIjoiNDc1NDM5OWEtZDYzMi00NDk1LTlmMzEtMjgzMGJmNjMyNGVjIiwiaXNzIjoiaHR0cHM6Ly9rYy50b3Jpem9uLmlvL2F1dGgvcmVhbG1zL290YS11c2VycyIsImF1ZCI6InByb3Zpc2lvbi1kZXZpY2UiLCJzdWIiOiI5MTgwZjI4Mi1lZTQ4LTRkZWEtYTdhNy1kZTlmZmQ4MWQ0NzciLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJwcm92aXNpb24tZGV2aWNlIiwic2Vzc2lvbl9zdGF0ZSI6ImM5YjFmMTk3LWI4MmEtNDRmNi1hMTU2LTM1YTZkNjRhNDQzMyIsImFsbG93ZWQtb3JpZ2lucyI6WyJodHRwczovL2FwcC50b3Jpem9uLmlvIiwiaHR0cHM6Ly9hcHAtdjIudG9yaXpvbi5pbyJdLCJzY29wZSI6InByb2ZpbGUgZW1haWwiLCJzaWQiOiJjOWIxZjE5Ny1iODJhLTQ0ZjYtYTE1Ni0zNWE2ZDY0YTQ0MzMiLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsIm5hbWVzcGFjZSI6IjU3NDUwZGE1LTVkOGQtNGM3NS1hYzM1LTcxODNjNjQ4YjkxNCIsIm5hbWUiOiJWbGFkaW1pciIsInByZWZlcnJlZF91c2VybmFtZSI6InZza3ZvcnRzb3ZAZW1jcmFmdC5jb20iLCJnaXZlbl9uYW1lIjoiVmxhZGltaXIiLCJlbWFpbCI6InZza3ZvcnRzb3ZAZW1jcmFmdC5jb20iLCJ0em5fc2NvcGVzIjpbImNyZWF0ZTpkZXZpY2VzIl19.APMrKeUrxXsBLpcgmGOohBkbo140kaz8Ih2iup54TAz8ShVzvlecFmN8FE-r-kaWm-uiBZoIDv3O0fFSaRGtpycZobwFs5IrbRmLDy6w0m08mtmRPDndMAqWNnq69z0f20vZOOyZSRXmbNeqewEh_PL3DjC3PF7AT3jdMDIKoThhvwIGnKnM-B8VKLiIdzP_i991E8usA7shUwspoALIE7OjCDoG1srhgWMfOBeg1zH7DnCM78QlWOfnE6L3AkfePS227bt6V4ozi94B2gbxs_KVea4wV-0CprQr1kJcZ6mbI53KAcfJ7PrWAw_EWfQjCVmyGBpeS7tAZ18jdR5RYA We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. For security reasons, the password you type will not be visible. Password: Checking dependencies... == Registering device (deviceID: imx8mp-navqp-1f1a48008ba6d944) in system, and downloading credentials. == Backing up any existing ota device creds jq: error: Could not open file /var/sota/import/info.json: No such file or directory jq: error: Could not open file /var/sota/import/info.json: No such file or directory == Extracing device credentials from archive Archive: device.zip inflating: client.pem inflating: pkey.pem inflating: root.crt inflating: info.json inflating: gateway.url == Success! Device has been registered with the system and credentials are in place! { "registeredName": "Twin-Pizza", "deviceID": "imx8mp-navqp-1f1a48008ba6d944-4f9181", "deviceUuid": "4f918130-4b6a-4eaa-a4ed-68bf2d07f3ec", "createdAt": "2025-03-07T07:30:13Z", "groups": [] } == Restarting services... Restarting aktualizr... Restarting fluent-bit... Removing RAC files... Aktualizr should automatically connect with the server. For logs run: sudo journalctl -f -u aktualizr* torizon@imx8mp-navqp-1f1a48008ba6d944:~$
  4. Go back to the Torizon Cloud, close the popup window with the provisioning command, then click the REFRESH button. Verify the the device has appeared in the device list.

3. Downloading Credentials

The TorizonOS build procedure supports automatic upload of the update packages to the Torizon Cloud after a new build. For this the account credentials need to to be set up on the build host.

Perform the following steps:

  1. Login to the Torizon Cloud, then click MY ACCOUNT , then DOWNLOAD CREDENTIALS and save the credentials.zip archive to the directory with the Yocto setup.

4. Customizing Yocto

Perform the following steps:

  1. In the Yocto build repository, edit the conf/local.conf file and define the SOTA_PACKED_CREDENTIALS option to enable automatic pushing of the update packages to the Cloud (make sure to use the correct path to the credentials.zip archive downloaded in the step above):

    SOTA_PACKED_CREDENTIALS = "/workdir/credentials.zip"
  2. Make some changes in the projects recipes, for example add minicom to the file system image, by adding it toCORE_IMAGE_BASE_INSTALL:append in the layers/meta-toradex-torizon/recipes-images/images/torizon-base.inc file:

    CORE_IMAGE_BASE_INSTALL:append = " \ ... zram \ minicom \ "
  3. Rebuild the project in the console with activated Yocto environment:

    $$ bitbake torizon-docker
  4. When the build has completed, go to the Torizon Cloud, select the Packages menu https://app.torizon.io/#/packages , click REFRESH. The new package must appear if the My Uploads checkbox is enabled.

5. Installing Update

Perform the following steps:

  1. On the target board, run sudo journalctl -f -u aktualizr* to view events from the OTA service.

  2. In the Torizon Cloud, select the package to install, click INSTALL THIS VERSION. In the pop-up window select the board, click CONFIRM SELECTTIONand then SUBMIT.

  3. Go to the i.MX 8MPlus NAVQ+ serial console, verify that aktualizr has received a query for update and then successfully downloaded and installed the update package:

    Current versions in storage and reported by OSTree do not match Current version for ECU ID: 8ce383173234f17547fb8589c0ff196f07960c25e0b17664584a04df47a18919 is unknown New updates found in Director metadata. Checking Image repo metadata... 1 new update found in both Director and Image repo metadata. Event: UpdateCheckComplete, Result - Updates available Current version for ECU ID: 8ce383173234f17547fb8589c0ff196f07960c25e0b17664584a04df47a18919 is unknown ostree-pull: Receiving metadata objects: 1 outstanding: 1 Event: DownloadProgressReport, Progress at 0% ostree-pull: Receiving metadata objects: 4 outstanding: 4 Event: DownloadProgressReport, Progress at 0% ostree-pull: Receiving metadata objects: 8 outstanding: 2 Event: DownloadProgressReport, Progress at 0% ostree-pull: Receiving objects: 84% Event: DownloadProgressReport, Progress at 84% libostree pull from 'aktualizr-remote' for 0 refs complete security: GPG: disabled security: SIGN: disabled http: CA-pinned non-delta: meta: 13 content: 30 transfer: secs: 6 size: 475.4 kB ostree-pull: 13 metadata, 30 content objects fetched; 464 KiB transferred in 6 seconds; 910.2 kB content written Event: DownloadTargetComplete, Result - Success Event: AllDownloadsComplete, Result - Success Current version for ECU ID: 8ce383173234f17547fb8589c0ff196f07960c25e0b17664584a04df47a18919 is unknown Event: InstallStarted Cannot initialize environment Failed resetting bootcount Cannot initialize environment Failed setting upgrade_available for u-boot Cannot initialize environment Failed resetting rollback flag Installing package using ostree package manager Commit metadata kargs=earlyprintk earlycon console=ttymxc1,115200 Copying /etc changes: 3 modified, 2 removed, 17 added Starting syncfs() for system root Completed syncfs() for system root in 777 ms Starting freeze/thaw cycle for system root Completed freeze/thaw cycle for system root in 62 ms Transaction complete; bootconfig swap: yes; bootversion: boot.0.1, deployment count change: 1 Broadcast message from root@localhost: The system will reboot now!
  4. Note that the actual start of the update on the target board can be delayed up to 5 minutes after it was submitted from the Cloud. This is default setting for polling the server by aktualizr .

  5. After that update has finished and the board has automatically rebooted, verify that update has been actually applied and the minicom utility is available on the target:

    torizon@imx8mp-navqp-1f1a48008ba6d944:~$ minicom --version minicom version 2.9 (compiled Jan 1 1970) Copyright (C) Miquel van Smoorenburg. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.