Difference between revisions of "Poky manual"

From ElphelWiki
Jump to: navigation, search
(Setup)
(Requirements)
(4 intermediate revisions by the same user not shown)
Line 10: Line 10:
  
 
* Building embedded Linux image for Zynq ARMv7 platform - Elphel 10393 board
 
* Building embedded Linux image for Zynq ARMv7 platform - Elphel 10393 board
* Yocto Poky revision = 2.6 (Thud)
+
* Yocto Poky revision = 2.7.1 (Warrior)
 
* Yocto Poky revision = 2.4 (Rocko)
 
* Yocto Poky revision = 2.4 (Rocko)
 
* <s>Yocto Poky revision = 2.0 (Jethro)</s>
 
* <s>Yocto Poky revision = 2.0 (Jethro)</s>
Line 29: Line 29:
  
 
==<font color="blue">Requirements</font>==
 
==<font color="blue">Requirements</font>==
* Kubuntu 16.04 x64 (as of Dec 2018) for Poky 2.4 Rocko
+
* Kubuntu 16.04 x64 (as of Dec 2018) - Poky: 2.4 Rocko, 2.7.1 Warrior
* Kubuntu 18.04 x64 (as of Dec 2018)
+
* Kubuntu 18.04 x64 (as of Dec 2018) - Poky: 2.7.1 Warrior (not tested but might build w/o problems)
* For Poky 2.6 Thud see [http://www.yoctoproject.org/docs/2.6/mega-manual/mega-manual.html Yocto Project Poky 2.6 mega-manual]
 
  
 
==<font color="blue">Output files</font>==
 
==<font color="blue">Output files</font>==
Line 38: Line 37:
 
|-
 
|-
 
! File(s)
 
! File(s)
 +
! Build Command
 
! Description
 
! Description
 
|-
 
|-
 
| <font color='darkblue'>'''boot.bin'''</font>
 
| <font color='darkblue'>'''boot.bin'''</font>
 +
| ''bitbake u-boot''
 
| u-boot as the first stage bootloader = Secondary Program Loader (SPL) that boots '''u-boot-dtb.img'''
 
| u-boot as the first stage bootloader = Secondary Program Loader (SPL) that boots '''u-boot-dtb.img'''
 
|-
 
|-
 
| <font color='darkblue'>'''u-boot-dtb.img'''</font>
 
| <font color='darkblue'>'''u-boot-dtb.img'''</font>
 +
| ''bitbake u-boot''
 
| full size u-boot with a stripped device tree (''cat u-boot.img some_stripped_devicetree.dtb > u-boot-dtb.img'')
 
| full size u-boot with a stripped device tree (''cat u-boot.img some_stripped_devicetree.dtb > u-boot-dtb.img'')
 
|-
 
|-
 
|valign='top'| <font color='darkblue'>'''devicetree.dtb'''</font>
 
|valign='top'| <font color='darkblue'>'''devicetree.dtb'''</font>
 +
| bitbake device-tree
 
| device tree with listed interfaces, zynq registers, interrupts and drivers
 
| device tree with listed interfaces, zynq registers, interrupts and drivers
 
* ''elphel393/bootable-images/mmc/devicetree.dtb'' - mount rootfs from mmc partition
 
* ''elphel393/bootable-images/mmc/devicetree.dtb'' - mount rootfs from mmc partition
Line 52: Line 55:
 
|-
 
|-
 
| <font color='darkblue'>'''uImage'''</font>
 
| <font color='darkblue'>'''uImage'''</font>
 +
| ''bitbake linux-xlnx''
 
| kernel, drivers
 
| kernel, drivers
 
|-
 
|-
 
| <font color='darkblue'>'''rootfs.ubifs''', '''rootfs.ubi''', '''rootfs.tar.gz'''</font>
 
| <font color='darkblue'>'''rootfs.ubifs''', '''rootfs.ubi''', '''rootfs.tar.gz'''</font>
 +
| ''bitbake core-image-elphel393''
 
| rootfs in different formats - *.ubi* for NAND, *.tar.gz for mmc
 
| rootfs in different formats - *.ubi* for NAND, *.tar.gz for mmc
 
|}
 
|}
Line 90: Line 95:
 
</font>
 
</font>
  
* Poky 2.6 Thud (Kubuntu 18.04)
+
* Poky 2.7.1 Warrior (Kubuntu 16.04 or 18.04)
 
<font size='2'>
 
<font size='2'>
  git clone -b '''thud''' https://git.elphel.com/Elphel/elphel393.git
+
  git clone -b '''warrior''' https://git.elphel.com/Elphel/elphel393.git
 
  cd elphel393
 
  cd elphel393
 
  ./setup.py
 
  ./setup.py
Line 113: Line 118:
 
|}
 
|}
  
==<font color="blue">Build</font>==
 
 
===<font color="blue">All targets</font>===
 
<font size='2'>
 
bitbake u-boot device-tree linux-xlnx core-image-elphel393
 
</font>
 
===<font color="blue">Bootloader</font>===
 
<font size='2'>
 
bitbake u-boot
 
</font>
 
====Output====
 
* '''boot.bin'''
 
