Search by Tags

Flashing Embedded Linux to iMX6 Modules

 

Compare with Revision




Subscribe for this article updates

This article describes how to bring up Linux on iMX6 modules.
Note: Please try our new Toradex Easy Installer which is Linux-based application that provides a graphical selection of Operating System images that users may choose to install onto internal flash memory of Toradex modules in an extremely simple way.

Note: Please note that Toradex Easy Installer will be the default pre-installed Software for Colibri iMX6, Apalis iMX6, Colibri iMX7 and all newer modules in the future.

Prerequisites

ARTICLE_CONTENT 102281

Preparation

ARTICLE_CONTENT 102244

Apalis iMX6

Apalis iMX6 Release Notes

For information concerning the recovery mode refer to Section 6 i.e. Recovery mode of the Apalis iMX6 datasheet.

EvalBoard V1.0A/V1.1A:

  • Depending on JP10/12 connect the serial debug console to the lower X28 using a null modem RS-232 cable or X29 using a regular USB cable.
  • Insert the SD card as prepared above into the SD/MMC 8bit (X18) or SD/MMC 4bit (X19) socket.

Ixora V1.0A:

  • Connect the serial debug console to X22 using a null modem RS-232 cable and a 10 pin IDC to 9 pin D-sub male connector (DTK or Intel standard).
  • Insert the micro SD card as prepared above into the SD card socket (X10).
  • If you update from a V2.2 BSP either use an EvalBoard for update or on Ixora use the following U-Boot commands:
Apalis iMX6 # setenv drive 2
Apalis iMX6 # setenv setupdate 'fatload mmc ${drive}:1 ${loadaddr} flash_mmc.img; source ${loadaddr}'
Apalis iMX6 # saveenv

Boot to U-Boot Prompt and Start the Update:

  • Apply power or reset.
  • Hit any key to stop auto booting.
  • Use the 'run setupdate' U-Boot command and then
  • For image version prior to V2.7 use 'run update_it' for an industrial temperature grade module , use 'run update' for a commercial temperature grade module.
    For image version V2.7 and later use 'run update'
Apalis iMX6 # run setupdate
Apalis iMX6 # run update_it

If you updated from an older BSP (without a device tree).

  • Power cycle or reset and hit any key to stop auto booting.
  • Use 'printenv' to get your current U-Boot environment.
  • Use 'env default -a' to set the U-Boot environment to its default value.
  • Optionally change the environment to your needs.
  • Use 'saveenv' to make the changes permanent.
Apalis iMX6 # printenv
Apalis iMX6 # env default -a
Apalis iMX6 # saveenv

If you update to a BSP V2.6 Beta 1 or later, the update scripts will migrate to eMMC Fast Boot mode. The article Linux - Booting(100867) provides detailed information about eMMC Fast Boot mode. During update, you will be asked to power cycle the board, and perform fusing.

...
MMC write: dev # 0, block # 2, count 614 ... 614 blocks written: OK
done.
successfully updated U-Boot, power-cycle and enter "run setupdate; run migrate" to complete update
Apalis iMX6 # 

At this point, it is important to turn the module off and back on. Then continue with:

Apalis iMX6 # run setupdate; run migrate
...
MMC write: dev # 0, block # 2, count 614 ... 614 blocks written: OK
done.
Fuse 0, 5:     5062
Warning: Programming fuses is an irreversible operation!
         Updating to fast boot mode prevents easy
         downgrading to previous BSP versions.

Really perform this fuse programming? 
y
...

Update a Single Component

U-Boot

  • For image version prior to V2.7 use 'run update_uboot_it' for an industrial temperature grade module, use 'run update_uboot' for a commercial temperature grade module.
    For image version V2.7 and later use 'run update_uboot'.
Apalis iMX6 # run setupdate
Apalis iMX6 # run update_uboot_it

Kernel or Linux Device Tree

  • Use 'run setupdate' and then 'run update_kernel' or 'run update_fdt' respectively.
Apalis iMX6 # run setupdate
Apalis iMX6 # run update_kernel
Apalis iMX6 # run update_fdt

SPL

  • Image version V2.7 and later use an additional bootloader componenent called SPL. It usually need not be updated.
Apalis iMX6 # run setupdate
Apalis iMX6 # run update_spl

Colibri iMX6

Colibri iMX6 Release Notes

For information concerning the recovery mode refer to Section 6. Recovery mode of the Colibri iMX6 datasheet.

EvalBoard V3.1A/V3.2A:

  • Depending on JP17/19 connect the serial debug console to UARTA aka FFUART (lower X25) using a null modem RS-232 cable resp. X27 using a regular USB cable
  • Insert the SD card as prepared above into the SD/MMC socket (X15)

Iris V1.1A:

  • Connect the serial debug console to UARTA aka FFUART X13 using a null modem RS-232 cable and a 10 pin IDC to 9 pin D-sub male connector (DTK or Intel standard).
  • Insert the micro SD card as prepared above into the micro SD card socket (X10)

