User Tools

Site Tools


agl-distro:agl-raspberrypi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
agl-distro:agl-raspberrypi [2017/02/16 20:48]
jsmoeller [Booting AGL Demo Platform on Raspberry Pi]
agl-distro:agl-raspberrypi [2020/03/05 15:46]
leonanavi Set Raspberry Pi 4 as recommended
Line 3: Line 3:
 AGL has been initially ported to Raspberry Pi 2 and 3 by Leon Anavi thanks to the existing knowledge for enabling hardware graphics acceleration in Wayland and Weston from the Tizen Project and GENIVI Development Platform. AGL has been initially ported to Raspberry Pi 2 and 3 by Leon Anavi thanks to the existing knowledge for enabling hardware graphics acceleration in Wayland and Weston from the Tizen Project and GENIVI Development Platform.
  
-Follow the [[agl-distro:​source-code|general steps for building AGL]], download master branch and set **raspberrypi2** or **raspberrypi3** as a machine depending on the version and the model of your Raspberry Pi.+Follow the [[agl-distro:​source-code|general steps for building AGL]], download master branch and set **raspberrypi4** (recommended) ​or **raspberrypi3** as a machine depending on the version and the model of your Raspberry Pi. Support for Raspberry Pi 2 has been deprecated in the latest AGL releases.
  
-====== ​Download ​AGL Source Code ======+====== ​Introduction:​ Building target ​AGL image with Yocto project ​======
  
-The AGL source code and Yocto layers are maintained on the AGL Gerrit server. For information on how to create accounts for gerrit see Getting Started with AGL.+The standard ​Yocto process is made of the following steps:
  
-===== Prepare Repo Tool =====+  * Setting up your operating system. 
 +  * Setting up the build environment for R-Car BSP. 
 +  * Downloading the proprietary drivers and installing them in the build environment (if needed). 
 +  * Build the image. 
 +  * Boot using SD-CARD. 
 +    * Create an SD-CARD. 
 +    * Configure to boot on SD-CARD. 
 +    * Copy the image to the SD-CARD. 
 +    * Boot the board on it.
  
