Booting Apalis IMX6 from SD Card

I have the Apalis IMX6 and I can’t find a way to boot from the SD card…
i need to put the bootloader on the SD card and make the module boot from it every time automatically…
Is that possible?

Thanks

No, unfortunately this is not possible as all our modules are fused to boot exclusively from their on-module storage which in the Apalis/Colibri iMX6 case is the eMMC. That said you may load any further parts be it device tree, kernel and/or root file system from any other storage media like an SD card as explained here. Alternatively you may put a tiny shim into the eMMC which then uses the SD card as a secondary boot device similar to how the following does it for Vybrid.

Hello Marcel,

I have been trying to run the shim wrapper for the Apalis iMX6 board using the Ixora carrier card.

I was wondering what is the replacement for the following code from the Vybrid wrapper to be used for the Apalis iMX6 & Ixora carrier:

nand erase.part u-boot && nand erase.part u-boot-env && nand write ${loadaddr} u-boot

I know the replacement command for the nand erase in my case is the:

mmc erase blk# cnt

But Im not sure what i should define for the blk# & cnt arguments

When running the “mmc part” command on the eMMC on board of the Apalis i get:

Partition Map for MMC device 0  --   Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     8192            32768           00039759-01     0c
  2     40960           7086080         00039759-02     83

Can you kindly provide me with the edits necessary to try to run this wrapper edit for the U-Boot to be able to boot from the SD card?

Thank you!

Hello Marcel,

I have also tried to run the bmode sd command to reset the Apalis iMX6 module & reboot from the SD card. I attempted all other arguments such as esdhc0, esdhc4 but none of them provided any response from the board I only got resetting ... and the SOM hangs …

Any ideas what might be going wrong here?

Thanks!

Explicitly erasing blocks in eMMC is not required.

The partition table you are looking at is from the user area hardware partition while we nowadays boot from the boot area which is further explained here.

The exact way to actually flash the boot loader or now in your case the shim wrapper may be seen from the U-Boot Update scripts e.g. here.

That points towards your SD card not really being properly prepared for booting.

Hello Marcel,

I managed to get bmode to work with a u-boot.imx file that I have build using the u-boot source codes.
Here is a log of the successful running of the bmode sd

Apalis iMX6 # bmode sd
resetting ...


U-Boot 2017.07-rc3 (Jul 11 2017 - 13:56:46 +0200)

CPU:   Freescale i.MX6Q rev1.5 at 792 MHz
Reset cause: WDOG
I2C:   ready
DRAM:  2 GiB
PMIC: device id: 0x10, revision id: 0x21
PMIC: programmed
MMC:   FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
*** Warning - bad CRC, using default environment

auto-detected panel vga-rgb
Display: vga-rgb (640x480)
In:    serial_mxc
Out:   serial_mxc
Err:   serial_mxc
Missing Toradex config block
Model: Toradex Apalis iMX6 Quad 2GB IT
Net:   using PHY at 7
FEC [PRIME]
Error: FEC address not set.

Hit any key to stop autoboot:  0
Apalis iMX6 #

When I check the details of the “u-boot.img” file using the mkimage -l u-boot.imx command
I get the following:

Image Type:   Freescale IMX Boot Image
Image Ver:    2 (i.MX53/6 compatible)
Data Size:    339968 Bytes = 332.00 kB = 0.32 MB
Load Address: 177ff420
Entry Point:  17800000

When I got to look at the u-boot.imx .map file, I found that the .text section starts at the entry point address indicated above 0x17800000

I got to compile an application and I converted the .bin file to a .imx file to get the following output

Image Type:   Freescale IMX Boot Image
Image Ver:    2 (i.MX53/6 compatible)
Data Size:    430080 Bytes = 420.00 kB = 0.41 MB
Load Address: 0ffffb58
Entry Point:  10000738

Where the address indicated as the entry point matches by .map file as the start of the .text section.
BUT The application doesn’t want to work! …
I get stuck at the resetting .... message …
Note: I know that the application works since I got it up and running on another imx6 board that can take the sdcard as its primary device

Do you have any hints or suggestions to how to debug this problem?

Thanks in advance!

Are you absolutely sure your application is doing all the required hardware specific initialisation (e.g. DDR memory and board specific memory controller initialisation, UART pin muxing etc.)?

Yes, I am sure … I managed to upload this same application on the apalis imx6 SOM using the serial downloader mode (recovery mode) and the application ran smoothly!
Any leads? Any hints? :slight_smile:

any news marcel?

I guess you noticed that your load address/entry point differs (whether or not that actually matters)?

Depending on how exactly you did that the memory controller may actually have gotten setup by the serial downloader DCD/IVT stuff already while in the boot from SD card case the boot ROM would need to do the same albeit based on the same DCD/IVT as contained in the imx header.