Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Wiki Markup
This is a page about the NXP based i.MX6; i.MX6x SABRE Lite.

...


{hide-comments

...

}
{toc

...

:indent

...

=20px

...

|style

...

Vendor Documentation

...

=disc}
 
h2. Vendor Documentation
* NXP Documentation: [https://www.nxp.com

...

Basic Requirements

...

]
 
h2. Basic Requirements
* Running a recent supported release of Debian, Fedora or Ubuntu on a x86 64bit based PC; without OS Virtualization Software.
* Many of the listed commands assume /bin/bash as the default shell.
* ARM Cross Compiler -- Linaro: [https://www.linaro.org

...

]
** Linaro Toolchain Binaries: [https://www.linaro.org/downloads/

...

]
* Bootloader
** Das U-Boot

...

 -- the Universal Boot Loader: [http://www.denx.de/wiki/U-Boot

...

]
** Source: [https://github.com/u-boot/u-boot/

...

]
* Linux Kernel

...


** Linus's Mainline tree: [https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

...

]
* ARM based rootfs

...


** Debian: [https://www.debian.org

...

]
** Ubuntu: [https://www.ubuntu.com

...

]
 
h2. Bootloader: U-Boot

...


Das U-Boot

...

 -- the Universal Boot Loader: [http://www.denx.de/wiki/U-Boot

...

]
These directions going forward now assume your using the "factory" v2013.04 U-Boot. Please verify with: "version"

...


{code
}
U-Boot > version
U-Boot 2013.04-00308-ge1290a7 (Jun 18 2013 - 13:38:20)
arm-none-linux-gnueabi-gcc (Freescale MAD -- Linaro 2011.07 -- Built at 2011/08/10 09:20) 4.6.2 20110630 (prerelease)
GNU ld (Freescale MAD -- Linaro 2011.07 -- Built at 2011/08/10 09:20) 2.21.52.20110702
U-Boot >
{code}
If your board has something different, take a look here: [i.MX6x SABRE Lite SPI Flash Recovery|linuxonarm:i.MX6x SABRE Lite SPI Flash Recovery] for software developers, the mainline U-Boot directions are now here: [i.MX6x SABRE Lite Mainline U-Boot

...

Linux Kernel

This script will build the kernel, modules, device tree binaries and copy them to the deploy directory.
Download:

Code Block
titleuser@localhost:~$
|linuxonarm:i.MX6x SABRE Lite Mainline U-Boot]
 
h2. Linux Kernel
This script will build the kernel, modules, device tree binaries and copy them to the deploy directory.
Download:
{code:title=user@localhost:~$}
git clone https://github.com/RobertCNelson/armv7-multiplatform
cd armv7-multiplatform/
{code}
For v4.14.x (Longterm 4.14.x):

...


{code
:title
=user@localhost:~/armv7-multiplatform$
}
git checkout origin/v4.14.x -b tmp
{code}
For v4.14.x-rt (Longterm 4.14.x + Real-Time Linux):

...


{code
:title
=user@localhost:~/armv7-multiplatform$
}
git checkout origin/v4.14.x-rt -b tmp
{code}
For v4.19.x (Longterm 4.19.x):

...


{code
:title
=user@localhost:~/armv7-multiplatform$
}
git checkout origin/v4.19.x -b tmp
{code}
For v4.19.x-rt (Longterm 4.19.x + Real-Time Linux):

...


{code
:title
=user@localhost:~/armv7-multiplatform$
}
git checkout origin/v4.19.x-rt -b tmp
{code}
For v5.0.x (Stable):

...


{code
:title
=user@localhost:~/armv7-multiplatform$
}
git checkout origin/v5.0.x -b tmp
{code}
For v5.0.x-rt (Stable + Real-Time Linux):

...


{code
:title
=user@localhost:~/armv7-multiplatform$
}
git checkout origin/v5.0.x-rt -b tmp
{code}
Build:

...


{code
:title
=user@localhost:~/armv7-multiplatform$
}
./build_kernel.sh

Root File System

Debian 10

User

Password

debian

temppwd

