Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Nächste Überarbeitung
Vorhergehende Überarbeitung
software:linux:toradex:loading [2018-12-21 11:00] – Externe Bearbeitung 127.0.0.1software:linux:toradex:loading [Unbekanntes Datum] (aktuell) – gelöscht - Externe Bearbeitung (Unbekanntes Datum) 127.0.0.1
Zeile 1: Zeile 1:
-====== Toradex Colibri i.MX6 ====== 
- 
-===== Loading Image to a Board ===== 
-==== RS232 Console ==== 
- 
-A login shell can be accessed through UART-A on the Colibri Evaluation board with a null modem cable. The communication settings are: 115200 8N1.\\ 
-If you are using our [[embedded_systems:imx6:cb|Controller Board (cb20)]] you need a special USB/TTL-Serial-UART converter cable. The connector on the board is a 6-pin SIL connector, e.g. [[http://ch.farnell.com/ftdi/ttl-232r-3v3/kabel-usb-ttl-pegel-seriell-umsetzung/dp/1329311]]  
- 
-==== Loading new Kernel ==== 
-For the Colibri iMX6 of Toradex we have a customized standard Preempt-RT Kernel (3.14) with Buildroot rootfs and device tree available. These images can be downloaded from our FTP: ''inf004/ftp/colibri_imx6/RT/'' 
- 
-Copy the uImage and the DTB onto a FTP server. Turn the evaluation board on and interrupt autoboot by hitting any key. First you have to set the u-boot variables for the network settings. Serverip must be set to the ip address of your FTP and ipaddr must be the address under which your Colibri board can be reached in your network. 
-<code> 
-uboot> setenv serverip 146.136.xx.xx 
-uboot> setenv netmask 255.255.252.0 
-uboot> setenv ipaddr 146.136.xx.xx 
-uboot> saveenv 
-</code> 
- 
-Load and save the uImage from the FTP server: 
- 
-<code> 
-uboot> tftp $loadaddr uImage 
-</code> 
- 
-Override the existing uImage with the new one: 
- 
-<code> 
-uboot> fatwrite mmc 0:1 $loadaddr uImage $filesize 
-</code> 
- 
-Load the DTB: 
- 
-<code> 
-uboot> tftp $loadaddr imx6dl-colibri-cb20.dtb 
-</code> 
- 
-Write DTB to flash: 
- 
-<code> 
-uboot> fatwrite mmc 0:1 $loadaddr imx6dl-colibri-cb20.dtb $filesize 
-</code> 
- 
-Change to desired DTB-File for boot: 
-<code> 
-uboot> setenv fdt_file imx6dl-colibri-cb20.dtb 
-</code> 
- 
-==== Loading new rootfs ==== 
-Copy rootfs and MBR onto your FTP server and same as loading a new Kernel, interrupt autoboot by hitting any key after power-up. Load the rootfs and MBR: 
- 
-Load MBR: 
-<code> 
-uboot> tftp $loadaddr mbr.img 
-</code> 
- 
-Write MBR to MMC: 
-<code> 
-uboot> mmc write $loadaddr 0 1 
-</code> 
-Afterwards the Partition Map for MMC device 0 should look as follows: 
-<code> 
-uboot> mmc part 
- 
-Partition Map for MMC device 0  --   Partition Type: DOS 
- 
-Part    Start Sector    Num Sectors     UUID            Type 
-  1     8192            32768           000bb5ae-01     06 Boot 
-  2     40960           262144          000bb5ae-02     83 
-  3     303104          3891200         000bb5ae-03     83 
-</code> 
- 
-Load the rootfs image: 
-<code> 
-uboot> tftp $loadaddr rootfs.ext2 
- 
-done 
-Bytes transferred = 100995072 (6051000 hex) 
-</code> 
- 
-The rootfs has to be loaded to the rootfs partition (3), the start address has to be converted to hex: 303104 -> 0x4A000 
-The number of blocks for mmc write has to be calculated out of the filesize, which can be seen above: 100995072/512=197256 -> 0x30288. So check the size of your image and calculate the corresponding size. 
-<code> 
-uboot> mmc write $loadaddr 4a000 30288 
-</code> 
- 
-Change emmcargs: 
-<code> 
-uboot> setenv emmcargs ip=off root=/dev/mmcblk0p3 rw,noatime rootfstype=ext4 rootwait 
-</code> 
- 
-Save the new Environment variable: 
-<code> 
-uboot> saveenv 
-</code> 
-After booting do not forget to run the init script as described in [[.:rootfs]]. 
- 
-===== Crossdeveloping Applications ===== 
-If you use our standard rootfs as described above, you have GCC 5.3 installed. For crossdevelopment you need the same toolchain (same gcc and library version) on the host and the target. Download this toolchain from out FTP: ''inf004/ftp/colibri_imx6/RT/host_tc_arm_gcc5_3_RT.zip'' and extract with 
-<code> 
-$ tar –xzvf host_tc_arm_gcc5_3_RT.zip 
-</code> 
-To build an application for that system, provide CMake the path to the CMake toolchainfile. This file can be found in your toolchain folder and from there navigate to ''/usr/share/buildroot/toolchainfile.cmake''. 
- 
-  * [[ .:ubuntu_toolchain | Toolchain (for applications) ]] 
- 
-===== Accessing the UART's ===== 
-UART-A (used for console, see above) and UART-B can be accessed on the cb20 board. Both can be written to with 
-<code> 
-echo "hello world" | sudo tee /dev/ttymxc0    # for console 
-echo "hello world" | sudo tee /dev/ttymxc1    # for UART-B 
-</code> 
- 
-===== Build new System Images ===== 
-==== System Setup ==== 
- 
-Environment variables are used for building the components. On the first time, everything has to be build in the correct order. The first variable is the working directory: 
- 
-<code> 
-$ cd path/to/working/dir 
-$ export WD=$(pwd) 
-</code> 
- 
-  * [[ .:toolchain | Toolchain (for the kernel and modules) ]] 
-  * [[ .:bootloader | Bootloader ]] 
-  * [[ .:kernel_old | Kernel ]] 
-  * [[ .:devicetree | Device Tree ]] 
-  * [[ .:eim | EIM driver ]] 
-  * [[ .:rootfs | Root FS ]] 
-  * [[ .:wifi | WiFi on iMX6]] 
- 
- 
-After the first complete build, the environment variables can be set by a script (env.sh): 
- 
-<code> 
-export WD=/home/userXY/path/to/working/dir 
-export PATH=$WD/buildroot/output/host/usr/bin:$PATH 
-export PATH=$WD/u-boot/tools:$PATH 
-export ARCH=arm 
-export CROSS_COMPILE=arm-buildroot-linux-uclibcgnueabihf- 
-export KERNELDIR=$EFS/linux 
-</code> 
- 
-Source this script to load the variables: 
- 
-<code> 
-$ . env.sh 
-</code> 
- 
- 
-