Template:iMX8M-YOCTO: Difference between revisions
Fix a typo |
Add a new line |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 52: | Line 52: | ||
= Setup and build Yocto = | = Setup and build Yocto = | ||
{{#var:SETUP_BUILD_COMMENT}} | |||
$ MACHINE={{#var:MACHINE_NAME}} DISTRO=fslc-xwayland . setup-environment build_xwayland_{{#var:MACHINE_NAME}} | $ MACHINE={{#var:MACHINE_NAME}} DISTRO=fslc-xwayland . setup-environment build_xwayland_{{#var:MACHINE_NAME}} | ||
$ bitbake fsl-image-gui | $ bitbake fsl-image-gui | ||
== Building with Local Sources (externalsrc) == | |||
To build using local copies of the Linux kernel and U-Boot rather than fetching from remote repositories, append the following lines to<br> | |||
<code>./build_xwayland_{{#var:MACHINE_NAME}}/conf/local.conf</code>: | |||
<pre> | |||
INHERIT += "externalsrc" | |||
EXTERNALSRC_pn-linux-ronetix = "${HOME}/work/linux-ronetix" | |||
EXTERNALSRC_pn-u-boot-ronetix = "${HOME}/work/u-boot" | |||
</pre> | |||
== Build Results == | == Build Results == | ||
The resulted images are located in tmp/deploy/images/{{#var:MACHINE_NAME}}. | The resulted images are located in tmp/deploy/images/{{#var:MACHINE_NAME}}. | ||
Latest revision as of 12:53, 13 September 2026
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 CPU module using:
| Linux Kernel | U-BOOT | |
|---|---|---|
| Yocto |
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 ~/yocto-ronetix $ cd ~/yocto-ronetix
- Download the Yocto repository
$ repo init -u https://github.com/ronetix/bsp-repo -b
$ repo sync
Setup and build Yocto
$ MACHINE= DISTRO=fslc-xwayland . setup-environment build_xwayland_ $ bitbake fsl-image-gui
Building with Local Sources (externalsrc)
To build using local copies of the Linux kernel and U-Boot rather than fetching from remote repositories, append the following lines to
./build_xwayland_/conf/local.conf:
INHERIT += "externalsrc"
EXTERNALSRC_pn-linux-ronetix = "${HOME}/work/linux-ronetix"
EXTERNALSRC_pn-u-boot-ronetix = "${HOME}/work/u-boot"
Build Results
The resulted images are located in tmp/deploy/images/.
Create a bootable SD card
Replace sdX with the right device name.
$ umount /dev/sdX1 $ umount /dev/sdX2 $ sudo bmaptool copy tmp/deploy/images//fsl-image-gui-.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
Camera Test
$ v4l2-ctl --list-devices $ gst-launch-1.0 v4l2src num-buffers=1 ! jpegenc ! filesink location=test.jpg