root

root

Download:

Code Block
titleuser@localhost:~$
{code}
 
h2. Root File System
h3. Debian 10
|| User || Password ||
| debian | temppwd |
| root | root |
Download:
{code:title=user@localhost:~$}
wget -c https://rcn-ee.com/rootfs/eewiki/minfs/debian-10.34-minimal-armhf-2020-0205-10.tar.xz
{code}
 
Verify:

...


{code
:title
=user@localhost:~$
}
sha256sum debian-10.34-minimal-armhf-2020-0205-10.tar.xz
Code Block
titlesha256sum output:

a6645dfb49795bbe809dfc3c2b7dff53ad4daab24a654edd29bab29ae007cc40{code}
{code:title=sha256sum output:}
cd598e42850cbef87602bf15ee343abfbf0d8c6ba81028c741672b5f24263534  debian-10.34-minimal-armhf-2020-0205-10.tar.xz
{code}
 
Extract:

...


{code
:title
=user@localhost:~$
}
tar xf debian-10.34-minimal-armhf-2020-0205-10.tar.xz

...

{code}
 
h3. Ubuntu 20.04 LTS

...

User

Password

ubuntu

temppwd

Download:

Code Block
titleuser@localhost:~$

|| User || Password ||
| ubuntu | temppwd |
Download:
{code:title=user@localhost:~$}
wget -c https://rcn-ee.com/rootfs/eewiki/minfs/ubuntu-1820.04.3-minimal-armhf-2020-0205-10.tar.xz
{code}
 
Verify:

...


{code
:title
=user@localhost:~$
}
sha256sum ubuntu-1820.04.3-minimal-armhf-2020-0205-10.tar.xz
Code Block
titlesha256sum output:

b28b356d75153bfb3beb5c96bf8eabe92025cf5e665e1a564b469bc70e5a363b{code}
{code:title=sha256sum output:}
de0177ac9259fdbcc626ee239f4258b64070c0921dbc38c45fab6925a5becaa1  ubuntu-1820.04.3-minimal-armhf-2020-0205-10.tar.xz
{code}
 
Extract:

...


{code
:title
=user@localhost:~$
}
tar xf ubuntu-1820.04.3-minimal-armhf-2020-0205-10.tar.xz

Setup microSD card

We need to access the External Drive to be utilized by the target device. Run lsblk to help figure out what linux device has been reserved for your External Drive.

Example: for
Code Block
title
{code}
 
h2. Setup microSD card
We need to access the External Drive to be utilized by the target device. Run lsblk to help figure out what linux device has been reserved for your External Drive.
{code:title=Example: for DISK=/dev/sdX
}
lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 465.8G  0 disk
├─sda1   8:1    0   512M  0 part /boot/efi
└─sda2   8:2    0 465.3G  0 part /                <- Development Machine Root Partition
sdb      8:16   1   962M  0 disk                  <- microSD/USB Storage Device
└─sdb1   8:17   1   961M  0 part                  <- microSD/USB Storage Partition
Code Block
titleThus you would use:
{code}
{code:title=Thus you would use:}
export DISK=/dev/sdb
Code Block
title
{code}
{code:title=Example: for DISK=/dev/mmcblkX
}
lsblk
NAME      MAJ:MIN   RM   SIZE RO TYPE MOUNTPOINT
sda         8:0      0 465.8G  0 disk
├─sda1      8:1      0   512M  0 part /boot/efi
└─sda2      8:2      0 465.3G  0 part /                <- Development Machine Root Partition
mmcblk0     179:0    0   962M  0 disk                  <- microSD/USB Storage Device
└─mmcblk0p1 179:1    0   961M  0 part                  <- microSD/USB Storage Partition
Code Block
titleThus you would use:
{code}
{code:title=Thus you would use:}
export DISK=/dev/mmcblk0

...

{code}
 
Erase partition table/labels on microSD card:

...


{code
}
sudo dd if=/dev/zero of=${DISK} bs=1M count=50

...

{code}
 
Create Partition Layout:

...


With util-linux v2.26, sfdisk was rewritten and is now based on libfdisk.

