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
Programmable Logic
  • Challenges & Projects
  • Project14
  • Programmable Logic
  • More
  • Cancel
Programmable Logic
Blog VidorScout - MKR Vidor 4000 Mobile Robot: VidorBitstream compile
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Programmable Logic to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: jomoenginer
  • Date Created: 23 Jun 2019 10:02 AM Date Created
  • Views 2056 views
  • Likes 11 likes
  • Comments 6 comments
  • programmablelogicch
  • mkr_vidor
  • mkr vidor 4000
  • mobile robot
  • arduino vidor
Related
Recommended

VidorScout - MKR Vidor 4000 Mobile Robot: VidorBitstream compile

jomoenginer
jomoenginer
23 Jun 2019

VidorBitstream

 

Part of the intent of the VidorScout project is to take advantage of the FPGA code that Arduino has provided and modify it for a particular purpose.  It is unknown at this time whether this is possible since not all of the released FPGA code has been provided by Arduino for the MKR Vidor 4000, so it will be a matter of working with what is available.

 

However, Arduino recently posted the VidorBitstrem code which has the majority of the FPGA code used in the VidorPeripherials and VidoGraphics examples.  To compile the VidorBitstream code, a few steps are required.

 

Related Posts:

VidorScout - MKR Vidor 4000 Mobile Robot: Intro

VidorScout - MKR Vidor 4000 Mobile Robot: Camera QR Code Recognition

VidorScout - MKR Vidor 4000 Mobile Robot: Assembly and Test

 

 

CAUTION:  Perform these steps at your own risk.   The MKR Vidor 4000 is still consider in Beta and the VidorBitstream is not complete and loading a Vidor 4000 with the VidorBitstream could case the VidorGraphics examples to no longer function.  There is a known issue concerning a licensing issue with a UART on the Vidor 4000 when using Quartus II Lite to build the code, so if this code is loaded on the board, the communication with the FPGA will be slowed way down causing the graphics to not behave properly.

 

Intel Quartus Prime (includes Nios II EDS)

 

To edit and synthesis the Intel Cyclone 10 LP code for the Vidor 4000, the Intel Quartus Prime (includes Nios II EDS) software needs to be downloaded an installed. Intel provides a Lite 18.1 version that is free to download and use but is a couple of steps behind the latest release. This includes the Intel Quartus Prime development environment, Nios II Embedded Design Suite, ModelSim Starter Edition and much more.

 

To download the Quartus II software, a login is require for the Intel site.  After registering and the email confirmation is sent, the software can be downloaded from the following link:

http://fpgasoftware.intel.com/?edition=lite

 

The MKR Vidor 4000 has a Intel Cyclone 10 LP FPGA so this is the only one required to select for the download.

 

Go Programming Language Install

The VidorBitstream as a requirement to use the Go Programming Language to build a particular package.  If Go is not already installed, then it will need to be downloaded and installed prior to building the VidorBitstream code.

 

Go can be downloaded from the following:

https://golang.org/dl/

 

Once downloaded, run the installer to install the Go Language files.

image

 

 

Download VidorBitstrem

 

Once the Quartus II and related software as well as Go are installed, the VidorBitstrem can be downloaded from the Arduino vidor-libraries GitHub page:

https://github.com/vidor-libraries/VidorBitstream/tree/release/projects

 

This can be done either via a downloaded .zip file or using git in Git Bash on Windows 10.

Using git, this can be performed by using "git clone"

 

$ git clone https://github.com/vidor-libraries/VidorBitstream.git
Cloning into 'VidorBitstream'...
remote: Enumerating objects: 5626, done.
remote: Total 5626 (delta 0), reused 0 (delta 0), pack-reused 5626
Receiving objects: 100% (5626/5626), 11.38 MiB | 5.24 MiB/s, done.
Resolving deltas: 100% (2842/2842), done.

 

Nios II Command Shell

Once the VidorBitstream bits have been downloaded, open the Nios II Command Shell which will be used to compile the code

In windows, go to the Window Icon and select Nios II Command Shell ( Quartus Prime 18.1)

image

 

This will open a Command Shell which acts like a Linux Console.

image

 

NOTE: The path in the Nios II Command Shell starts with "cygdrive" and then the driver letter and the rest of the directory structure, "h" in this case.

 

Set the PATH environment variable

To run the build on the VidorBistream code, the PATH variable must be set to include the VidorBitstream/TOOLS/scripts folder using the Nois II Command Shell.

$ PATH=$PATH:/cygdrive/h/Development/Arduino_config/MKR_Vidor_4000/fpga/VidorBitstream/TOOLS/scripts

 

Set file permissions (Windows 10)

In Windows 10, the file permissions are set correctly for the VidorBitstream files in the Nios II Command Shell, so these will need to be change as follows:

  1. Change directories to either the VidorBistream folder or one previous to it.

$ cd /cygdrive/h/Development/Arduino_config/MKR_Vidor_4000/fpga/VidorBistream

 

  2. Run the 'chmod' tool to recursively change the VidorBitstream file permissions.