* '''u-boot-dtb.img'''
 
 
====Notes====
 
* Current the recipe installs only binaries. We will upgrade u-boot from '''2016.05''' to the current release later.
 
2016.05 will not compile in Kubuntu 18.04
 
 
===<font color="blue">Device tree</font>===
 
<font size='2'>
 
bitbake device-tree
 
</font>
 
====Output====
 
* '''devicetree.dtb'''
 
 
===<font color="blue">Kernel</font>===
 
<font size='2'>
 
bitbake linux-xlnx
 
</font>
 
====Output====
 
* '''uImage'''
 
 
====Notes====
 
* linux-xlnx '''rocko''' branch was simply moved to '''thud''' branch
 
* yocto thud:  Kernel version is 4.9.0, linux-xlnx
 
* Device Tree Blob is compiled separately in linux-xlnx
 
* Uncompiled device tree files are present in the linux sources provided by linux-xlnx
 
 
===<font color="blue">Rootfs</font>===
 
<font size='2'>
 
bitbake core-image-elphel393
 
</font>
 
====Output====
 
* '''rootfs.tar.gz'''
 
* '''rootfs.ubi''', '''rootfs.ubifs'''
 
  
 
==<font color="blue">Details for development</font>==
 
==<font color="blue">Details for development</font>==
 
[[Development_for_10393|'''Development for 10393''']]
 
[[Development_for_10393|'''Development for 10393''']]

Revision as of 12:09, 9 September 2019

Use cases

  • Linux kernel update when adding/developing a driver
  • When an application needs to be included into the firmware image archive
  • Update Elphel's PHP extension
  • C/C++ applications if developed on PC require a cross-compiler and require Yocto installation or some other alternative.

Other projects that use Python, PHP, Javascript, HTML, C/C++ on hardware (compiler is included in the firmware image) do not require this SDK use but it makes the process more convenient, e.g. by copying the built packages straight to the target hardware.

Description

  • Building embedded Linux image for Zynq ARMv7 platform - Elphel 10393 board
  • Yocto Poky revision = 2.7.1 (Warrior)
  • Yocto Poky revision = 2.4 (Rocko)
  • Yocto Poky revision = 2.0 (Jethro)

Features

  • Once everything is built it supports updating software projects (files and binaries) on the target system
    • access is set up in yocto's local.conf (see setup.py output) + ssh-copy-id
    • bitbake some-app -c target_scp from the command line or Eclipse IDE - see examples in elphel-apps-... at Git

Requirements

  • Kubuntu 16.04 x64 (as of Dec 2018) - Poky: 2.4 Rocko, 2.7.1 Warrior
  • Kubuntu 18.04 x64 (as of Dec 2018) - Poky: 2.7.1 Warrior (not tested but might build w/o problems)

Output files

The names are listed as they appear in the u-boot configuration header file - actual output files have different names:

File(s) Build Command Description
boot.bin bitbake u-boot u-boot as the first stage bootloader = Secondary Program Loader (SPL) that boots u-boot-dtb.img
u-boot-dtb.img bitbake u-boot full size u-boot with a stripped device tree (cat u-boot.img some_stripped_devicetree.dtb > u-boot-dtb.img)
devicetree.dtb bitbake device-tree device tree with listed interfaces, zynq registers, interrupts and drivers
  • elphel393/bootable-images/mmc/devicetree.dtb - mount rootfs from mmc partition
  • elphel393/bootable-images/nand/devicetree.dtb - mount rootfs from NAND flash
uImage bitbake linux-xlnx kernel, drivers
rootfs.ubifs, rootfs.ubi, rootfs.tar.gz bitbake core-image-elphel393 rootfs in different formats - *.ubi* for NAND, *.tar.gz for mmc

The file are located at elphel393/bootable-images/, which is a link to poky's deploy directory elphel393/poky/build/tmp/deploy/images/elphel393/

  • complete set of files for rootfs in NAND Flash: elphel393/bootable-images/nand/
  • complete set of files for rootfs on MMC (micro SD card): elphel393/bootable-images/mmc/

Write files to media and boot

Boot from micro SD card

  • Use recovery or regular μSD card
  • EXT4 partition mounted as /

Detailed instructions

Boot from NAND flash

  • The default boot option - power on.
  • A UBIFS image is written to /dev/mtd4 - is mounted as /

Detailed instructions

Notes

Setup

  • Poky 2.4 Rocko (Kubuntu 16.04)

git clone -b rocko https://git.elphel.com/Elphel/elphel393.git
cd elphel393
./setup.py
cd poky
. ./oe-init-build-env
bitbake u-boot device-tree linux-xlnx core-image-elphel393

  • Poky 2.7.1 Warrior (Kubuntu 16.04 or 18.04)

git clone -b warrior https://git.elphel.com/Elphel/elphel393.git
cd elphel393
./setup.py
cd poky
. ./oe-init-build-env
bitbake u-boot device-tree linux-xlnx core-image-elphel393

Compare built vs deployed software versions

cd elphel393
./check_versions.py root@192.168.0.9

Notes:

  • deployed = running on the target system
check_versions.py output in terminal


Details for development

Development for 10393