Building a Firmware Package for  Corellium Atlas

Learn how to build and upload custom firmware packages for a variety of supported devices on the Corellium Atlas virtual hardware platform, including Raspberry Pi 4B, i.MX93, and more.
Building a Firmware Package for Corellium Atlas

Corellium Atlas is a virtual hardware platform that enables software developers to cut through the difficulty of writing software on embedded hardware and streamlines the development path. Full end to end automation and validation is possible through APIs, CLI, and shell scripting. This is all possible with a Corellium development kit (CDK), Public or Private cloud offering, or a server that sits in your datacenter. 

Building custom firmware packages 

Most software development today is concerned with the basic level of support for booting an OS on hardware. Today, that scenario and more can actually be completed on Atlas hardware. Not only can the focus be on boot but now on actually executing software on target hardware with no modifications. Simply spinning up the virtual hardware instance and uploading the compiled custom firmware or using a default image and loading software compiled for the target hardware becomes a reality. Below are steps on how to build custom firmware images for some of the supported models of hardware in production. 

Firmware Package Contents 

Below are the required files that must be contained in a flat .zip: 

Info.plist - for the meta information in JSON format about firmware version, type, build, unique identifier, and device identifier. 

nand - with the preinstalled arm64 image file. 

devicetree - hardware components data for the Linux kernel. 

kernel - the Linux kernel file. 

ramdisk.img (optional) - the initrd root file system image. 

Although specifying the ramdisk.img is generally optional, we need to add a reboot command in this case because of how this virtual device handles the first pass. 

Raspberry Pi 4B 

We offer an extensive article with scripts that can essentially be used to build the custom firmware for use on the Atlas hardware.

Custom firmware can manually be built following these steps: 

1. Download the target Raspberry Pi OS or build it through tool of choice 
      • This will generate an .img file that will need to be mounted 
        • Loop mount with Linux: 
2. Take the contents of the .img or .zip file: 
    • Example of contents: 
      • 2022-01-28-raspios-bullseye-arm64.img (image file) 
      • bcm2711-rpi-4-b.dtb 
      • Kernel8.img 
3. Download the source image from a Raspberry Pi 4b instance: 
    • Login to Corellium UI 
    • Create an instance 
    • While creating the instance, download the source image 
    • Click the “source image” button which will download the image 

4. Unzip the contents of the source image from Atlas 

5. Create a directory for your custom firmware, then place the files into the directory from the source image and the Raspberry Pi firmware contents: 

    • 2022-01-28-raspios-bullseye-arm64.img 
    • bcm2711-rpi-4-b.dtb 
    • Kernel8.img 
    • info.plist 
6. Rename the corresponding files to the following: 
    • 2022-01-28-raspios-bullseye-arm64.img > nand 
    • bcm2711-rpi-4-b.dtb > devicetree 
    • Kernel8.img > kernel 
7. The contents of the directory will be this: 
    • nand 
    • devicetree 
    • kernel 
    • Info.plist 

8. Now zip the contents of the folder into a flat .zip 

9. Create a new Raspberry Pi 4b and upload the custom .zip firmware 

    • Login to Corellium UI 
    • Create an instance 
    • Upload the .zip into the “Custom firmware” field 

10. This will now boot custom firmware on a Raspberry Pi 4b 

i.MX93 EVK/i.MX8M Plus 

With the i.MX93 EVK and i.MX8M Plus an engineer can take their software and bring it into a near physical virtualization with speed and performance to match. Take applications and software without making any changes for simulator support and build them for the target hardware then run them in the Atlas environment.  

Custom firmware can manually be built following these steps: 

1. Download the target i.MX93/i.MX8MPLus or build it through tool of choice: 
      • This will provide a .zip that can be decompressed 
2. Take the contents of the .zip file: 
    • Example of contents: 
      • imx8mp-evk-rm67199.dtb 
      • imx8mp-evk-root.dtb 
      • imx8mp-evk.dtb 
      • licenses-fsl-imx-xwayland_imx8mpevk.tar.gz 
      • README.uuu 
      • samples 
      • SBOM-NXP.spdx.json 
      • SCR-6.12.20-2.0.0.txt 
      • uuu.auto 
      • uuu.auto-imx8mp-ddr4-evk 
3. Download the source image from a i.MX93 or i.MX8MPlus instance: 
    • Login to Corellium UI 
    • Create an instance 
    • While creating the instance, download the source image 
    • Click the “source image” button which will download the image 

4. Unzip the contents of the source image from Atlas 

5. Create a directory for your custom firmware, then place the files into the directory from the source image and the i.MX93/i.MX8M Plus firmware contents: 

    • imx-image-full-imx8mpevk.wic/imx-image-full-imx93evk.wic 
    • imx8mp-evk.dtb/imx93-11x11-evk.dtb 
    • Image-imx8mpevk.bin/Image-imx93evk.bin 
    • info.plist 