$ chmod -R a+rw *

 

Quartus Patches.

Prior to building the VidorBitstream code, a set of patches need to be installed via a provided patch script.

Navigate to the VidorBitstream/TOOLS/scripts directory and run the apply_quartus_patches.sh script

   $ cd /cygdrive/h/Development/Arduino_config/MKR_Vidor_4000/fpga/VidorBitstream/TOOLS/scripts

   $ apply_quartus_patches.sh

 

 

$ cd ../makeCompositeBinary
$  go build -o makeCompositeBinary make_composite_binary.go

 

Build makeCompositeBinary using Go

The last step to complete before building the VidorBitstream code is to compile the makeCompositeBinary code using the Go Language.

This is located under TOOLS/makeCompositeBinary, so from the previous step, just 'cd' back one directory to get to the makeCompositeBinary and then Go.

   $ cd ../makeCompositeBinary
   
   $  go build -o makeCompositeBinary make_composite_binary.go

 

 

VidorBitstream projects

Under the VidorBitstream/projects directory, there are a number of projects, however only the  MKRVIDOR4000_graphics and MKRVIDOR4000_peripherals will be used in this project.

me@computer/cygdrive/h/Development/Arduino_config/MKR_Vidor_4000/fpga/VidorBitstream/projects
$ dir
MKRVIDOR4000_graphics     MKRVIDOR4000_template_bare
MKRVIDOR4000_pacman       MKRVIDOR4000_template_mbox
MKRVIDOR4000_peripherals

 

Change directories to a folder to run the build_all.sh script to build the code.

MKRVIDOR4000_graphic is used in this example.

cd /cygdrive/h/Development/Arduino_config/MKR_Vidor_4000/fpga/VidorBitstream/projects/MKRVIDOR4000_graphics

 

Run the build_all.sh script to build the code.

$ build_all.sh

 

This will take a bit of time to complete, but id successful the output should look like the following.

This resulted in the following for me:
[code]Info: Quartus Prime Shell was successful. 0 errors, 352 warnings
    Info: Peak virtual memory: 4626 megabytes
    Info: Processing ended: Sat Jun 22 02:28:30 2019
    Info: Elapsed time: 00:06:33
    Info: Total CPU time (on all processors): 00:00:05
create ram + flash app.ttf
Jun 22, 2019 2:28:30 AM - (INFO) elf2flash: args = --input=build/software/MKRVIDOR4000_graphics/MKRVIDOR4000_graphics_lite.elf --output=build/output_files/MKRVIDOR4000_graphics_lite.flash --base=0x008E0000 --end=0x008FFFFF --verbose --save
Jun 22, 2019 2:28:30 AM - (FINE) elf2flash: Starting
Jun 22, 2019 2:28:30 AM - (FINE) elf2flash: Done
projects
ip
cp: omitting directory './ip/GFX/arduino/Vidor_GFX/examples'
cp: omitting directory './ip/QUAD_ENCODER/arduino/VidorEncoder/examples'
cp: omitting directory './ip/NEOPIXEL/arduino/VidorNeopixel/examples'
cp: omitting directory './ip/MIPI_RX_ST/arduino/VidorCamera/examples'[/code]

 

NOTE: I am not certain what the "omitting directory" message mean and have posted this on the GitHub page.

If the build is successful, a number of files will be populated in the 'build/output_files' directory.

NOTE: The app.ttf and MKRVIDOR4000_graphics_lite.flash can be used to flash the MKR Vidor 4000

 

me@computer cygdrive/h/Development/Arduino_config/MKR_Vidor_4000/fpga/VidorBitstream/projects/MKRVIDOR4000_graphics
$ ls build/output_files/
MKRVIDOR4000_graphics_lite.asm.rpt
MKRVIDOR4000_graphics_lite.bin
MKRVIDOR4000_graphics_lite.done
MKRVIDOR4000_graphics_lite.fit.rpt
MKRVIDOR4000_graphics_lite.fit.smsg
MKRVIDOR4000_graphics_lite.fit.summary
MKRVIDOR4000_graphics_lite.flash
MKRVIDOR4000_graphics_lite.flow.rpt
MKRVIDOR4000_graphics_lite.jam
MKRVIDOR4000_graphics_lite.jbc
MKRVIDOR4000_graphics_lite.jdi
MKRVIDOR4000_graphics_lite.map.rpt
MKRVIDOR4000_graphics_lite.map.smsg
MKRVIDOR4000_graphics_lite.map.summary
MKRVIDOR4000_graphics_lite.pin
MKRVIDOR4000_graphics_lite.pof
MKRVIDOR4000_graphics_lite.rbf
MKRVIDOR4000_graphics_lite.sld
MKRVIDOR4000_graphics_lite.sof
MKRVIDOR4000_graphics_lite.sta.rpt
MKRVIDOR4000_graphics_lite.sta.summary
MKRVIDOR4000_graphics_lite.ttf
app.ttf
signature.h

 

 

 

