iMX7-CM Yocto Linux: Difference between revisions
Jump to navigation
Jump to search
Add I2C EEPROM test |
Add building of Yocto Zeus or Dunfell |
||
| Line 1: | Line 1: | ||
{{#vardefine:HARDWARE_NAME|i.MX7-CM}} <!-- | {{#vardefine:HARDWARE_NAME|i.MX7-CM}} <!-- | ||
-->{{#vardefine:YOCTO_NAME|Dunfell}} <!-- | |||
-->{{#vardefine:YOCTO_NAME| | |||
-->{{#vardefine:BUILD_FOLDER|~/ronetix-fslc-yocto}} <!-- | -->{{#vardefine:BUILD_FOLDER|~/ronetix-fslc-yocto}} <!-- | ||
-->{{#vardefine:MACHINE_NAME|imx7-cm}} <!-- | -->{{#vardefine:MACHINE_NAME|imx7-cm}} <!-- | ||
-->{{#vardefine:CURL|curl}} <!-- | -->{{#vardefine:CURL|curl}} <!-- | ||
| Line 11: | Line 9: | ||
The Yocto Project is an open source collaboration project that helps developers create custom Linux-based systems for embedded products, regardless of the hardware architecture.<br> | The Yocto Project is an open source collaboration project that helps developers create custom Linux-based systems for embedded products, regardless of the hardware architecture.<br> | ||
This article show how to build Yocto Image for i.MX7-CM CPU module using:<br> | This article show how to build Yocto Image for i.MX7-CM CPU module using:<br> | ||
U-BOOT | {| class="wikitable" | ||
|- | |||
! | |||
! Linux Kernel | |||
! U-BOOT | |||
|- | |||
| Yocto Dunfell | |||
| 5.4.105 | |||
| v2020.04 | |||
|- | |||
| Yocto Zeus | |||
| 4.19.35 | |||
| v2019-10 | |||
|} | |||
[https://www.yoctoproject.org/docs/ Learn more about Yocto] | [https://www.yoctoproject.org/docs/ Learn more about Yocto] | ||
| Line 34: | Line 44: | ||
[https://www.yoctoproject.org/docs/2.6/brief-yoctoprojectqs/brief-yoctoprojectqs.html#brief-build-system-packages on the Yocto official site] | [https://www.yoctoproject.org/docs/2.6/brief-yoctoprojectqs/brief-yoctoprojectqs.html#brief-build-system-packages on the Yocto official site] | ||
= Download Yocto | = Download Yocto based on Freescale Community BSP = | ||
$ git config --global user.name "Your Name" | $ git config --global user.name "Your Name" | ||
| Line 47: | Line 57: | ||
$ cd {{#var:BUILD_FOLDER}} | $ cd {{#var:BUILD_FOLDER}} | ||
* '''Download the | * '''Download the Yocto repository'''<br> | ||
$ repo init -u https://github.com/ronetix/bsp-repo | $ repo init -u https://github.com/ronetix/bsp-repo -u dunfell | ||
or | |||
$ repo init -u https://github.com/ronetix/bsp-repo -u zeus | |||
$ repo sync | $ repo sync | ||
Revision as of 11:54, 9 April 2021
Overview
The Yocto Project is an open source collaboration project that helps developers create custom Linux-based systems for embedded products, regardless of the hardware architecture.
This article show how to build Yocto Image for i.MX7-CM CPU module using:
| Linux Kernel | U-BOOT | |
|---|---|---|
| Yocto Dunfell | 5.4.105 | v2020.04 |
| Yocto Zeus | 4.19.35 | v2019-10 |
Installing required packages
Please make sure your host PC is running Ubuntu 18.04+ 64-bit and install the following packages:
$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \ build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \ xz-utils debianutils iputils-ping libsdl1.2-dev xterm $ sudo apt-get install autoconf libtool libglib2.0-dev libarchive-dev python-git \ sed cvs subversion coreutils texi2html docbook-utils python-pysqlite2 \ help2man make gcc g++ desktop-file-utils libgl1-mesa-dev libglu1-mesa-dev \ mercurial automake groff curl lzop asciidoc u-boot-tools dos2unix mtd-utils pv \ libncurses5 libncurses5-dev libncursesw5-dev libelf-dev zlib1g-dev bmap-tools
More details about the Yocto Environment Setup can be found on the Yocto official site
Download Yocto based on Freescale Community BSP
$ git config --global user.name "Your Name" $ git config --global user.email "Your Email"
$ mkdir ~/bin $ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo $ chmod a+x ~/bin/repo $ export PATH=~/bin:$PATH
$ mkdir ~/ronetix-fslc-yocto $ cd ~/ronetix-fslc-yocto
- Download the Yocto repository
$ repo init -u https://github.com/ronetix/bsp-repo -u dunfell or $ repo init -u https://github.com/ronetix/bsp-repo -u zeus
$ repo sync
Setup and build Yocto
$ MACHINE=imx7-cm DISTRO=fslc-x11 . setup-environment build_x11 $ bitbake fsl-image-gui
Build Results
The resulted images are located in tmp/deploy/images/imx7-cm.
Create a bootable SD card
Replace sdX with the right device name.
$ umount /dev/sdX1 $ umount /dev/sdX2 $ sudo bmaptool copy tmp/deploy/images/imx7-cm/fsl-image-gui-imx7-cm.wic.gz /dev/sdX
WiFi Setup
Scan for wireless networks:
$ ifconfig wlan0 up $ iw dev wlan0 scan | grep SSID
Connecting to an Access Point:
$ wpa_passphrase <YourAP> <YourPassword> > /etc/wpa_supplicant.conf $ wpa_supplicant -B -D nl80211 -i wlan0 -c /etc/wpa_supplicant.conf
wait for:
$ wlcore: Association completed.
Get an IP via DHCP:
$ udhcpc -i wlan0 $ ifconfig
Audio Test
List all sound cards:
$ aplay -L
Play a file:
$ aplay Test.wav
List all sound controls:
$ amixer controls
Set Speaker Playback volume to max:
$ amixer cset numid=13 127
QSPI NOR Flash test
$ mtd_debug info /dev/mtd0 $ mtd_debug erase /dev/mtd0 0 0x10000 $ dd if=/dev/urandom of=tmp_write.txt bs=1024 count=64 $ dd if=tmp_write.txt of=/dev/mtd0 bs=1024 count=64 $ dd if=/dev/mtd0 of=tmp_read.txt bs=1024 count=64 $ diff tmp_write.txt tmp_read.txt $ hexdump -C tmp_read.txt | more
I2C EEPROM Test
$ echo "Ronetix GmbH" > /sys/bus/i2c/devices/0-0050/eeprom $ cat /sys/bus/i2c/devices/0-0050/eeprom > eeprom.bin $ hexdump -C eeprom.bin