element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
FPGA
  • Technologies
  • More
FPGA
Blog Ultra96-V2 Dual Camera Mezzanine Petalinux Build Instructions
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join FPGA to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: ctammann
  • Date Created: 14 Jan 2021 9:14 PM Date Created
  • Views 4955 views
  • Likes 5 likes
  • Comments 23 comments
  • image sensor
  • avnet
  • mezzanine
  • vision
  • petalinux
  • xilinx
  • ultra96
  • 96boards
  • ai
  • on semiconductor
Related
Recommended

Ultra96-V2 Dual Camera Mezzanine Petalinux Build Instructions

ctammann
ctammann
14 Jan 2021

As a follow up to the blog I posted on building the hardware design for the out of box image for the ON Semiconductor Dual Camera Mezzanine card, here are the instructions to complete the build with the Petalinux project. The original blog can be found here -
Ultra96-V2 ON Semiconductor Dual Camera Mezzanine hardware build instructions

 

The process of porting the full design over to our Github repo has now been completed. Below I've pasted the instructions to build the full design including Petalinux from the repo. The final command will build the hardware design as part of the script and create the full design.

 

#

# Clone the repositories

#

 

$ cd ~

$ mkdir -p git/avnet

$ cd git/avnet/

$ git clone https://github.com/Avnet/bdf.git

$ git clone https://github.com/Avnet/hdl.git

$ git clone https://github.com/Avnet/petalinux.git

$ cd bdf
$ git checkout master

$ cd ../petalinux

$ git checkout 2020.1

$ cd ../hdl

$ git checkout 2020.1

 

#

# Run the Vivado build script for the Ultra96-V2 dualcam design

#

 

$ cd ../petalinux

$ ./scripts/make_ultra96v2_dualcam.sh

 

 

This process will take a long time and will depend on your pc hardware. When complete, you should see something similar to this:

image

 

Your design has now successfully been built (yay!). So now we need to put it on an SDcard to use on your hardware. Pulling from my colleague Tom Curran's excellent instructions, if you haven't already followed the Getting Started Guide you will need to first partition the SD card with - for example - a 1GB FAT32 boot partition and (assuming you are using the provided 16GB Delkin micro SD card) and a 15GB ext4 partition. I've also attached a handy guide on formatting a new SDcard to this blog.

 

If you have successfully configured your SDcard you are ready to copy over the files. Here are the commands to create the SDcard image. First you must navigate to the folder where the files were generated, then you can copy them over to the proper partitions on your SDcard.

 

$ cd ~/git/avnet/petalinux/projects/ultra96v2_dualcam_2020_1

$ cp ./images/linux/BOOT.BIN /media/training/<UUID of FAT32 partition>/.

$ cp ./images/linux/boot.scr /media/training/<UUID of FAT32 partition>/.

$ cp ./images/linux/image.ub /media/training/<UUID of FAT32 partition>/.