Run an Example

 

To test the code, the 'app.ttf' file can be copied to the Arduino Library VidorGraphics/src directory and then compile and load an example.

NOTE: Ensure to backup the existing code prior to copying the file over.

me@computer /cygdrive/h/Development/Arduino_config/MKR_Vidor_4000/fpga/VidorBitstream/projects/MKRVIDOR4000_graphics

$ cp build/output_files/app.ttf /cygdrive/c/Users/jomodev/Documents/Arduino/libraries/VidorGraphics/src/app.ttf

 

I made an edit to the VidorDrawLogo example recompiled it using the app.ttf from the VidorBitstream exercise and I did not see an issue with the output of the example on the HDMI port.  I added a Red Circle that goes from Left to Right to show the code has changed since the last post.

This is a quick video showing the result.

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

This example shown how to take the VidorBitstream code and build it using the Intel Quartus II and Nios II tools.

 

NOTE: At the end of the VidorBitstream build process, there will be a distrib directory under the project directory:

Ex: VidorBitstream\distrib\MKRVIDOR4000_graphics

This can be used to replace the existing VidorGraphics code under the Arduino IDE libraries file, however after doing so has rendered my board's graphics as non functional.  Neither the Camera, the Log nor NeoPixel examples are working now and I am still trying to recover my board to it's previous state.

 

Updated 7/5/2019

There is a fork of the Arduino provided VidorBitstream code that bypasses the limitation of the Arduino code and uses the Vidor FPGA to resolve the issue.  With this code, the VidorGraphics examples work fine as does the camera.

Use this code instead of the Arduino provided VidorBitstream if there are issues.

https://github.com/MinatsuT/VidorBitstream_GFX_HW

 

Restore FPGA Bootloader

If the MKR Vidor 4000 Graphics are no longer working, there is a RestoreFPGABootloader example that can be downloaded from the vidor-libraries Github repo.

https://github.com/vidor-libraries/VidorBoot

 

Just download the VidorBoot zipped repo, load it into the Arduino IDE libraries and then run the VidorBoot->RestoreFPGABootloader example to restore the board back to the original, or at least a functional, state. All of the VidorGraphics examples worked again after performing this.

 

Next step, show the QR code recognition capability of the MKR Vidor 4000.

  • Sign in to reply

Top Comments

  • jomoenginer
    jomoenginer over 6 years ago in reply to Fred27 +6
    Ah, I see the patch vs path thing. Thanks. With regards to the Vidor 4000 vs Xilinx, Zybo Z7 in particular, it really depends on your level of experience with FPGA development. I have prior experience…
  • Fred27
    Fred27 over 6 years ago +4
    A nice guide. I was sent a Vidor recently and wasn't sure whether to try it out or just stick to Xilinx. You've convinced me that it's worth trying out Quartus when I can find the time. You've got a few…
  • jomoenginer
    jomoenginer over 6 years ago in reply to jomoenginer +3
    Added another update on how to Restore FPGA Bootloader if the Vidor Graphics are no longer working.
  • dubbie
    dubbie over 6 years ago

    I like what I understand of this, but it is way above my 'pay grade' of understanding. I wonder if I can get a promotion?

     

    Dubbie

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jomoenginer
    jomoenginer over 6 years ago in reply to jomoenginer

    Added another update on how to Restore FPGA Bootloader if the Vidor Graphics are no longer working.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jomoenginer
    jomoenginer over 6 years ago

    I added an update with a caution statement since after replacing the existing VidorGraphics code with the code built by the VidorBitstream process has rendered my Vidor 4000 Graphics as non functional.  I'm still trying to recover it. 

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 6 years ago

    Nice update.

     

    I like your incremental approach and good step by step description.

     

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jomoenginer
    jomoenginer over 6 years ago in reply to Fred27

    Ah, I see the patch vs path thing. Thanks.

     

    With regards to the Vidor 4000 vs Xilinx, Zybo Z7 in particular, it really depends on your level of experience with FPGA development.  I have prior experience with the Quartus tools with an Altera device, but the newer tools are much nicer.  However, Verilog is similar to programming in C and is the same whether you are on a Xilinx or Intel FPGA.  But, in the case of the Vidor, unlike the Xlinix Zynq, the ARM processor is not embedded in the same silicon and does not run a Linux kernel.  With the Vidor it is just a SAMD ARM Cortex-M0+ and does not have the power of the ARM Cortex-A9 the Z7-10 has so it is a different implementation process.  With Vivado you can run the commands from command line which is quite common to do from the ARM side of the Zynq so it is similar to the Nios II Command Shell. ARM Cortex-A9, the Vidor is still considered in Beta so there really is not a lot of examples to reference to outside of those that Arduino has provided.  There are some on the web, but certainly not like there is with the Zybo boards.  You could still use the Vidor 4000 like a normal ARM based Arduino board though.

    • Cancel
    • Vote Up +6 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