Android devices in the field can receive and install over-the-air (OTA) updates to the system and application software. Devices have a special recovery partition with the software needed to unpack a downloaded update package and apply it to the rest of the system.

To build an update package for your platform based on Digi’s source code, follow these steps:

  1. Set up your environment and install the sources. If you have not already done so, see Set up your development computer.

  2. Change to the directory where the source code is installed.

    $ cd dea-8.0-r1
  3. Initialize the build environment:

    $ source build/envsetup.sh
  4. Select a ConnectCore 6 target to build:

    1. ccimx6sbc-eng creates development images with root access and additional debugging tools.

    2. ccimx6sbc-user creates images with no root access, suitable for production.

      Information about the selected target is displayed:

      $ lunch ccimx6sbc-eng
      
      ============================================
      PLATFORM_VERSION_CODENAME=REL
      PLATFORM_VERSION=8.0.0
      TARGET_PRODUCT=ccimx6sbc
      TARGET_BUILD_VARIANT=eng
      TARGET_BUILD_TYPE=release
      TARGET_PLATFORM_VERSION=OPD1
      TARGET_BUILD_APPS=
      TARGET_ARCH=arm
      TARGET_ARCH_VARIANT=armv7-a-neon
      TARGET_CPU_VARIANT=cortex-a9
      TARGET_2ND_ARCH=
      TARGET_2ND_ARCH_VARIANT=
      TARGET_2ND_CPU_VARIANT=
      HOST_ARCH=x86_64
      HOST_2ND_ARCH=x86
      HOST_OS=linux
      HOST_OS_EXTRA=Linux-4.15.0-34-generic-x86_64-with-Ubuntu-18.04-bionic
      HOST_CROSS_OS=windows
      HOST_CROSS_ARCH=x86
      HOST_CROSS_2ND_ARCH=x86_64
      HOST_BUILD_TYPE=release
      BUILD_ID=dea-8.0-r1.1
      OUT_DIR=out
      AUX_OS_VARIANT_LIST=
      ============================================
      
      $
  5. When you develop locally, you would typically use plain make with no particular target to compile. When you prepare for release, however, you need to do this instead:

    $ make -j<Number_Of_Jobs> dist

    It compiles the whole source tree, as a plain make does. Then it generates several zip files inside the out/dist folder of the dea-8.0-r1 directory:

    • ccimx6sbc-ota-<build_id>.zip is the update package that can be installed through recovery. The package contains all the files needed by system, boot, vendor, and recovery partition.

    • ccimx6sbc-target_files-<build_id>.zip contains all the target files (apk, binaries, libraries, etc.) that will go into the final release package.

    • ccimx6sbc-apps-<build_id>.zip contains all the apks.

    • ccimx6sbc-img-<build_id>.zip contains image files for system, boot, vendor, and recovery.

    • ccimx6sbc-symbols-<build_id>.zip contains all files in out/target/product/ccimx6sbc/symbols.

      The file ccimx6sbc-img-<build_id>.zip includes the release system, boot, vendor and recovery images.

To program these files into your ConnectCore 6, follow the steps in Program the firmware from U-Boot using uSD.

Update package with wipe data support

The default ccimx6sbc-ota-<build_id>.zip update package generated with make dist does not wipe the user data partition. To do so, you have to regenerate this file using the ota_from_target_files tool.

The ota_from_target_files tool generates an update package from the ccimx6sbc-target_files-<build_id>.zip produced by the Android build system in Create an update package.

Use the --wipe_user_data option of this tool to generate an update package with wipe data partition support:

$ ./build/tools/releasetools/ota_from_target_files --wipe_user_data --no_signing --use_raw_images out/dist/{pfm-codename-pro}-target_files-<build_id>.zip out/dist/{pfm-codename-pro}-ota-wipe_data.zip