How to run LinuxImage3.0 from microSD on Apalis MX8

Hello,
I am experimenting Apalis MX8 with LinuxImage3.0 (Yocto)

  • Ixora V1.1A
  • Apalis iMX8 QP 2GB WB V1.08

My goal is to flash and run a system into the microSD

Following instruction in
https://developer.toradex.com/knowledge-base/board-support-package/openembedded-(core)

repo init -u http://git.toradex.com/toradex-bsp-platform.git -b LinuxImage3.0 -m default.xml
repo sync

then I built console-tdx-image

The final result was

Console-Image-colibri-imx8x.wic.gz -> Colibri-iMX8X_Console-Image.rootfs.wic.gz

Then I flashed it on the microSD

gunzip -c Console-Image-colibri-imx8x.wic.gz | sudo dd of=/dev/sdc bs=1M && sync

afterward I deleted the eMMC content using the pre-installed Easy Installer

Now the board is not booting at all.

I wonder if is possible to run the generated image from microSD on this board.

What is the exact procedure to follow to do that?

Thanks

Hi @koan

Thanks for writing to the Toradex Community!

Since Bsp 3.0, distro-boot is used only to boot-up any OS on Toradex modules. Please check our developer article about distro-boot for more Information.

Best regards,
Jaski

Hi @jaski.tx
your answer is confusing me.

Do you mean thath the image artifact Console-Image-colibri-imx8x.wic.gz generated by the build process of your BSP 3.0 is useless?

I know that you like to use eMMC and the ‘easy’ installer but is it possible to boot your board from microSD like any other SoM?

Thanks

Hi Koan

Do you mean thath the image artifact Console-Image-colibri-imx8x.wic.gz generated by the build process of your BSP 3.0 is useless?

No, not at all.

I know that you like to use eMMC and the ‘easy’ installer but is it possible to boot your board from microSD like any other SoM?

The SoC is fused to boot from eMMC, so U-Boot must be placed on eMMC. However the kernel and rootfs can be placed on the media of your choice.

Best regards,
Jaski

Hi @jaski.tx
now it’s clear: your SoC is fused to boot from eMMC, so U-Boot must be placed on eMMC only.
So the procedure to use the wic.gz generated image should be:

  • find the proper easy installer link somewhere the in the website
  • download it
  • program it on a removable device
  • reflash eMMC with the easy installer
  • reboot and figure out how to make the system boot from SD

Thank you

No, just use the WIC image as usual flashing it to your media of choice but do NOT erase the boot loader from the primary eMMC hardware boot area partition. From within that regular boot loader you may then use distroboot to load/run Linux from that media of choice of yours really. Latest boot loaders should even default to distrobooting from any plugged in SD card. Other medias (e.g. like USB mass storage ones) may require manual distrobooting. Due to their lengthy enumeration times we avoid including those in the regular distroboot order.

Yes, of course not. Why on earth would anybody erase the entire eMMC? In that case recovery is exclusively possible via USB. This is basically a SoC boot ROM limitation. One can not fuse it to boot from eMMC but later boot from something else other than USB recovery.

However after the eMMC erase is not possible to recove the board using Easy Installer from SD card, is it?

https://developer.toradex.com/knowledge-base/distro-boot-linux#Example_Loading_Toradex_Easy_Installer_from_an_SD_card

@marcel.tx please apologize my silly question.

I work with dozens of SoC from different manufacturers and I don’t always remember the procedures that everyone invents for themselves :wink: and in some cases erasing the entire eMMC is the only way to enable a boot from microSD.

@jaski.tx I read the distro-boot page for more Information.

However looks like the boot.scr file generated by the Bsp 3.0 build is not working properly once flashed into the microSD. I mean that I expected it suitable to boot the board with the just generated image.

From what I understand, you need to modify it following the next section
https://developer.toradex.com/knowledge-base/distro-boot-linux#bootscrbootscruimg

My question is: what’s the purpose of the Console-Image-colibri-imx8x.wic.gz generated by the Bsp 3.0 then?

The section
https://developer.toradex.com/knowledge-base/distro-boot-linux#Understanding_the_Boot_Sequence

says that U-Boot will scan through the following devices in order:

  1. Internal flash memory (raw NAND or eMMC)
  2. External SD card

So is always needed to modify the boot.scr in eMMC and the other in the microSD is useless.

Yep, yep, no pun intended. Depending on what NXP SoC and which version of its boot ROM various behaviours may be possible. Unfortunately, with the i.MX 8 series such so-called manufacture boot mode is only available until any boot fuses are blown and not as a general fallback.

The issue is solved.

I generated the image for MACHINE=colibri-imx8x (that probably doesn’t exist)

But my board is MACHINE = “apalis-imx8”

Now the system boots simply inserting the microSD.

My fault. Sorry for the noise.


U-Boot 2018.03-toradex_imx_v2018.03_4.14.78_1.0.0_ga-bringup+gc0ff506c39 (Dec 31 2019 - 23:25:47 +0000)

CPU:   Freescale i.MX8QM revB A53 at 1200 MHz at 30C
DRAM:  2 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from MMC... OK
In:    serial
Out:   serial
Err:   serial
Model: Toradex Apalis iMX8 QuadPlus 2GB Wi-Fi / BT V1.0B, Serial# 06494505

 BuildInfo: 
  - SCFW 494c97f3, SECO-FW d7523fe8, IMX-MKIMAGE dd023400, ATF a-20190
  - U-Boot 2018.03-toradex_imx_v2018.03_4.14.78_1.0.0_ga-bringup+gc0ff506c39 

switch to partitions #0, OK
mmc0(part 0) is current device
flash target is MMC:0
Net:   eth0: ethernet@5b040000
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
Found U-Boot script /boot.scr
1243 bytes read in 11 ms (110.4 KiB/s)
## Executing script at 86000000
102464 bytes read in 8 ms (12.2 MiB/s)
Loading hdp firmware from 0x0000000084000000 offset 0x0000000000002000
Loading hdp firmware Complete
105024 bytes read in 19 ms (5.3 MiB/s)
23448064 bytes read in 1020 ms (21.9 MiB/s)
## Flattened Device Tree blob at 84000000
   Booting using the fdt blob at 0x84000000
   Loading Device Tree to 00000000fd65d000, end 00000000fd679a3f ... OK
/dma-controller@5a1f0000, 73440
/dma-controller@591F0000, 74320
/dma-controller@591F0000, 74320
/dma-controller@599F0000, 75296

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.14.159-3.0.3+gfff496c2a1bd (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP PREEMPT Tue Feb 18 14:03:33 UTC 2020
[    0.000000] Boot CPU: AArch64 Processor [410fd034]
[    0.000000] Machine model: Toradex Apalis iMX8QM/QP on Apalis Evaluation Board

Perfect that the issue is solved. Thanks for the feedback.

Hi @koan

However looks like the boot.scr file generated by the Bsp 3.0 build is not working properly once flashed into the microSD.

What exactly is not working for you?

From what I understand, you need to modify it following the next section

In boot.scr file you can set some U-Boot variables and pass arguments to the kernel.

My question is: what’s the purpose of the Console-Image-colibri-imx8x.wic.gz generated by the Bsp 3.0 then.

You just extract this to SD Card and you can boot from SD Card.

So is always needed to modify the boot.scr in eMMC and the other in the microSD is useless.

Why you think so?

Best regards,
Jaski