...

sfdisk sfdisk

{code
:title
=Check the version of sfdisk installed on your pc
}
sudo sfdisk --version
Code Block
titleExample Output
{code}
{code:title=Example Output}
sfdisk from util-linux 2.27.1
Code Block
title
{code}
{code:title=sfdisk >= 2.26.x
}
sudo sfdisk ${DISK} <<-__EOF__
1M,48M,0x83,*
,,,-
__EOF__
Code Block
title
{code}
{code:title=sfdisk <= 2.25.x
}
sudo sfdisk --unit M ${DISK} <<-__EOF__
1,48,0x83,*
,,,-
__EOF__

...

{code}
 
Format Partition:

...


*With mkfs.ext4 1.43, we need to make sure metadata_csum and 64bit ext4 features are disabled.

...

*
As the version of U-Boot needed for this target CAN NOT correctly handle reading files with these newer ext4 options.

...


{code
:title
=mkfs.ext4 -V
}
sudo mkfs.ext4 -V
mke2fs 1.43-WIP (15-Mar-2016)
        Using EXT2FS Library version 1.43-WIP
Code Block
title
{code}
 
{code:title=mkfs.ext4 >= 1.43
}
for: DISK=/dev/mmcblk0
sudo mkfs.ext2 -L boot ${DISK}p1
sudo mkfs.ext4 -L rootfs -O ^metadata_csum,^64bit ${DISK}p2
 
for: DISK=/dev/sdX
sudo mkfs.ext2 -L boot ${DISK}1
sudo mkfs.ext4 -L rootfs -O ^metadata_csum,^64bit ${DISK}2
Code Block
title
{code}
{code:title=mkfs.ext4 <= 1.42
}
for: DISK=/dev/mmcblkX
sudo mkfs.ext2 -L boot ${DISK}p1
sudo mkfs.ext4 -L rootfs ${DISK}p2
 
for: DISK=/dev/sdX
sudo mkfs.ext2 -L boot ${DISK}1
sudo mkfs.ext4 -L rootfs ${DISK}2
{code}
Mount Partition:

...


*On most systems these partitions may be auto-mounted...

...

*
{code
}
sudo mkdir -p /media/boot/
sudo mkdir -p /media/rootfs/
 
for: DISK=/dev/mmcblkX
sudo mount ${DISK}p1 /media/boot/
sudo mount ${DISK}p2 /media/rootfs/
 
for: DISK=/dev/sdX
sudo mount ${DISK}1 /media/boot/
sudo mount ${DISK}2 /media/rootfs/
{code}
 
h3. 6x_bootscript to uEnv.txt wrapper

...


Create wrapper script "6x_bootscript.txt" boot script: (nano 6x_bootscript.txt)

...


{code
:title
=~/6x_bootscript.txt
}
echo "6x_bootscript -> uEnv.txt wrapper..."
if test -n $disk; then
setenv mmcdev $disk
setenv mmcpart 1
fi
load mmc ${mmcdev}:${mmcpart} ${loadaddr} uEnv.txt
env import -t ${loadaddr} ${filesize}
run uenvcmd
{code}
Using mkimage (u-boot-tools pkg) create boot script

...


{code
:title
=~/
}
mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "wrapper" -d ./6x_bootscript.txt ./6x_bootscript
{code}
 
h3. uEnv.txt based bootscript

...


Create uEnv.txt boot script: (nano uEnv.txt)

...


{code
:title
=~/uEnv.txt
}
initrd_high=0xffffffff
fdt_high=0xffffffff
 
fdtfile=imx6q-sabrelite.dtb
 
console=ttymxc1,115200n8
optargs=console=tty0
video=
 
mmcroot=/dev/mmcblk0p2 ro
 
#This gets complex when both microSD & MMC media is present at bootup:
#microSD:
#mmcroot=/dev/mmcblk0p2 ro
#MMC:
#mmcroot=/dev/mmcblk1p2 ro
 
mmcrootfstype=ext4 rootwait fixrtc
 