6. Rename the corresponding files to the following: 
    • imx-image-full-imx8mpevk.wic/imx-image-full-imx93evk.wic > nand 
    • imx8mp-evk.dtb/imx93-11x11-evk.dtb > devicetree 
    • Image-imx8mpevk.bin/Image-imx93evk.bin > kernel 
7. The contents of the directory will be this: 
    • nand 
    • devicetree 
    • kernel 
    • Info.plist 
    • ramdisk.img 
    • volume.json 

8. Now zip the contents of the folder into a flat .zip

9. Create a new i.MX93 or i.MX8M Plus and upload the custom .zip firmware 

    • Login to Corellium UI 
    • Create an instance 
    • Upload the .zip into the “Custom firmware” field 

10. This will now boot custom firmware on a i.MX8M Plus/i.MX93 EVK 

 

STM32 

With the virtualized Atlas STM32U5 b_u585i_iot02a, binaries built in Zephyr and the STM32 CubeMX/CubeIDE can simply and easily be loaded and run. No need to convert or add additional code to support emulators and simulators. Build for the b_u585i_iot02a target and create an instance: 

1. Build a binary using Zephyr or STM32CubeIDE/MX

2. Take the compiled .elf file and upload it to Atlas STM32U5 

    • Login to Corellium UI 
    • Create an instance 
    • Upload the .elf into the “Custom firmware” field 

3. Follow the rest of the prompts and see the software run 

S32K and S32G 

The S32K388 and S32G have been completely virtualized to enable software developers the flexibility to run software easily and quickly without the need to acquire hardware or make customizations to support simulations. Build for the target hardware and run the software: 

    • In MCUXpresso IDE or S32 Design Studio, import or create your S32K or S32G project (e.g. S32K144 EVB) and build. 
    • After build, locate the .elf and, if you prefer, a .bin export.
    • Create a new S32K388 or S32G and upload the custom .zip firmware 
      • Login to Corellium UI 
      • Create an instance 
      • Upload the .elf into the “Custom firmware” field 
    • This will now boot the custom firmware on a S32K388 or S32G  

Cortex-R52/82 

With the virtualized Atlas Cortex-R52/R82, binaries built in Zephyr can simply and easily be loaded and run. No need to convert or add additional code to support emulators and simulators. Build for the target and create an instance: 

  • Build a binary using Zephyr 
  • Take the compiled .elf file and upload it to Atlas Cortex-R52/R82 
    • Login to Corellium UI 
    • Create an instance 
    • Upload the .elf into the “Custom firmware” field 
  • Follow the rest of the prompts and see the software run 

Corstone-1000 

The Corstone-1000 software will come packaged as a .wic which well require decompression and then loopback mounting to be able to retrieve the contents. Once those steps are complete, follow the below steps to build the Atlas firmware package: 

  • Build the image using Yocto or your tool of choice 
  • Loopback mount the .wic to get the contents on the image 
  • Download the source image from Atlas 
    • Login to Corellium UI 
    • Create an instance 
    • While creating the instance, download the source image 
  • Unzip the contents of the source image from Atlas 
  • Create a directory for your custom firmware, then place the files into the directory from the source image and the Corstone-1000 firmware contents: 
    • bl1.bin 
    • es_flashfw.bin 
    • corstone1000-image-corstone1000-mps3.wic 
  • Rename the corresponding files to the following: 
    • bl1.bin > seflash 
    • es_flashfw.bin > flash 
    • corstone1000-image-corstone1000-mps3.wic > sdcard
  • The contents of the directory will be this:
  • efiv 
  • devicetree 
  • kernel 
  • Info.plist 
  • flash 
  • loaderfile 
  • sdcard 
  • sdcard0 
  • seflash
  • Now zip the contents of the folder into a flat .zip 
  • Create a new Corstone-1000 and upload the custom .zip firmware 
  • Login to Corellium UI 
  • Create an instance 
  • Upload the .zip into the “Custom firmware” field 
  • This will now boot custom firmware on a Corstone-1000 

Corstone 310/315/320 

With the virtualized Atlas Corstone 310/315/320, binaries built in Zephyr can simply and easily be loaded and run. No need to convert or add additional code to support emulators and simulators. Build for the target and create an instance: 

  • Build a binary using Zephyr 
  • Take the compiled .elf file and upload it to Atlas Corstone 310/315/320 
  • Login to Corellium UI 
  • Create an instance 
  • Upload the .elf into the “Custom firmware” field 
  • Follow the rest of the prompts and see the software run 

RD-1AE (Kronos) 

This is the only fully virtualized non-silicon model in existence that full supports and runs SOAFEE secure boot! This model can be created and run with Debian as well as with the default Linux OS and is System Ready. Follow the steps below to build the custom firmware for Kronos: 

  • Build the Kronos stock image 
  • Follow these steps to upload the custom image 
  • Create a new RD-1AE and upload the custom .zip firmware 
  • Login to Corellium UI 
  • Create an instance 
  • Upload the .zip into the “Custom firmware” field 
  • Now the RD-1AE will boot with custom firmware