DART-6UL Debian Jessie MX6UL R2: Difference between revisions

From Variscite Wiki
(Added release version)
No edit summary
Line 125: Line 125:
</pre>
</pre>


= Boot board with a bootable SD-Card =
= Boot board with a bootable SD card =
<span style="color:red">Note: Boot from SD-Card eliminates Wifi</span> as the Wifi and SD-Card are using same SDIO interface.<br>
<span style="color:red">Note: Boot from SD card eliminates Wifi</span> as the Wifi and SD card are using same SDIO interface.<br>
A typical use-case, is to boot from SD-Card, flash eMMC or NAND-Flash, and re-boot form eMMC/NAND to have Wi-Fi operational.
A typical use-case, is to boot from SD card, flash eMMC or NAND flash, and re-boot form eMMC/NAND flash to have Wi-Fi operational.


== Setting board dip-switches ==
== Setting board dip-switches ==
Booting your system requires switching the relevant dip-switch to "Boot from SD-Card". See picture below.<br>
Booting your system requires switching the relevant dip-switch to "Boot from SD card". See picture below.<br>


[[File:Boot_switch_6ul1.jpg|thumb|none|upright=2.0]]
[[File:Boot_switch_6ul1.jpg|thumb|none|upright=2.0]]
<br>
<br>
* "00" - Boot from SDCARD - The picture mode
* "00" - Boot from SD card - The picture mode
* "01" - Boot from eMMC
* "01" - Boot from eMMC
* "10" - Boot from NAND-Flash
* "10" - Boot from NAND flash
* "11" is illegal.
* "11" is illegal.
Be aware that your SOM has either eMMC or NAND but never both !<br><br>
Be aware that your SOM has either eMMC or NAND flash but never both !<br><br>


To boot board with SD-Card, Follow the steps below:<br>
To boot board with SD card, Follow the steps below:<br>


*Power-off the board.
*Power-off the board.
*Insert the SD card into the SD/MMC slot of the carrier board (DVK)
*Insert the SD card into the SD/MMC slot of the carrier board (DVK)
*Switch the relevant dip-switch to "Boot from SD-Card"
*Switch the relevant dip-switch to "Boot from SD card"
*Power-up board
*Power-up board
*The board will automatically boot into Linux from SD-Card
*The board will automatically boot into Linux from SD card


== Automatic device Tree selection in U-Boot ==
== Automatic device Tree selection in U-Boot ==
Line 204: Line 204:
|}
|}


<span style="color:red">Note: Boot from SD-Card eliminates Wifi</span> as the Wifi and SD-Card are using same SDIO interface.<br>
<span style="color:red">Note: Boot from SD card eliminates Wifi</span> as the Wifi and SD card are using same SDIO interface.<br>
A typical use-case, is to boot from SD-Card, flash eMMC or NAND-Flash, and re-boot form eMMC/NAND to have Wi-Fi operational.
A typical use-case, is to boot from SD card, flash eMMC or NAND flash, and re-boot form eMMC/NAND flash to have Wi-Fi operational.