$ sudo rm -rf /media/training/<UUID of ext4 partition>/*

$ sudo tar xvf ./images/linux/rootfs.tar.gz -C /media/training/<UUID of ext4 partition>/

$ sync; sync (VERY IMPORTANT to sync the filesystem BEFORE ejecting the SD card!  If you don't the filesystem may be corrupted. This process can take minutes to complete)

 

You should now be able to run the out of box design from your SDcard with the command

 

$ run_1920_1080

 

The out of box image will show 2 live streams from the cameras on a 1080p monitor.

 

Ultra96-V2Ultra96-V2

Attachments:
imageSD Card Formatting an SD Card.docx
  • Sign in to reply

Top Comments

  • albertabeef
    albertabeef over 4 years ago in reply to _david_ +3
    David, We are actively working on this. My colleagues are stabilizing the hardware/software portions generated by the hdl/petalinux repositories. I am working on the Vitis-AI designs generated by the vitis…
  • zedhed
    zedhed over 4 years ago in reply to jomoenginer +1
    Hi jomoenginer , Yes, I agree that seeing the CRC mismatch is unsettling, but I asked our driver developer about this and the explanation that I got is that it is mostly innocuous. The driver will attempt…
  • narrucmot
    narrucmot over 4 years ago in reply to dje666x +1
    Hi David, This script error is a result of the BUILD_FROM_TAG script variable is set to "true" in the scripts/common.sh file: Change this to "false" and re-run the script and it should complete successfully…
  • _david_
    _david_ over 4 years ago in reply to albertabeef

    Mario,

     

    That is really exciting news, and I'd be glad to keep in sync.  The build scripts for the 2020.2 dualcam base design seem to be working without any issue.  The hackster article is very neat, and I look forward to trying that design in the near future when I start looking into the DPU more!

     

    Thank you,

    David

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • albertabeef
    albertabeef over 4 years ago in reply to _david_

    David,

     

    That is exactly where I want to go with this design ... let's keep in sync ...

    Check out what I accomplished with the 2020.2 version of the design with Vitis-AI 1.3:
       https://avnet.me/vitis-ai-1.3-dualcam

    For now, I am working on the 2021.1 version of the u96v2_sbc_dualcam design ... the design is currently hanging exactly as you described previously ... working on it image ...

    Regards,

     

    Mario.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • _david_
    _david_ over 4 years ago in reply to albertabeef

    Mario,

     

    I appreciate all the work you and the Avnet team have put into this.  So far I have only worked with one petalinux project, and it was actually from following your Vitis AI 1.2 tutorial on hackster.  Those guides were well-written and very helpful.

     

    Based on your response, I will setup a VM and will try building the u96-v2-dualcam-2020.2 design.

     

    Right now I am working with Vitis HLS and the Vitis Vision Library to accelerate a stereo block matching application (Vivado flow, not Vitis flow).  So basically I just want to add an extra IP to the video pipeline, and rebuild the whole project.  A long-term goal is to add AI capabilities though, so I'll definitely be using your dualcam Vitis AI 1.3 tutorial sometime in the future.

     

    Thank you,

    David

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • albertabeef
    albertabeef over 4 years ago in reply to _david_

    David,


    We are actively working on this.
    My colleagues are stabilizing the hardware/software portions generated by the hdl/petalinux repositories.
    I am working on the Vitis-AI designs generated by the vitis repository, for both u96v2_sbc_base and u96v2_sbc_dualcam.

     

    In the meantime, consider using the 2020.2 version of the design:
       http://avnet.me/u96v2-dualcam-2020.2

    Out of curiosity, which function were you planning to accelerate ?

    Once we have the 2021.1 vitis platforms ready, it would make sense to explore the new VVAS from Xilinx.


    Regards,
    Mario.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • _david_
    _david_ over 4 years ago

    I am sure you guys get asked this a lot, but will this design be updated to 2021.1 soon?  I've tried to debug some of these scripts myself, but without much success.

     

    I noticed that the "common.sh" script got patched recently, which seems to have fixed some include errors that I was experiencing in meta-avnet/recipes-core/images/avnet-image-full.inc:

              packagegroup-petalinux-vitisai \

              packagegroup-petalinux-vitisai-dev \

     

    I also noticed that the meta-avnet/conf/machine/u96v2-sbc.conf has been patched to use the proper board name "u96v2-sbc".

     

    As far as I can tell, the only other issue is with meta-on-semiconductor/conf/layer.conf using "zeus" instead of "gatesgarth".  If the script uses "zeus" then my terminal crashes within a couple minutes, but if the script uses "gatesgarth", I can generate a full linux image after ~4 hours.  The image, however, fails during boot, and I get the following error:

     

              Please wait: booting...

              Fri Mar 9 12:34:56 UTC 2018

              chmod: cannot access '/var/log/wtmp': No such file or direcory

              Failed to set mode -06640 for -/var/log/wtmp-.

              Configuring packages on first boot....

               (This may take several minutes. Please do not power off the machine.)

              Running postinst /etc/rpm-postinsts/100-libmali-xlnx...

              Running postinst /etc/rpm-postinsts/101-zocl...

              Running postinst /etc/rpm-postinsts/102-sysvinit-inittab...

              Running postinst /etc/rpm-postinsts/103-xrt...

              update-rc.d:  /etc/init.d/run-postinsts exists during rc.d purge (continuing)

               Removing any system startup links for run-postinsts ...

                /etc/rcS.d/S99run-postinsts

              Starting Ultra96 AP setup daemon... done.

              Turning Ultra96 Wifi & Bluetooth LEDs ON.../etc/rcS.d/S99ultra96-radio-leds.sh: line 36: echo: write error: Device or resource busy

              /etc/rcS.d/S99ultra96-radio-leds.sh: line 41: gpio505/direction: No such file or directory

              /etc/rcS.d/S99ultra96-radio-leds.sh: line 45: gpio505/value: No such file or directory

              /etc/rcS.d/S99ultra96-radio-leds.sh: line 49: echo: write error: Invalid argument

              done.

     

              Starting Flask server deamon to serve Ultra96 startup page.

              INIT: Entering runlevel: 5

              /usr/bin/load_camera_config: line 35: echo: write error: Device or resource busy

              /usr/bin/load_camera_config: line 36: /sys/class/gpio/gpio505/direction: No such file or directory

              /usr/bin/load_camera_config: line 37: /sys/class/gpio/gpio505/value: No such file or directory

     

    I doubt much can be gathered from this error message.  For one thing, if I had to guess, more changes need to made in the meta-on-semiconductor layer rather than just changing the layer.conf string from "zeus" to "gatesgarth".

     

    If possible, I'd really like to stick with 2021.1 tools, but if that isn't feasible in the near future, I'll just revert to an older version (2020.2?) using the Avnet VM.  For context, I have an un-accelerated python application running on the PS using the OOB image that I want to replace with a Vitis HLS accerlated kernel in the PL.  I'm hoping to build the design from source with 2021.1 tools, then modify the design, and rebuild everything.  As someone whose only worked with baremetal up to this point though, the petalinux flow has seemed daunting, so any help would be appreciated.

     

    Thank you,

    David

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube