7. Software update and recovery
This section covers how to restore firmware settings, update the firmware components, perform factory reset and update the operating system.
7.1 Restore firmware settings
CCSettingsConsole can be used to reset the firmware settings to the factory default settings, if needed. Use the following command:
$ sudo ccsettingsconsole --advanced --factory
7.2 Updating firmware components
The advanced category of CCSettingsConsole is also used for loading new SS firmware and Display MCU firmware into the device.
It is also possible to verify that a given file matches the current firmware; with “–verify” a mismatch can be detected and reported. The firmware is not written during verify.
After each program or verify action, the device must be shut down. Press the shutdown button or other alternatives to shut down the OS after a firmware update.
The preferred method to perform the update is by using the CCSettingsConsole application. It is also possible to use the API directly from your own program using the CCAux API functions.
Warning
Errors during an update of firmware components can set the module in an unrecoverable state. In such case, the module must be shipped to factory for repair, or have internal parts replaced through service interfaces. Make sure that you carefully choose the correct files for updating and follow the instructions from the tools, including powering off the device when prompted.
To update the firmware, copy the firmware file to a USB stick and connect it to the device. Login and issue the following commands to update:
7.2.1 SS firmware
$ sudo ccsettingsconsole --advanced --update=SS --filepath=<full-path-to-file>
If only firmware verification is wanted, use the following command instead:
$ sudo ccsettingsconsole --advanced --verify=SS --filepath=<full-path-to-file>
7.2.2 Display MCU firmware
Login and issue the following command to update the Display MCU:
$ sudo ccsettingsconsole --advanced --update=Display --filepath=<full-path-to-file>
If only firmware verification is wanted, use the following command instead:
$ sudo ccsettingsconsole --advanced --verify=Display --filepath=<full-path-to-file>
X1200 |
V700 |
V1x00 |
Vx10 |
Yukon |
---|---|---|---|---|
No |
No |
Yes |
Yes |
Yes |
7.3 Factory reset of operating system
As explained in the introduction, the user data or configuration files are stored on the /etc read-only folder of root filesystem, which is overlayed to /data/cc-etc of read-write filesystem. It is possible to remove all the settings and files under that location, and have the device generate the default contents back upon a restart of the device after the factory reset.
The factoy reset is done via the command
$ sudo ccsettingsconsole --advanced --factory_reset
Note
The user has to manually reboot the device after the above command is executed.
Aftet the reboot of the device, the default user settings and files will be restored.
7.4 Updating the operating system
The CC Linux system on the device can be updated by a robust software update mechanism called RAUC, which is a major feature on the CC Linux 4.0 as explained in the introduction. Please refer CCLinux-RaucGuide [2] to have more insights above RAUC software update mechanism, how the RAUC update works and how to update the software using RAUC.
Consider the device is booted up with root filesystem A, and RAUC will check the inactive root filesystem (which in this example is root filesystem B) and the update will be performed on the inactive root filesystem. On system reboot, after a successful update, the device will boot up with root filesystem B where the update image is installed.
Warning
Errors during an update can set the module in an unrecoverable state. In such case, the module must then be shipped to our factory for repair, or have internal parts replaced through service partners.
The complete system consists of six partitions in the eMMC/CFast:
CC Linux 4.0
+-------------------+
| Boot | --> bootloader
+-------------------+
| RootFs A | --> kernel + root filesystem A
+-------------------+
| RootFs B | --> kernel + root filesystem B
+-------------------+
| AppFs A | --> applications filesystem A
+-------------------+
| AppFs B | --> applications filesystem B
+-------------------+
| Data | --> user data filesystem
+-------------------+
All the partitions except the data partition can be updated. Normally, software updates are for the kernel, root filesystem and application filesystem, though they may occasionally concern the other partitions, for example the bootloader.
The software update can be done as a combination of partitions:
OS update (bootloader + Root filesystem(with Kernel))
System update (bootloader + Root filesystem(with Kernel) + application filesystem)
or individual partitions:
Bootloader update
Root Filesystem (with Kernel) update
Application Filesystem update
Note
If only the application filesystem has to be updated, it is recommended to do a System update.
New versions of the operating system are released as Rauc bundles with extension .raucb. File names will differ depending on which parts are being updated. Additionally, file names will vary depending on the device model.
In the following sections, an example CCpilot V700 device model is used to illustrate the process.
Warning
For updating the operating system to CC Linux 4.0 from the the previous versions of CC Linux, the only way to update the system is by using UUU approach described in CCLinux–SystemUpdateUsingUuu (not available for X1200).
7.4.1 Automatic update of the operating system
This section shows how the software update is done automatically via USB. For the automatic update, the Crosscontrol binary cc-update shipped with the CC Linux 4.0 operating system will be used.
When the update image (CCpilot-V700-x.x.x.x-os-update-bundle.raucb) is ready, copy the update image to the root folder of the USB memory.
Warning
Make sure not to have more than one update rauc bundle in the root folder of the USB memory
Insert to USB to the device after the update bundle is copied to the USB.
The USB will be automounted on the CC Linux operating system.
The update of the operating system using cc-update binary will begin soon after the automounting of USB, without requiring any user interaction to complete. The start of the update can be confirmed by the short beep and the led will start blinking Yellow until the update is finished.
On successful update of the device, the led will be turned Green and a long beep for 2seconds will be heared. If the update is unsuccessful, then the led will be turned Red for 5 seconds without any beeps and then turned Green for the system to be updated again.
After successful update, the device will be rebooted automatically by the cc-update binary.
Note
Make sure to remove the USB from the device soon after the system is updated.
Verify the system is booted up with the updated image after the reboot.
7.4.2 Manual update of the operating system
This update method requires the device is booted into either root filesystem A or B and you are logged in to device with the ccs user.
When the OS update image bundle (CCpilot-V700-x.x.x.x-os-update-bundle.raucb) is ready, copy the update image from the host system to the read-write data partition of the device, using scp:
$ scp CCpilot-V700-x.x.x.x-os-update-bundle.raucb ccs@xxxx:
Warning
Make sure you have enough space in the user data partition to copy the OS update image.
Once the update image is copied to the device, The update of the operating system can be started and installed manually using cc-update binary:
$ sudo cc-update install CCpilot-V700-x.x.x.x-os-update-bundle.raucb
Soon after the start of the update a short beep will be heared and the led will start blinking Yellow until the update is finished.
On successful update of the device, the led will be turned Green and a long beep for 2seconds will be heared. If the update is unsuccessful, then the led will be turned Red for 5 seconds without any beeps and then turned Green for the system to be updated again.
After successful update, the device will be rebooted automatically by the cc-update binary.
Verify the system is booted up with the updated image after the reboot.
Warning
Either by automatic software update or by manual software update, If the software in the device and the software to be updated are the same, then the update will be not be performed and will simply fail. So, Make sure the software to be updated is different from the software in the device.
7.4.3 Update logs
On both automatic and manual update of the operating system, the update logs will be stored in /data/rauc/install.log.
The content of the install.log file will look like:
$ sudo cat /data/rauc/install.log
2024-11-20T09:30:20Z: Installation b320d1e8 started
2024-11-20T09:30:20Z: Updating slot rootfs.1
2024-11-20T09:30:28Z: Installation b320d1e8 successful