-AGL Uses the Repo tool for managing repositoriesFirst you need to setup layers ​of AGL. You can use the commands below to prepare Repo:+For convenience, ​the resulting development images are made available [[https://​download.automotivelinux.org/​AGL/​snapshots/​master/​latest/​|Here]] 
 + 
 +If you want to bypass the build phase and quick boot the board, you can download the image tarball and the kernel then follow the installation procedure. 
 + 
 +===== Setting up your operating system ===== 
 + 
 +The very first step is to ensure that your system can run the build system ​of the Yocto Project. 
 + 
 +**Important**:​ it only runs on Linux 
 + 
 +  * if your system is Windows© or iOS© you should use a virtualization solution (Virtualbox,​ VMWare ...) to run a Linux VM on your system. 
 + 
 +For AGL 2.1, Yocto Project 2.1, known as krogoth, has been selected for the BSP and build system. 
 + 
 +Reference data for configuring your system ​can be found in the Yocto documentation [[http://​www.yoctoproject.org/​docs/​2.0/​ref-manual/​ref-manual.html#​detailed-supported-distros|Here]] 
 + 
 +Here after an extract of this documentation for most common Linux distributions:​ 
 + 
 +  * The build system should be able to run on any modern distributions that has the following versions for: 
 +    * Python 
 +    * Git 1.7.8 or greater 
 +    * tar 1.24 or greater 
 +    * GCC, … 
 + 
 +=== Note: === 
 + 
 +  * Python 2.7.3 or greater excluding Python 3.x, which is not supported. 
 + 
 +==== Ubuntu and Debian ==== 
 + 
 +The essential and graphical support packages you need for a supported Ubuntu or Debian distribution are shown in the following command:
  
 <​code>​ <​code>​
-mkdir ~/bin +sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \ 
-export PATH=~/​bin:​$PATH +     build-essential chrpath socat libsdl1.2-dev xterm cpio curl
-curl https://​storage.googleapis.com/​git-repo-downloads/​repo > ~/bin/repo +
-chmod a+x ~/bin/repo+
 </​code>​ </​code>​
-===== Download Latest Stable Release =====+=== Note: ===
  
-To download all layers ​for the for the latest stable release, Blowfish 2.0.3:+  * Also note that for this tutorial, ​the utility '​curl'​ has been added to the list of packages to install. 
 + 
 +==== Fedora ==== 
 + 
 +The essential and graphical packages you need for a supported Fedora distribution are shown in the following command:
  
 <​code>​ <​code>​
-repo init -b blowfish ​-m default_blowfish_2.0.3.xml ​-u https://​gerrit.automotivelinux.org/​gerrit/​AGL/​AGL-repo +sudo yum install gawk make wget tar bzip2 gzip python unzip perl patch \ 
-repo sync+     ​diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath \ 
 +     ​ccache perl-Data-Dumper perl-Text-ParseWords perl-Thread-Queue socat \ 
 +     SDL-devel xterm curl
 </​code>​ </​code>​
-===== Download Latest on Blowfish Branch =====+==== OpenSUSE ​====
  
-To download all layers on the current release branch which may be in the midst of testing or changes prior to the next stable release:+The essential and graphical packages you need for a supported OpenSUSE distribution are shown in the following command:
  
 <​code>​ <​code>​
-repo init -b blowfish ​-u https://​gerrit.automotivelinux.org/​gerrit/​AGL/​AGL-repo +sudo zypper install python gcc gcc-c++ git chrpath make wget python-xml \ 
-repo sync+     diffstat texinfo python-curses patch socat libSDL-devel xterm curl
 </​code>​ </​code>​
-===== Download Master Branch =====+==== CentOS ​====
  
-To download all code from master:+The essential and graphical packages you need for a supported CentOS distribution are shown in the following command:
  
 <​code>​ <​code>​
-repo init -u https://​gerrit.automotivelinux.org/​gerrit/​AGL/​AGL-repo +sudo yum install gawk make wget tar bzip2 gzip python unzip perl patch \ 
-repo sync+     ​diffutils diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath \ 
 +     socat SDL-devel xterm curl
 </​code>​ </​code>​
-===== Set up Build Environment ​=====+====== Download AGL Source Code ======
  
-Set up the development environment ​for the desired target hardwareAGL has created a set up script for defining ​the target ​build and desired optional featuresTo get complete list of the options available run.+The AGL source code and Yocto layers are maintained on the AGL Gerrit server.\\ 
 +For information on how to create accounts ​for gerrit see [[start/​getting-started|Getting Started with AGL]]. 
 + 
 +===== Setting ​up the build environment ===== 
 + 
 +In the following, your top level directory is noted as “AGL_TOP”.\\ 
 +For example, we will set AGL_TOP to point to directory “$HOME/​workspace_agl”:​
  
 <​code>​ <​code>​
-  ​$ source ​meta-agl/scripts/aglsetup.sh -h+export AGL_TOP=$HOME/​workspace_agl 
 +mkdir -p $AGL_TOP 
 +</​code>​ 
 +===== Prepare Repo Tool ===== 
 + 
 +AGL Uses the '​repo'​ tool for managing repositories.\\ 
 +You need to setup layers of AGL.\\ 
 +You can use the commands below to prepare Repo: 
 + 
 +<​code>​ 
 +mkdir -p ~/bin 
 +export PATH=~/​bin:​$PATH 
 +curl https://​storage.googleapis.com/​git-repo-downloads/​repo > ~/​bin/​repo 
 +chmod a+x ~/​bin/​repo 
 +</​code>​ 
 +=== Note: === 
 + 
 +  * More information about the tool '​repo'​ [[https://source.android.com/​source/​using-repo.html|Here]] 
 + 
 +===== Download source ===== 
 + 
 +You can choose your source release 
 + 
 +==== Download Latest Stable Release ==== 
 + 
 +To download all layers for the for the latest stable release, flounder 6.0.4: 
 + 
 +<code bash> 
 +cd $AGL_TOP 
 +repo init -b flounder -m flounder_6.0.4.xml -u https://gerrit.automotivelinux.org/​gerrit/​AGL/​AGL-repo 
 +repo sync 
 +</​code>​ 
 +==== Download Latest ==== 
 + 
 +To download all layers on the current master branch which may be in the midst of testing or changes prior to the next stable release: 
 + 
 +<code bash> 
 +cd $AGL_TOP 
 +repo init -b master -u https://​gerrit.automotivelinux.org/​gerrit/​AGL/​AGL-repo 
 +repo sync
 </​code>​ </​code>​
-Once you run aglsetup.sh with your desired paramaters, you can build any target desired. 
  
 ===== Features supported by aglsetup ===== ===== Features supported by aglsetup =====
  
-Here is the list of features for AGL 2.that can be specified in the aglsetup.sh command line:+Here is the list of features for AGL 2.that can be specified in the aglsetup.sh command line:
  
   * in **meta-agl**   * in **meta-agl**
 +    * **agl-archiver**:​
     * **agl-devel**:​ activate development options (empty root password, debugger, strace, valgrind …)     * **agl-devel**:​ activate development options (empty root password, debugger, strace, valgrind …)
 +    * **agl-isafw**:​
     * **agl-netboot**:​ enable network boot support through TFTP and NBD (see meta-netboot layer)     * **agl-netboot**:​ enable network boot support through TFTP and NBD (see meta-netboot layer)
 +  * in **meta-agl-devel**
 +    * **agl-oem-extra-libs**:​
 +    * **agl-renesas-kernel**:​
   * in **meta-agl-extra**   * in **meta-agl-extra**
     * **agl-appfw-smack**:​ enables IoT.bzh Application Framework + SMACK + Cynara     * **agl-appfw-smack**:​ enables IoT.bzh Application Framework + SMACK + Cynara
Line 68: Line 160:
  
 ====== Building the AGL Demo Platform for Raspberry Pi ====== ====== Building the AGL Demo Platform for Raspberry Pi ======
 +
 +===== Raspberry Pi 4 (recommended) =====
 +
 +To build AGL demo platform for Raspberry Pi 4 use machine **raspberrypi4** and feature **agl-demo**:​
 +
 +<​code>​
 +source meta-agl/​scripts/​aglsetup.sh -m raspberrypi4 agl-demo agl-appfw-smack
 +bitbake agl-demo-platform
 +</​code>​
  
 ===== Raspberry Pi 3 ===== ===== Raspberry Pi 3 =====
Line 79: Line 180:
 ===== Raspberry Pi 2 ===== ===== Raspberry Pi 2 =====
  
-To build AGL demo platform for Raspberry Pi 2 use machine **raspberrypi2** and feature **agl-demo**:​+Raspberry Pi 2 support has been **deprecated** in the latest AGL releases. ​To build AGL demo platform for Raspberry Pi 2 use machine **raspberrypi2** and feature **agl-demo**:​
  
 <​code>​ <​code>​
Line 91: Line 192:
   * Connect your sdcard in your linux machine.   * Connect your sdcard in your linux machine.
   * Copy output image from build machine to linux machine that is connected your sdcard. (Often, those are same machines)   * Copy output image from build machine to linux machine that is connected your sdcard. (Often, those are same machines)
-  * Output Image location in build machine for Raspberry Pi 2: //​tmp/​deploy/​images/​raspberrypi2/​agl-demo-platform-raspberrypi2.rpi-sdimg// +  * Output Image location in build machine for Raspberry Pi 2: //​tmp/​deploy/​images/​raspberrypi2/​agl-demo-platform-raspberrypi2.wic.xz// 
-  * Output Image location in build machine for Raspberry Pi 3: //​tmp/​deploy/​images/​raspberrypi3/​agl-demo-platform-raspberrypi3.rpi-sdimg//+  * Output Image location in build machine for Raspberry Pi 3: //​tmp/​deploy/​images/​raspberrypi3/​agl-demo-platform-raspberrypi3.wic.xz//
   * Unmount the microSD card and after that flash output image to it card with root user:   * Unmount the microSD card and after that flash output image to it card with root user:
  
-** Note: the sdimage files can also be named rpi-sdimg-ota in case you have the "​agl-sota" ​feature enabled ​** +//Note: the sdimage files can also be named rpi-sdimg-ota in case you have the **"​agl-sota"​** ​feature enabled// 
-<​code>​+ 
 +<​code ​bash>
 sudo umount [sdcard device] sudo umount [sdcard device]
-sudo dd if=[output image] of=[sdcard device] bs=4M+xzcat [output image] ​| sudo dd of=[sdcard device] bs=4M status=progress
 sync sync
 </​code>​ </​code>​
Line 105: Line 207:
 ====== Troubleshooting ====== ====== Troubleshooting ======
  
-Due to a known bug in the upstream of meta-rust the Yocto/OE recipe for rust-cross may fail while building RVI SOTA Client or another application written in the Rust programming language. Until the complete resolution of the issue the workaround is to disable all use of the CXX11 ABI by applying the following lines to **conf/​local.conf**:​+===== Extended attributes MUST be copied ===== 
 + 
 +**IMPORTANT,​ The extended attribute set during image construction MUST be copied to the SD card.** 
 + 
 +When using tar to create the SDcard, it is a common error to not copy the extended attributes. Find below instruction for using tar. 
 + 
 +Verify that **tar** version is 1.28 or newer: 
 + 
 +<​code>​ 
 +tar --version 
 +tar (GNU tar) 1.28 
 +[snip] 
 +</​code>​ 
 +If it is not the case, a native up-to-date version of tar is also generated while building AGL distribution:​ 
 + 
 +<​code>​ 
 +tmp/​sysroots/​x86_64-linux/​usr/​bin/​tar-native/​tar --version 
 +tar (GNU tar) 1.28 
 +[snip] 
 +</​code>​ 
 +To copy Automotive Grade Linux (AGL) files AND EXTENDED ATRIBUTES onto the SDcard using tar the command is: 
 + 
 +<​code>​ 
 +tar --extract --numeric-owner --preserve-permissions --preserve-order --totals \ 
 +           ​--xattrs-include='​*'​ --directory=DESTINATION_DIRECTORY --file=agl-demo-platform.....tar.bz2 
 +</​code>​ 
 +===== meta-rust ===== 
 + 
 +Due to a known bug in the upstream of meta-rust the Yocto/OE recipe for rust-cross may fail while building RVI SOTA Client or another application written in the Rust programming language.\\ 
 +Until the complete resolution of the issue the workaround is to disable all use of the CXX11 ABI by applying the following lines to **conf/​local.conf**:​
  
 <​code>​ <​code>​
Line 115: Line 246:
 TARGET_CXXFLAGS_remove_pn-gcc-runtime = "​-D_GLIBCXX_USE_CXX11_ABI=0"​ CXXFLAGS_remove_pn-gcc-runtime = "​-D_GLIBCXX_USE_CXX11_ABI=0"​ TARGET_CXXFLAGS_remove_pn-gcc-runtime = "​-D_GLIBCXX_USE_CXX11_ABI=0"​ CXXFLAGS_remove_pn-gcc-runtime = "​-D_GLIBCXX_USE_CXX11_ABI=0"​
 </​code>​ </​code>​
 +===== Disabling Homescreen in AGL 3.0.x CC release =====
 +
 +**Problem**:​ new installed applications are not available on Homescreen and even if started manually through afm-util, the application starts but no surface appears.
 +
 +**Answer**: this is due to IVI-Shell integration with Qt and Homescreen.
 +
 +To disable IVI-Shell and revert to the "plain old" weston desktop, you can follow the 4 steps below:
 +
 +  * Modify ///​etc/​xdg/​weston/​weston.ini//​ and comment the line mentioning IVI-shell. For example on Porter board:
 +
 +<​code>​
 +           ​[core]
 +           ​backend=drm-backend.so
 +           #​shell=ivi-shell.so
 +           ...
 +</​code>​
 +  * modify ///​usr/​lib/​systemd/​user/​afm-user-daemon.service//​ and comment the line specifying QT Wayland backend:
 +
 +<​code>​
 +           ...
 +           #​Environment=QT_WAYLAND_SHELL_INTEGRATION=ivi-shell
 +           ...
 +</​code>​
 +  * disable Homescreen services:
 +
 +<​code>​
 +           # systemctl disable HomeScreenAppFrameworkBinderAGL.service
 +           # systemctl disable HomeScreen.service
 +           # systemctl disable InputEventManager.service
 +           # systemctl disable WindowManager.service
 +</​code>​
 +  * Reboot your target and you should then be able to start apps on the standard weston screen using afm-util
 +
 ====== Commercial Licensed Packages ====== ====== Commercial Licensed Packages ======
  
Line 125: Line 289:
 IMAGE_INSTALL_append = " libomxil"​ IMAGE_INSTALL_append = " libomxil"​
 </​code>​ </​code>​
 +
 +====== SOTA ======
 +
 +To build AGL for Raspberry Pi with enabled software over the air updates, include **agl-sota** feature. In **bblayers.conf** replace **meta-updater-qemux86-64** with **meta-updater-raspberrypi**. In **local.conf** set **SOTA_PACKED_CREDENTIALS** and **OSTREE_BRANCHNAME**. More details are available [[https://​docs.ota.here.com/​getstarted/​dev/​raspberry-pi.html|here]].
 +
 +
 ====== Raspberry Pi Touchscreen with Rotation ====== ====== Raspberry Pi Touchscreen with Rotation ======
  
Line 160: Line 330:
   * Connect the TX line of the cable (RED wire if you are using Olimex USB-Serial-Cable-F) to pin 10 (RX line) of Raspberry Pi.   * Connect the TX line of the cable (RED wire if you are using Olimex USB-Serial-Cable-F) to pin 10 (RX line) of Raspberry Pi.
  
- +{{:​agl-distro/​RaspberryPi2-ModelB-debug-serial-cable.jpg| Olimex USB-Serial-Cable-F attached to Raspberry PI 2 for debugging through the serial console}}
- +
-{{:​agl-distro:​raspberrypi2-modelb-debug-serial-cable.jpg| Olimex USB-Serial-Cable-F attached to Raspberry PI 2 for debugging through the serial console}}+
  
   * Plug the USB connector of the cable to your computer and use your favorite tool for serial communication,​ for example on Ubuntu and other Linux distributions you may use screen:   * Plug the USB connector of the cable to your computer and use your favorite tool for serial communication,​ for example on Ubuntu and other Linux distributions you may use screen:
Line 169: Line 337:
 sudo screen /​dev/​ttyUSB0 115200 sudo screen /​dev/​ttyUSB0 115200
 </​code>​ </​code>​
-Pay attention that the colours ​of the cable may vary depending on the vendor. If you have USB console cable from Adafruit please have a look [[https://​learn.adafruit.com/​adafruits-raspberry-pi-lesson-5-using-a-console-cable/​connect-the-lead|here]].+Pay attention that the colors ​of the cable may vary depending on the vendor. If you have USB console cable from Adafruit please have a look [[https://​learn.adafruit.com/​adafruits-raspberry-pi-lesson-5-using-a-console-cable/​connect-the-lead|here]].
  
agl-distro/agl-raspberrypi.txt · Last modified: 2022/10/07 19:37 by vinodahuja