> For the complete documentation index, see [llms.txt](https://docs.yoctotutor.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yoctotutor.com/viyara-i.mx6ull.md).

# VIYARA I.MX6ull

## <mark style="color:blue;">1. Hardware Requirements</mark>

* [ ] Viyara I.MX6ull Board

<figure><img src="/files/T0zwwjDIfzzcBcg5s7b1" alt="" width="180"><figcaption></figcaption></figure>

* [ ] Micro USB cable (power supply)

<figure><img src="/files/zpdumB3V7RlQUeYRnqwL" alt=""><figcaption></figcaption></figure>

* [ ] USB TTL converter (serial console)

<figure><img src="/files/ZtKMF4tk7NslHaFQf3lH" alt="" width="188"><figcaption></figcaption></figure>

* [ ] patch cards

<figure><img src="/files/Io8pQucOqy4u2O0dmmiT" alt="" width="73"><figcaption></figcaption></figure>

* [ ] SDCARD

<figure><img src="/files/FcIHU7NgR5V68mmaIybS" alt="" width="125"><figcaption></figcaption></figure>

* [ ] Card Reader

<figure><img src="/files/mANnYznVlrFr4OyfyN3x" alt="" width="125"><figcaption></figcaption></figure>

## <mark style="color:blue;">2. Software Requirements</mark>

1. Requirements
2. Toolchain setup
3. uboot&#x20;
4. Linux kernel

### <mark style="color:blue;">2.1 Requirements:</mark>

1. ubuntu PC 16.04+ LTS
2. Download below dependencies

```
sudo apt-get update
sudo  apt-get -y upgrade
sudo apt install -y gawk wget flex bison git diffstat unzip texinfo gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev python3-subunit mesa-common-dev zstd liblz4-tool file locales

```

### <mark style="color:blue;">2.2 Toolchain Setup</mark>

follow below steps

```
For UBUNTU 20.04
*****************
for others you check gcc-  press TAB you will gcc get version
sudo apt-get install gcc-10-arm-linux-gnueabihf
sudo apt-get install gcc-10-arm-linux-gnueabihf-base

if you have issue with arm-linux-gnueabihf-gcc not found
then goto cd /usr/bin
sudo ln -sf arm-linux-gnueabihf-gcc-10 arm-linux-gnueabihf-gcc


Other Ubuntu versions
*******************************************************
https://www.dropbox.com/scl/fi/sjrhails1jxorr5915p4e/fsl-imx-fb-glibc-x86_64-meta-toolchain-cortexa7t2hf-neon-mys-6ull-toolchain-5.10-gatesgarth.sh?rlkey=ystecozp00s288fpbnatmba7z&dl=

chmod +x fsl-imx-fb-glibc-x86_64-meta-toolchain-cortexa7t2hf-neon-mys-6ull-toolchain-5.10-gatesgarth.sh
./fsl-imx-fb-glibc-x86_64-meta-toolchain-cortexa7t2hf-neon-mys-6ull-toolchain-5.10-gatesgarth.sh

source environment-setup-cortexa7t2hf-neon-poky-linux-gnueabi
in terminal type "arm-"  and press tab 2 times quickly to see toolchain

```

### <mark style="color:blue;">2.3 U-Boot</mark>

```
//
mkdir ~/yoctotutor
cd ~/yoctotutor
git clone https://github.com/viyaraembedded/viyara-imx-uboot.git
cd viyara-imx-uboot
git checkout imx_2020.04
 
setup toolchain
****************

export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-

make mrproper
make ve_imx6ull_nand_ddr256_defconfig
make

# here u-boot-dtb.imx is binary
```

#### <mark style="color:blue;">2.3.1  test U-boot on board</mark>

&#x20;<mark style="color:red;">**IMP Note:**</mark> before flash uboot make sdcard partion using gpart

```
uboot binary name: u-boot-dtb.imx 
        we will flash "u-boot-dtb.imx" to sdcard RAW partintion
Connect MicroSD card to ubuntu PC
run the below command in uboot dir
sudo dd if=u-boot-dtb.imx of=/dev/sdX bs=1K seek=1 && sync
        Note: here mysdcard connected as /dev/sdc check yours using df -h
remove SDcard and connect to board.
power on board using Micro USB cable
```

Jumper settings: Boot Mode

**SDcard**:  **0 0 1 0                 # 0 - down          1- up**&#x20;

**Nand :   1 0 0 1**

### <mark style="color:blue;">2.4 Linux Kernel</mark>

#### <mark style="color:blue;">2.4.1 Download Linux</mark>

```
// 
cd ~/yoctotutor
git clone https://github.com/viyaraembedded/viyara-imx-linux.git
cd viyara-imx-linux
git checkout viyara_lf-5.10.y

setup toolchain
****************

export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-

make mrproper
make ve_6ulx_defconfig
make -j4
```

<mark style="color:blue;">**2.4.2 Output binaries:**</mark> <mark style="color:blue;"></mark> &#x20;

`zImage                                         # present in arch/arm/boot/`

&#x20;                  `# present in arch/arm/boot/dts`

<mark style="color:blue;">**2.4.3 copy binaries to sdcard**</mark>

`cd arch/arm/boot/`

`cp zImage /media/${USER}/BOOT/`&#x20;

`cp dts/mys-6ull-14x14-gpmi-weim.dtb /media/${USER}/BOOT/`

#### <mark style="color:blue;">**Onboard Flashing Images for SDcrad:**</mark>

<mark style="color:red;">**Note:**</mark>**&#x20;connect sdcard to board and run below commands in uboot to flash kernel images**&#x20;

```
=> setenv mmcroot '/dev/mmcblk0p2 rootwait rw rootdelay=5 mem=256M'
=> run mmcargs
=> fatload mmc 0 0x83000000 zImage
	8649272 bytes read in 384 ms (21.5 MiB/s)
=> fatload mmc 0 0x84000000 mys-6ull-14x14-gpmi-weim.dtb
	35858 bytes read in 10 ms (3.4 MiB/s)
=> bootz 0x83000000 - 0x84000000 
```

#### <mark style="color:blue;">**RootFS**</mark> <mark style="color:blue;"></mark><mark style="color:blue;">for imx6ull</mark>

{% embed url="<https://tftp.yoctotutor.com/elinux/mys6ulx/myir-image-core-mys-6ull.tar.bz2>" %}
this contains only rootfs
{% endembed %}

download the rootfs from above link and extract using below link

**`tar -xvf  default-images-mys-6ulx.tar.bz2 -C /media/${USER}/rootfs`**

`sync`

#### <mark style="color:blue;">How make sdcard partiton</mark>

[https://support.criticallink.com/redmine/projects/imx6/wiki/Creating\_a\_Bootable\_SD\_Ca**rd**](https://support.criticallink.com/redmine/projects/imx6/wiki/Creating_a_Bootable_SD_Card)

<mark style="color:green;">**Default images all:**</mark> <mark style="color:green;"></mark><mark style="color:green;">uboot, kernel, rootfs</mark>

<https://tftp.yoctotutor.com/elinux/mys6ulx/default-images-mys-6ulx.tar.bz2>