== Disable Automatic Device Tree selection ==
== Disable Automatic Device Tree selection ==
Line 223: Line 223:
> saveenv
> saveenv
</pre>
</pre>
Will select device tree that has SD and NAND regardless if the SOM has WIFI.
Will select device tree that has SD and NAND flash regardless if the SOM has WiFi.
{{note|Comment:<br/>Make sure you don't set am illegal value like "imx6ul-var-dart-sd_nand.dtb" in a SOM that has eMMC flash.|info}}
{{note|Comment:<br/>Make sure you don't set am illegal value like "imx6ul-var-dart-sd_nand.dtb" in a SOM that has eMMC flash.|info}}


Line 243: Line 243:
|-
|-
| SPL-nand
| SPL-nand
| SPL built for NAND-Flash. The SPL is pre-u-boot SW component, required for DDR initialization
| SPL built for NAND flash. The SPL is pre-u-boot SW component, required for DDR initialization
|-
|-
| SPL-emmc
| SPL-emmc
| SPL built for SD-Card and eMMC boot. The SPL is pre-u-boot SW component, required for DDR initialization
| SPL built for SD card and eMMC boot. The SPL is pre-u-boot SW component, required for DDR initialization
|-
|-
| u-boot.bin.nand
| u-boot.bin.nand
| U-Boot built for NAND Flash.
| U-Boot built for NAND flash.
|-
|-
| u-boot.bin.emmc
| u-boot.bin.emmc
| u-boot built for SD-Card boot, or eMMC boot in case of DART-MX6UL.
| u-boot built for SD card boot, or eMMC boot in case of DART-MX6UL.
|-
|-
! scope="col" | Device Tree Name<br/>
! scope="col" | Device Tree Name<br/>
Line 258: Line 258:
|-
|-
| imx6ul-var-dart-emmc_wifi.dtb
| imx6ul-var-dart-emmc_wifi.dtb
| Boot from internal eMMC with WI-FI enabled. (SDCARD & NAND disabled)
| Boot from internal eMMC with WiFi enabled. (SD card & NAND flash disabled)
|-
|-
| imx6ul-var-dart-nand_wifi.dtb
| imx6ul-var-dart-nand_wifi.dtb
| Boot from internal NAND with WI-FI enabled. (SDCARD & eMMC disabled)
| Boot from internal NAND flash with WiFi enabled. (SD card & eMMC disabled)
|-
|-
| imx6ul-var-dart-sd_emmc.dtb
| imx6ul-var-dart-sd_emmc.dtb
| SDCARD and eMMC enabled (WIFI & NAND disabled). You can boot from eMMC or SDCARD
| SD card and eMMC enabled (WiFi & NAND disabled). You can boot from eMMC or SD card
|-
|-
| imx6ul-var-dart-sd_nand.dtb
| imx6ul-var-dart-sd_nand.dtb
| SDCARD and NAND enabled (WIFI & eMMC disabled). You can boot from NAND or SDCARD
| SD card and NAND flash enabled (WiFi & eMMC disabled). You can boot from NAND flash or SD card
|-
|-
|}
|}
Line 292: Line 292:
|}
|}


= Flash images to NAND and eMMC =
= Flash images to NAND flash and eMMC =


To flash images on NAND, on the device, as '''root''', run the following command:
To flash images on NAND flash, on the device, as '''root''', run the following command:
<pre>
<pre>
# debian-nand.sh
# debian-nand.sh

Revision as of 11:59, 12 January 2017

DART-6UL - Debian Jessie release R2

Overview

This page describes how to assemble and install debian distro (jessie) on Variscite board mx6ul-var-dart.

This instruction was tested with Debian 8.4 x64 (jessie) and Ubuntu 14.04/16.04 x64! When using other distributions, there may be problems.

Create build environment

Installing required packages

Debian jessie x64

If your system does not have "sudo", set the "sudo" using the link: [1]

On your Debian building machine:

$ sudo apt-get install -y binfmt-support qemu qemu-user-static debootstrap kpartx
$ sudo apt-get install -y lvm2 dosfstools gpart binutils git lib32ncurses5-dev python-m2crypto
$ sudo apt-get install -y gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev
$ sudo apt-get install -y autoconf libtool libglib2.0-dev libarchive-dev
$ sudo apt-get install -y python-git xterm sed cvs subversion coreutils texi2html bc
$ sudo apt-get install -y docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils libgl1-mesa-dev
$ sudo apt-get install -y libglu1-mesa-dev mercurial automake groff curl lzop asciidoc u-boot-tools mtd-utils

Ubuntu 14.04/16.04 x64

On your Ubuntu building machine:

$ sudo apt-get install -y binfmt-support qemu qemu-user-static debootstrap kpartx
$ sudo apt-get install -y lvm2 dosfstools gpart binutils git lib32ncurses5-dev python-m2crypto
$ sudo apt-get install -y gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev
$ sudo apt-get install -y autoconf libtool libglib2.0-dev libarchive-dev
$ sudo apt-get install -y python-git xterm sed cvs subversion coreutils texi2html bc
$ sudo apt-get install -y docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils libgl1-mesa-dev
$ sudo apt-get install -y libglu1-mesa-dev mercurial automake groff curl lzop asciidoc u-boot-tools mtd-utils

Deploy source

Download archive contains the build script and support files for building Debian (Jessie) for this board:

$ cd ~
$ git clone https://github.com/varigit/debian-var.git -b debian_jessie_mx6ul_var02 var_mx6ul_dart_debian

Create environment (Internet connection should be available):

$ cd ~/var_mx6ul_dart_debian
$ ./make_var_mx6ul_dart_debian.sh -c deploy

This environment prepared to build.

Make Debian

Build all

Internet connection should be available

$ cd ~/var_mx6ul_dart_debian
$ sudo ./make_var_mx6ul_dart_debian.sh -c all | tee 2.log

Build by parts

Build rootfs

Internet connection should be available

$ cd ~/var_mx6ul_dart_debian
$ sudo ./make_var_mx6ul_dart_debian.sh -c rootfs

Build kernel, dtb files and kernel modules

$ cd ~/var_mx6ul_dart_debian
$ sudo ./make_var_mx6ul_dart_debian.sh -c kernel
$ sudo ./make_var_mx6ul_dart_debian.sh -c modules

Build bootloader

$ cd ~/var_mx6ul_dart_debian
$ sudo ./make_var_mx6ul_dart_debian.sh -c bootloader

Pack rootfs

For the create archive root file system (rootfs.tar.bz2) and image ubi (rootfs.ubi.img) run the following commands:

$ cd ~/var_mx6ul_dart_debian
$ sudo ./make_var_mx6ul_dart_debian.sh -c rtar
$ sudo ./make_var_mx6ul_dart_debian.sh -c rubi

Create boot SD card

  1. Follow the steps for make rootfs, kernel, bootloader: go;
  2. Insert the SD card to card reader connected to a host system;
  3. Run the following commands (Caution! All data on the card will be destroyed):
$ cd ~/var_mx6ul_dart_debian
$ sudo ./make_var_mx6ul_dart_debian.sh -c sdcard -d /dev/sdX

where '/dev/sdX' path to the block SD device in your system.

Successful process log

I: Flashing U-Boot
35+0 records in
35+0 records out
35840 bytes (36 kB) copied, 0.0773679 s, 463 kB/s
237+1 records in
237+1 records out
243104 bytes (243 kB) copied, 0.720032 s, 338 kB/s
I: Flashing "BOOT-VARSOM" partition
I: Flashing "rootfs" partition
I: Copying Debian images to /opt/images/Debian
I: Copying NAND U-Boot to /opt/images/Debian
I: Copying MMC U-Boot to /opt/images/Debian
I: Copying scripts to /opt/images/Debian
I: Sync sdcard...
I: Done make sdcard!
I: 
I: Command: "sdcard" end. Exit code: 0
I: 

Boot board with a bootable SD card

Note: Boot from SD card eliminates Wifi as the Wifi and SD card are using same SDIO interface.
A typical use-case, is to boot from SD card, flash eMMC or NAND flash, and re-boot form eMMC/NAND flash to have Wi-Fi operational.

Setting board dip-switches

Booting your system requires switching the relevant dip-switch to "Boot from SD card". See picture below.

Boot switch 6ul1.jpg


  • "00" - Boot from SD card - The picture mode
  • "01" - Boot from eMMC
  • "10" - Boot from NAND flash
  • "11" is illegal.

Be aware that your SOM has either eMMC or NAND flash but never both !

To boot board with SD card, Follow the steps below:

  • Power-off the board.
  • Insert the SD card into the SD/MMC slot of the carrier board (DVK)
  • Switch the relevant dip-switch to "Boot from SD card"
  • Power-up board
  • The board will automatically boot into Linux from SD card

Automatic device Tree selection in U-Boot

Upon reset you will see the U-BOOT-SPL printouts. It will print also the SOM configuration:
On-SOM storage: SD only, eMMC, NAND.
WIFI if chip exits.
For example:

U-Boot SPL 2015.10-00532-g482dc88 (Jan 03 2016 - 10:05:42)
i.MX6UL SOC 
Part number: DART-6U-A01
Assembly: AS11
Date of production: 2015 Dec 31
DART-6UL configuration: eMMC WIFI
Ram size: 512
Boot Device: SD

As explained in the above Build Results table we have 4 optional configurations.
We implemented in U-BOOT and automatic device tree selection, so when kernel boots, the u-boot will load the corresponding device tree according to On-SOM configuration.

Boot From
SOM Internal FLASH
SOM has WIFI/BT
Device Tree selected
SD eMMC Don't Care imx6ul-var-dart-sd_emmc.dtb
SD NAND Don't Care imx6ul-var-dart-sd_nand.dtb
eMMC eMMC Yes imx6ul-var-dart-emmc_wifi.dtb
eMMC eMMC NO imx6ul-var-dart-sd_emmc.dtb
NAND NAND YES imx6ul-var-dart-nand_wifi.dtb
NAND NAND NO imx6ul-var-dart-sd_nand.dtb

Note: Boot from SD card eliminates Wifi as the Wifi and SD card are using same SDIO interface.
A typical use-case, is to boot from SD card, flash eMMC or NAND flash, and re-boot form eMMC/NAND flash to have Wi-Fi operational.

Disable Automatic Device Tree selection

To disable the automatic device tree selection in u-boot:

> setenv var_auto_fdt_file N
> saveenv

Now you can set the device tree to meet your requirments. For example:

> setenv fdt_file imx6ul-var-dart-sd_emmc.dtb
> saveenv

Will select device tree that has SD and eMMC regardless if the SOM has WIFI.

> setenv fdt_file imx6ul-var-dart-sd_nand.dtb
> saveenv

Will select device tree that has SD and NAND flash regardless if the SOM has WiFi.

Comment:
Make sure you don't set am illegal value like "imx6ul-var-dart-sd_nand.dtb" in a SOM that has eMMC flash.

Build Results

The resulted images are located in ~/var_mx6ul_dart_debian/output/.

Image Name
How to use
rootfs.tar.bz2 Used to create sdcard and rootfs.ubi.img
rootfs.ubi.img Use for flash to nand
zImage Linux kernel image
SPL-nand SPL built for NAND flash. The SPL is pre-u-boot SW component, required for DDR initialization
SPL-emmc SPL built for SD card and eMMC boot. The SPL is pre-u-boot SW component, required for DDR initialization
u-boot.bin.nand U-Boot built for NAND flash.
u-boot.bin.emmc u-boot built for SD card boot, or eMMC boot in case of DART-MX6UL.
Device Tree Name
Boot Device
imx6ul-var-dart-emmc_wifi.dtb Boot from internal eMMC with WiFi enabled. (SD card & NAND flash disabled)
imx6ul-var-dart-nand_wifi.dtb Boot from internal NAND flash with WiFi enabled. (SD card & eMMC disabled)
imx6ul-var-dart-sd_emmc.dtb SD card and eMMC enabled (WiFi & NAND disabled). You can boot from eMMC or SD card
imx6ul-var-dart-sd_nand.dtb SD card and NAND flash enabled (WiFi & eMMC disabled). You can boot from NAND flash or SD card

Linux console access

User name
User password
User descriptor
root root system administrator
user user local user
xuser used for X session access

Flash images to NAND flash and eMMC

To flash images on NAND flash, on the device, as root, run the following command:

# debian-nand.sh

If you wanr to flash images on eMMC, on the device, as root, run the following command:

# debian-emmc.sh

Both the above commands are located in /usr/bin folder of uSD card used to boot debian.