loadkernel=load mmc ${mmcdev}:${mmcpart} 0x12000000 zImage
loadinitrd=load mmc ${mmcdev}:${mmcpart} 0x18080000 initrd.img; setenv initrd_size 
loadfdt=load mmc ${mmcdev}:${mmcpart} 0x18000000 /dtbs/${fdtfile}
 
#zImage/initrd.img:
#boot_fdt=run loadkernel; run loadinitrd; run loadfdt
 
#zImage:
boot_fdt=run loadkernel; run loadfdt
 
mmcargs=setenv bootargs console=${console} ${optargs} root=${mmcroot} rootfstype=${mmcrootfstype} video=${video}
 
#zImage/initrd.img:
#uenvcmd=run boot_fdt; run mmcargs; bootz 0x12000000 0x18080000:${initrd_size} 0x18000000
 
#zImage:
uenvcmd=run boot_fdt; run mmcargs; bootz 0x12000000 - 0x18000000

...

{code}
 
Copy 6x_bootscript/uEnv.txt to the boot partition:

...

Code Block
title

 
{code:title=~/
}
sudo cp -v ./6x_bootscript /media/boot/
sudo cp -v ./uEnv.txt /media/boot/

Install Kernel and Root File System

To help new users, since the kernel version can change on a daily basis. The kernel building scripts listed on this page will now give you a hint of what kernel version was built.

Code Block
{code}
 
h2. Install Kernel and Root File System
To help new users, since the kernel version can change on a daily basis. The kernel building scripts listed on this page will now give you a hint of what kernel version was built.
{code}
-----------------------------
Script Complete
eewiki.net: [user@localhost:~$ export kernel_version=5.X.Y-Z]
-----------------------------

...

{code}
 
Copy and paste that "export kernel_version=5.X.Y-Z" exactly as shown in your own build/desktop environment and hit enter to create an environment variable to be used later.

...


{code
}
export kernel_version=5.X.Y-Z

Copy Root File System

Code Block
title
{code}
 
h3. Copy Root File System
{code:title=user@localhost:~$
}
sudo tar xfvp ./*-*-*-armhf-*/armhf-rootfs-*.tar -C /media/rootfs/
sync
sudo chown root:root /media/rootfs/
sudo chmod 755 /media/rootfs/

Copy Kernel Image

Kernel Image:

Code Block
titleuser@localhost:~$
{code}
 
h3. Copy Kernel Image
Kernel Image:
{code:title=user@localhost:~$}
sudo cp -v ./armv7-multiplatform/deploy/${kernel_version}.zImage /media/boot/zImage

Copy Kernel Device Tree Binaries

Code Block
title
{code}
 
h3. Copy Kernel Device Tree Binaries
{code:title=user@localhost:~$
}
sudo mkdir -p /media/boot/dtbs/
sudo tar xfvo ./armv7-multiplatform/deploy/${kernel_version}-dtbs.tar.gz -C /media/boot/dtbs/

Copy Kernel Modules

Code Block
title
{code}
 
h3. Copy Kernel Modules
{code:title=user@localhost:~$
}
sudo tar xfv ./armv7-multiplatform/deploy/${kernel_version}-modules.tar.gz -C /media/rootfs/

...

{code}
 
h3. File Systems Table (/etc/fstab)

...

Code Block

{code:title=user@localhost:~/$}
sudo sh -c "echo '/dev/mmcblk0p2  /  auto  errors=remount-ro  0  1' >> /media/rootfs/etc/fstab"
sudo sh -c "echo '/dev/mmcblk0p1  /boot/uboot  auto  defaults  0  2' >> /media/rootfs/etc/fstab"

...

{code}
 
h3. Remove microSD/SD card

...


{code
}
sync
sudo umount /media/boot
sudo umount /media/rootfs

SPI Flash Recovery

{code}
 
h2. SPI Flash Recovery
[i.MX6x SABRE Lite SPI Flash

...

Comments

...

 Recovery]
 
h2. Comments
Any questions or comments please go to our TechForum: [TechForum|https://forum.digikey.com/c/linux-on-arm/]