Boot to U-Boot Prompt and Start the Update:

  • Apply power or reset
  • Hit any key to stop auto booting
  • Use the 'run setupdate' U-Boot command and then
  • Use the 'run update' U-Boot command
Colibri iMX6 # run setupdate
Colibri iMX6 # run update

If you update to a BSP V2.6 Beta 1 or later, the update scripts will migrate to eMMC Fast Boot mode. The article Linux - Booting(100867) provides detailed information about eMMC Fast Boot mode. During update, you will be asked to power cycle the board, and perform fusing.

...
MMC write: dev # 0, block # 2, count 614 ... 614 blocks written: OK
done.
successfully updated U-Boot, power-cycle and enter "run setupdate; run migrate" to complete update
Colibri iMX6 # 

At this point, it is important to turn the module off and back on. Then continue with:

Colibri iMX6 # run setupdate; run migrate
...
MMC write: dev # 0, block # 2, count 614 ... 614 blocks written: OK
done.
Fuse 0, 5:     5062
Warning: Programming fuses is an irreversible operation!
         Updating to fast boot mode prevents easy
         downgrading to previous BSP versions.

Really perform this fuse programming? 
y
...

Update a Single Component

U-Boot

  • Use 'run setupdate' and then 'run update_uboot'
Colibri iMX6 # run setupdate
Colibri iMX6 # run update_uboot

Kernel or Linux Device Tree

  • Use 'run setupdate' and then 'run update_kernel' or 'run update_fdt' respectively
Colibri iMX6 # run setupdate
Colibri iMX6 # run update_kernel
Colibri iMX6 # run update_fdt

SPL

  • Image version V2.7 and later use an additional bootloader componenent called SPL. It usually need not be updated.
Colibri iMX6 # run setupdate
Colibri iMX6 # run update_spl

Flashing from Scratch

In case the module doesn't show any boot loader output, hangs at very early stages or for migration from WinCE refer Section 6 i.e. Recovery mode of the Apalis iMX6 datasheet to put Apalis or Colibri iMX6 datasheet to put Colibri in recovery mode.

Apalis EvalBoard V1.0A/V1.1A:

  • Connect USB micro A/B (X49) or USB B (X50) to development workstation using micro or regular USB cable.
  • Depending on JP10/12 connect the serial debug console to the lower X28 using a null modem RS-232 cable or X29 using a regular USB cable.

Ixora V1.0A:

  • Connect USB micro A/B (X9) to development workstation using regular micro USB cable.
  • Make sure JP2 is removed and nothing is connected to the lower USB host port X8.
  • For more information please consult Ixora datasheet section 3.3 and chapter 4.
  • Connect the serial debug console to X22 using a null modem RS-232 cable and a 10 pin IDC to 9 pin D-sub male connector (DTK or Intel standard).

Colibri EvalBoard V3.1a:

  • Connect USB B (X29) or USB micro A/B (X30) to development workstation using regular or micro USB cable.
  • The jumper JP2 must be open.
  • Depending on JP17/19 connect the serial debug console to UARTA aka FFUART (lower X25) using a null modem RS-232 cable resp. X27 using a regular USB cable.

Iris V1.1a:

  • Connect USB micro A/B (X12) to development workstation using regular micro USB cable.
  • Connect the serial debug console to UARTA aka FFUART X13 using a null modem RS-232 cable and a 10 pin IDC to 9 pin D-sub male connector (DTK or Intel standard).

USB speed:

If the host is USB 2.0 high speed capable this will be used. So make sure that the carrier board supports USB high speed. All Apalis carrier boards and Iris & EvalBoard V3.1a are OK, for other carrier boards see http://developer.toradex.com/knowledge-base/usb-2.0-high-speed-%28480mbps%29.

Recovery Mode:

  • Have the module in recovery mode and load U-Boot over USB to the module's RAM:
    • lsusb on host should show a 15a2:0054 NXP/Freescale Semiconductor, Inc. device if the module is in recovery mode.
    • run ./update.sh -d on host.
    • stop at the U-Boot prompt
    • for image version V2.7 and later execute run setupdate; run update_spl in U-Boot.
    • begin the update as stated for the respective modules above.

Config Block

A module can get its Config Block(100436) erased which is indicated by the following warning in the U-Boot output.

...
Out:   serial
Err:   serial
Missing Toradex config block
Model: Toradex Apalis iMX6 1GB
...

To recover it run the U-Boot cfgblock command:

Apalis iMX6 # cfgblock create
Is the module an IT version? [y/N] n
Enter the module version (e.g. V1.1B): V1.0A
Enter module serial number: 12582964
Toradex config block successfully written

Note: The cfgblock create command is available since BSP release V2.4 Beta 1 (U-Boot 2015.04). To recover the config block for older U-Boot versions use the configblock.sh script and copy the configblock.bin file to the SD card. Then use 'run setupdate && run update_configblock'.

Serial Console

Please note that to be at the U-Boot prompt one needs to open the /dev/ttySx or /dev/ttyUSBx port with a terminal emulation program like minicom on Linux or a CoMx port on Windows with puTTY with a baud rate of 115200 baud, 8 data bits, no parity and one stop bit without any hardware/software flow control.