VAR-SOM-MX7 Debian Jessie R2: Difference between revisions
(Created MX7 Debian Jessie R2 page) |
|||
(One intermediate revision by the same user not shown) | |||
Line 161: | Line 161: | ||
| zImage | | zImage | ||
| Linux kernel image | | Linux kernel image | ||
|- | |||
| SPL.nand | |||
| SPL built for NAND Flash. | |||
|- | |||
| SPL.emmc | |||
| SPL built for SD Card/eMMC | |||
|- | |- | ||
| u-boot.img.nand | | u-boot.img.nand | ||
Line 166: | Line 172: | ||
|- | |- | ||
| u-boot.img.emmc | | u-boot.img.emmc | ||
| | | U-Boot built for SD Card/eMMC | ||
|- | |- | ||
! scope="col" | Device Tree Name<br/> | ! scope="col" | Device Tree Name<br/> | ||
Line 201: | Line 207: | ||
= Flash images to NAND and eMMC = | = Flash images to NAND and eMMC = | ||
To flash images to NAND, boot from SD card and run the following command '''root''': | To flash images to NAND, boot from SD card and run the following command as '''root''': | ||
<pre> | <pre> | ||
# debian-nand.sh | # debian-nand.sh | ||
</pre> | |||
To flash images with Cortex-M4 support to NAND, boot from SD card and run the following command as '''root''': | |||
<pre> | |||
# debian-nand.sh -m | |||
</pre> | </pre> | ||
To flash images to eMMC, boot from SD card and run the following command as '''root''': | To flash images to eMMC, boot from SD card and run the following command as '''root''':<br> | ||
(both regular device tree and device tree with Cortex-M4 support will be installed) | |||
<pre> | <pre> | ||
# debian-emmc.sh | # debian-emmc.sh | ||
</pre> | </pre> | ||
Both the above | Both the above scripts are located in /usr/bin folder of uSD card used to boot Debian. | ||
= How-to: Test and use an Interface = | = How-to: Test and use an Interface = |
Latest revision as of 14:20, 21 March 2018
Overview
This page describes how to assemble and install Debian Jessie distribution on Variscite board VAR-SOM-MX7.
These instructions were 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_mx7_var02 var_som_mx7_debian
Create environment (Internet connection should be available):
$ cd ~/var_som_mx7_debian $ ./make_var_som_mx7_debian.sh -c deploy
This environment prepared to build.
Make Debian
Build all
Internet connection should be available
$ cd ~/var_som_mx7_debian $ sudo ./make_var_som_mx7_debian.sh -c all | tee 2.log
Build by parts
Build rootfs
Internet connection should be available
$ cd ~/var_som_mx7_debian $ sudo ./make_var_som_mx7_debian.sh -c rootfs
Build kernel, dtb files and kernel modules
$ cd ~/var_som_mx7_debian $ sudo ./make_var_som_mx7_debian.sh -c kernel $ sudo ./make_var_som_mx7_debian.sh -c modules
Build bootloader
$ cd ~/var_som_mx7_debian $ sudo ./make_var_som_mx7_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_som_mx7_debian $ sudo ./make_var_som_mx7_debian.sh -c rtar $ sudo ./make_var_som_mx7_debian.sh -c rubi
Create boot SD card
- Follow the steps for make rootfs, kernel, bootloader;
- Insert the SD card to card reader connected to a host system;
- Run the following commands (Caution! All data on the card will be destroyed):
$ cd ~/var_som_mx7_debian $ sudo ./make_var_som_mx7_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
A typical use-case, is to boot from SD-Card, program eMMC or NAND flash, and re-boot from eMMC/NAND.
Setting board dip-switches
Booting your system requires switching the relevant dip-switches to "Boot from SD-Card". See table below.
- "00" - Boot from SD
- "01" - Boot from NAND
- "10" - Boot from eMMC
- "11" - N/A
Be aware that your SOM has either eMMC or NAND 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"
- Power-up board
- The board will automatically boot into Linux from SD
Build Results
The resulted images are located in ~/var_mx7_var_som_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. |
SPL.emmc | SPL built for SD Card/eMMC |
u-boot.img.nand | U-Boot built for NAND Flash. |
u-boot.img.emmc | U-Boot built for SD Card/eMMC |
Device Tree Name |
Boot Device |
imx7d-var-som-emmc.dtb | Boot from SD or internal eMMC |
imx7d-var-som-nand.dtb | Boot from internal NAND |
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 and eMMC
To flash images to NAND, boot from SD card and run the following command as root:
# debian-nand.sh
To flash images with Cortex-M4 support to NAND, boot from SD card and run the following command as root:
# debian-nand.sh -m
To flash images to eMMC, boot from SD card and run the following command as root:
(both regular device tree and device tree with Cortex-M4 support will be installed)
# debian-emmc.sh
Both the above scripts are located in /usr/bin folder of uSD card used to boot Debian.
How-to: Test and use an Interface
Please see this section in the Yocto developer guide page. It is the same for Debian.
How-to: Modify kernel configuration
To modify kernel configuration (add/remove features and drivers) please follow the steps below:
1. cd ~/var_som_mx7_debian/src/kernel 2. Run "sudo make ARCH=arm mrproper" 3. Run "sudo make ARCH=arm imx7-var-som_defconfig" 4. Run "sudo make ARCH=arm menuconfig" 5. Navigate the menu and select the desired kernel functionality 6. Exit the menu and answer "Yes" when asked "Do you wish to save your new configuration?" 7. Run "sudo make ARCH=arm savedefconfig" 8. Run "sudo cp arch/arm/configs/imx7-var-som_defconfig arch/arm/configs/imx7-var-som_defconfig.orig 9. Run "sudo cp defconfig arch/arm/configs/imx7-var-som_defconfig 10. Follow the instructions above to rebuild kernel and modules, repack rootfs images and recreate SD card