Home > Uncategorized > Preparing i.MX6 to boot from SD Card

Preparing i.MX6 to boot from SD Card

March 9th, 2018

Let us assume that you have compiled the u-boot for freescale/nxp i.MX6 and are now trying to prepare the SD Card to boot the i.MX6 from it.

Before you do that, you need to make sure your hardware is ready for it. The i.MX6 should not have been fused to prevent it from booting from external SD Card. Also the Config Pins should be properly set, so that it can boot from SD Card ( and not from SPI Flash as in Sabre Lite Board).

Once you do that, all you need to do is just burn an SD Card with the following command.

sudo dd if=some/directory/u-boot.imx of=/dev/sdb bs=1k seek=1 conv=fsync

It is good idea to spend some time on to understand the bs and the seek parameter in the command. The bs is block size and in our case it is 1K or 1024 bytes. The seek parameter is a pointer on the SD Card. If we set seek to 1, it will move forward by 1 block size on the SD Card before write.

If your u-boot.imx file, for example, already has padded 0s in the beginning, you do not need the bs=1k seek=1

Why Do we need u-boot start from 1K ( 0x0400) ?

This requirement comes from i.MX6. The i.MX6 will look at the address 1024 to load the data into its ROM and execute from there. Notice that at this point we have not created any partition whatsoever and the board will still boot. The u-boot does not care about the Master Boot Record. Though we will need some kid of partition information information to read file system later in the boot process.

A typical SD Card with MBR partition will look as follows ...


| MBR | ... | u-boot | ... | Partition1 |...Partition2 |...Partition3


0 512 1024 2M 20M 100MB

The Master Boot Record is stored in the first 512 Bytes of the SD Card. This contains the details of the partition of the SD Card. With all its limitations ( number of partitions it can store etc), the MBR works good. Though, we do not need it for the very first boot from u-boot of i.MX6.

Now you understand why i.MX6 was not designed to boot from the address 1K Byte in place of 0x0000. If it were designed to boot from 0x0000, we will be writing the u-boot right at 0x0000 - and it will then destroy the MBR.


GPT (GUID Partition Table) brings with it many advantages, including support for bigger cards / disks and ability to store larger partition tables. The GPT starts at location 512 Bytes and a typical scenario looks like


| |GPT | u-boot | ... | Partition1 |...Partition2 |...Partition3


0 512 1024 2M 20M 100MB

With reference to u-boot, the scheme still works, with one caveat - the GPT partition table can extend ( because it is large) to the u-boot area that starts at 1024 Bytes. So if you create the GPT first and then write the u-boot, the u-boot writing process will destroy the GPT Table ( at least partially, unless it is really small). If you write u-boot first and then create GPT, the GPT creation process will destroy the u-boot.

So is there a solution ? Fortunately Yes. The GPT allows relocation of the Partition table. What we basically do is create an entry in the first few bytes of the GPT Table that tells where the rest of Table is going to be. We can then reserve some other place in the boot partition to store the GPT Table.


  1. Guillaume G
    April 19th, 2018 at 05:17 | #1


    Thank for the article. I exactly have this issue. We would like to move from MBR to GPT but imx6 expect bootloader to be at 0x400. All tools I have found doesn't seem to allow to choose the partition table offset. Can you provide more detail how you moved it?



  1. No trackbacks yet.