Updating from BSP5 to BSP6 uImage vs. zImage

Hello

I am in the process of upgrading the BSP for my embedded devices. Currently I am able to compile complete images with Yocto BSP 5. My devices in the field use BSP 2.8. Since BSP 5 is now also outdated, I am trying to use BSP 6 directly.

One of my last problems is the format of the Linux kernel. So far, my devices have always used uImage. I was also able to continue this in BSP 5 using KERNEL_IMAGETYPE_forcevariable = ‘uImage’. With BSP 6, however, I get compile errors from linux-toradex-mainline when I enter KERNEL_IMAGETYP:forcevariable = ‘uImage’ in the local.conf.

A complex update mechanism is used in the field. This ensures that the last executable image can be switched to in the event of an error. The use of a different kernel format requires adjustments in the U-Boot during the update, so for me it seems easiest to stay with the uImage format and not switch to the current standard zImage.

Please help me with this problem. How can I compile a uImage with BSP 6? Alternatively, can I patch the U-Boot so that an old uImage is used as a fallback instead of zImage? The following cases are to be covered:

  • New devices
  • Upgrade of existing devices
  • Failed updates
  • Downgrade of old and new devices.

Thank you for your support.

We use apalix imx6 in all hardware variants on different self-developed boards.

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

Thank you for reaching out with your question about upgrading to BSP 6 while maintaining the uImage format for your Apalis iMX6 devices. Let’s explore how you can achieve this.

Compiling uImage with BSP 6

  1. Yocto Configuration Adjustments:

    • BSP 6 defaults to zImage, but you can attempt to compile a uImage by setting the KERNEL_IMAGETYPE in your Yocto configuration. Add the following line to your local.conf:
      KERNEL_IMAGETYPE = "uImage"
      
    • If you encounter errors, it may indicate that BSP 6 does not natively support uImage due to changes in the kernel build process.
  2. Using the mkimage Tool:

    • If direct support is unavailable, you can convert a zImage to uImage using the mkimage tool from U-Boot tools. First, compile the kernel as zImage, then use the following command:
      mkimage -A arm -O linux -T kernel -C none -a 0x80008000 -e 0x80008000 -n "Linux Kernel" -d zImage uImage
      

Modifying U-Boot for Fallback

  1. U-Boot Configuration:

    • Modify U-Boot to support both zImage and uImage. Update the boot script to check for both image types and load the appropriate one.
  2. Testing Across Scenarios:

    • Ensure thorough testing of your modified U-Boot and kernel images for all scenarios: new devices, upgrades, failed updates, and downgrades.

By following these steps, you can maintain compatibility with your existing update mechanism while transitioning to BSP 6. If manual conversion or U-Boot modifications are not feasible, consider the benefits of transitioning fully to zImage for future-proofing your deployment.

I hope this helps you with your upgrade process.

Best regards,
Toradex AI Assistant

Please, also check if these links can help you solve your problem:

Does HAB fall back to a correctly signed boot partition, if current boot partition is wrongly signed?.