Code Monkey home page Code Monkey logo

meta-cherrypi-v3s's Introduction

meta-cherrypi-v3s

Instruction how to build an image for Cherrypi based on Allwinner V3s in Yocto

Products:

Home page
http://www.lctech-inc.com/cpzx/LCPIxl/2021/1009/532.html

Board View Front
Board View Back
Cherry Pi V3s Version

General Note:

Assumed that Linux Ubuntu is installed

List of tested elements

Example application for GPIO handling

List of not tested elements

Lcd
Touchscreen

TBD

How to build an images

  1. First make sure to following packages are installed in system

    sudo apt-get install gawk wget diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev xterm emscripten libmpc-dev libgmp3-dev

    Note: More informations can be found on Yocto reference manual.

  2. Download necessary Yocto packaged listed below. Be sure to be in root of home folder.

    mkdir yocto
    cd yocto
    mkdir build
    git clone git://git.yoctoproject.org/poky --depth 1 -b kirkstone
    cd poky
    git clone git://git.openembedded.org/meta-openembedded --depth 1 -b kirkstone
    git clone https://github.com/meta-qt5/meta-qt5.git --depth 1 -b kirkstone
    git clone https://github.com/voloviq/meta-cherrypi-v3s --depth 1 -b kirkstone

  3. Select directory to build Linux

    Nano version
    source oe-init-build-env ~/yocto/build/cherrypi-v3s

  4. Modify bblayers.conf(located in ~/yocto/build/cherrypi-v3s/conf)

    BBLAYERS ?= " \
    ${HOME}/yocto/poky/meta \
    ${HOME}/yocto/poky/meta-poky \
    ${HOME}/yocto/poky/meta-openembedded/meta-oe \
    ${HOME}/yocto/poky/meta-openembedded/meta-networking \
    ${HOME}/yocto/poky/meta-openembedded/meta-python \
    ${HOME}/yocto/poky/meta-openembedded/meta-multimedia \
    ${HOME}/yocto/poky/meta-qt5 \
    ${HOME}/yocto/poky/meta-cherrypi-v3s \
    "

    Note: Please adapt PATH of conf/bblayers.conf if necessary.

  5. Modify local.conf(located in ~/yocto/build/cherrypi-v3s/conf) file

    • modify line with "MACHINE ??" to add "cherrypi-v3s-sdcard" or for SPI NOR Flash "cherrypi-v3s-spinor"

    • align DL_DIR = "${HOME}/yocto/downloads"

    • align SSTATE_DIR = "${HOME}/yocto/sstate-cache"

    • align TMPDIR = "${HOME}/yocto/tmp"

    • add at the end following records

      RM_OLD_IMAGE = "1"
      INHERIT += "rm_work"
      MACHINEOVERRIDES .= ":use-mailine-graphics"
      LICENSE_FLAGS_ACCEPTED = "commercial"

    • for spi flash change DISTRO ?= "poky" to DISTRO ?= "cherrypi-v3s-tiny"

    Note: Please adapt rest of conf/local.conf parameters if necessary.

  6. Build objects

    • When using SPI NOR Flash use following image

    • core image minimal
      bitbake core-image-minimal

    • console image
      bitbake console-image

    • qt5 image
      bitbake qt5-image

    • qt5 toolchain sdk
      bitbake meta-toolchain-qt5

  7. After compilation images appears in

    Nano version
    ~/yocto/tmp/deploy/images/cherrypi-v3s

  8. Insert SD CARD into dedicated CARD slot and issue following command to write an image

    Note:
    Be 100% sure to provide a valid device name (of=/dev/sde/mmcblk0). Wrong name "/dev/sde/mmcblk0" dameage Your system file !

    Nano version
    sudo dd if=~/yocto/tmp/deploy/images/cherrypi-v3s-sdcard/core-image-minimal-cherrypi-v3s-sdcard.sunxi-sdimg of=/dev/mmcblk0 bs=1024

  9. SPI NOR Flash update tool compilation(if valid sunxi-tools installed go to point 10)
    git clone https://github.com/Icenowy/sunxi-tools.git -b v3s-spi
    sudo apt-get install libz libusb-1.0-0-dev
    make
    sudo make install

  10. Flash SPI NOR flash
    To enter into bootlader mode it is necessary to erase u-boot section from spi nor flash.
    To do this it is necessary to stop booting U-Boot and enter following commands.
    sf probe 0
    sf erase 0 70000
    sunxi-fel -p spiflash-write 0 ~/yocto/tmp/deploy/images/cherrypi-v3s-spinor/core-image-minimal-cherrypi-v3s-spinor.sunxi-spinor
    To write only u-boot...spl just type
    sudo sunxi-fel -v uboot u-boot-sunxi-with-spl.bin

  11. How to handle GPIO from userfs - example (used PE3 as GPIO)

    1. Take a GPIO for instance PE3
      echo 131 > /sys/class/gpio/export
    2. Set as out or in
      echo "out" > /sys/class/gpio/gpio131/direction
    3. Set GPIO state if configured as ouput
      echo 1 > /sys/class/gpio/gpio131/value
      echo 0 > /sys/class/gpio/gpio131/value

Limitation

meta-cherrypi-v3s's People

Contributors

voloviq avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.