Skip navigation
> RoadTest Reviews

AVNET MiniZed Dev Board - Review

Scoring

Product Performed to Expectations: 10
Specifications were sufficient to design with: 10
Demo Software was of good quality: 10
Product was easy to use: 7
Support materials were available: 9
The price to performance ratio was good: 10
TotalScore: 56 / 60
  • RoadTest: AVNET MiniZed
  • Buy Now
  • Evaluation Type: Development Boards & Tools
  • Was everything in the box required?: Yes - All parts the manufacturer stated were included in the package.
  • Comparable Products/Other parts you considered: Based on the scope of my project the following ESP32, BeagleBone Black, Intel Edison
  • What were the biggest problems encountered?: 1. My development PC OS (Win10 32-bit) was not compatible with Xilinx Vivado IDE 2. Development tool chain complexity 3. Steep learning curve

  • Detailed Review:

    Intro

    I was working with all kind of technologies over the years, but never directly with FPGA. So this Roadtest was a great opportunity for me to get some level of understanding of FPGA and its applicability on my project.

     

    Project

    My project description was defined as following:

    I'd like to to convert my office environment into a smart office, where the PSOC platform will host an array of sensors to analyze the health of environment and transmit information to office occupants and office managers.

    It will be able to detect noise using built-in mic, temperature, humidity and measure level of small particles in the air. It will display this information on display. This information as well will be available over BLE.

    As stretch goal I'd like to publish information about environment condition to the team Slack channel.

     

    Prototype

    I've started my project with a quick prototype to explore Shinyei PPD42NS dust sensor. capabilities.

    I've started with Arduino UNO board. I've selected it as I already have Arduino IDE installed and there was Arduino code samples coming with Shinyei PPD42NS sensor documentation. I was able to make it working in a very short period of time. I was hoping to migrate this code to MiniZed as its documentation stated that peripherals can be plugged into:

       - Dual Pmod-compatible connectors (16 GPIO)

       - Arduino-compatible shield interface (22 GPIO)

    MiniZed Getting Started

    I've followed MiniZed Getting Started Guide. I've connected USB cables from my PC to the board and lunched the terminal. Initially I've got stuck as I didn't get any output from the board. But it was my mistake as I was pressing the wrong button to restart the board. The reset button is marked with a red arrow on the image below. I was able to mount and access USB, setting up WiFi was simple and similar to my past experience with Intel Edison board.

    IDE setup

    My first major challenge was setting up Xilinx Vivado IDE. Xilinx has several development products. It took some time to find out which one should I install.The installation package is very big in comparison to other IDEs. In addition I realized that it doesn't work on Win10 32-bit. I've got a new PC with a 64-bit Win10 OS and installed.Xilinx Vivado IDE there. I as well registered on Xilinx site to get a license for the software.I wish setup of IDE is smaller like with Arduino.

     

    I was relatively successful in using ARM Mbed Cloud IDE for my last project. And I was hoping that as MiniZed will be supported by Mbed Cloud IDE. But at this time I was not able to find it on the list of supported boards, despite the fact it has ARM processor.

     

    Training

    I've spend significant amount of time learning what is FPGA, its capabilities and applications, what is it "sweet spot". Xilinx and Avnet provide a lot of high quality education materials. One of such tutorials I found useful was  Intro to Accessing Devices from User Space | Zedboard

    I've realized that my project may be not the best application of FPGA capabilities as number of sensors I was planning to use is relativly small, they don't require significant processing power as air quality in the office environment is not changing fast..

     

    Using Python with MiniZed

    One of the tutorials was "Python Web Server on MiniZed" http://zedboard.org/support/design/18891/146  . I've decided to give it a try. Python doesn't need a long build/compile time, so it supports fast prototyping. Additionally, the tutorial is covering interaction with GPIO, which is closer to my plan of migration of dust sensor code from Arduinio, which is depending on GPIO interface.

    The guide is using a simple Python script to control a basic web server that allows a user to modify GPIO in the MiniZed PS (ARM) and PL (FPGA) from a browser over Wi-Fi.

    The guide is very detailed. I'll go over some key steps.

    The board comes with PetaLinux 2016.4.  The Python tutorial comes with a newer PetaLinux 2017.4 image. The upgrade procedure was quite simple; I've copied provided files to USB storage. Then I've pluged USB to MiniZed and transferred files to MiniZed. Then I've reboot the board.

     

    Upgrade

    PetaLinux 2016.4 plnx_arm /dev/ttyPS0
    
    plnx_arm login: root
    Password:
    root@plnx_arm:~# df
    Filesystem           1K-blocks      Used Available Use% Mounted on
    devtmpfs                    64         4        60   6% /dev
    tmpfs                   254928        28    254900   0% /run
    tmpfs                   254928        44    254884   0% /var/volatile
    tmpfs                       64         4        60   6% /dev
    /dev/mmcblk1p1          123089     17754    105336  14% /run/media/mmcblk1p1
    /dev/sda1              3923904     67076   3856828   2% /run/media/sda1
    
    root@plnx_arm:~# cd /run/media/sda1/
    
    root@plnx_arm:/run/media/sda1# ls -la
    total 66952
    drwxrwxrwx    4 root     root          4096 Jan  1  1970 .
    drwxrwxrwx    8 root     root           160 Jan  1  1970 ..
    drwxrwxrwx    2 root     root          4096 Jan 13  2018 System Volume Information
    -rwxrwxrwx    1 root     root      16517892 Mar  2  2018 flash_fallback_7007S.bin
    -rwxrwxrwx    1 root     root      51829756 Mar  5  2018 image.ub
    -rwxrwxrwx    1 root     root          2255 Mar  5  2018 readme.txt
    drwxrwxrwx    2 root     root          4096 Dec 22  2017 webserver
    -rwxrwxrwx    1 root     root           188 Jul 14  2017 wpa_supplicant.conf
    -rwxrwxrwx    1 root     root        184920 Oct 19  2017 zynq_fsbl.elf
    
    root@plnx_arm:/run/media/sda1# mkdir /mnt/emmc
    root@plnx_arm:/run/media/sda1# cp image.ub /mnt/emmc/
    
    root@plnx_arm:/run/media/sda1# cd webserver
    root@plnx_arm:/run/media/sda1/webserver# mkdir /mnt/emmc/webserver
    root@plnx_arm:/run/media/sda1/webserver# cp * /mnt/emmc/webserver
    root@plnx_arm:/run/media/sda1/webserver# ls -la /mnt/emmc/webserver
    total 116
    drwxr-xr-x    2 root     root           180 Jul 14 03:18 .
    drwxr-xr-x    3 root     root            80 Jul 14 03:18 ..
    -rwxr-xr-x    1 root     root         36033 Jul 14 03:18 cgi.py
    -rwxr-xr-x    1 root     root          1446 Jul 14 03:18 index.html
    -rwxr-xr-x    1 root     root         37116 Jul 14 03:18 logo_image.jpg
    -rwxr-xr-x    1 root     root         19736 Jul 14 03:18 mmap.cpython-35m-arm-linux-gnueabihf.so
    -rwxr-xr-x    1 root     root          4090 Jul 14 03:18 server.py
    -rwxr-xr-x    1 root     root          4349 Jul 14 03:18 server_devmem.py
    -rwxr-xr-x    1 root     root          1445 Jul 14 03:18 setup_leds.sh
    root@plnx_arm:/run/media/sda1/webserver# sync
    root@plnx_arm:/run/media/sda1/webserver# reboot

     

    After reboot the PetaLinux 2017.4 version of OS was running. I;ve connected to wifi using wifi.sh script. It ouputs allocated IP address, which will be required to connect from the browser.

    And I run a script to configure GPIO ports (setup_leds.sh) and started webserver (python3 webserver.py)

    It is important to specify port 8000. Otherwise the browser will so the page, but will not execute any Python code to manipulate MiniZed GPIOs.

    It is required to load PL code to activate FPGA processing logic. The binary code is provided, but it needs to be uploaded to MiniZed using Xilinx xsct tool.It requires network access.

     

    And flashing takes several minutes. As it was not giving any status of what happening I've start reading its manual, but than flashing completed:

    So I was now able manipulate both LEDs using PS and PL logic.

     

    Connecting Minized GPIO

     

    Here is the content of setup_leds.sh script. It must be run after each reboot of the board. It initializing GPIOs using sysfs interface.

    # Set web page location:
    killall -9 httpd
    httpd -h /mnt/emmc/webserver
    
    
    #Look up the GPIO offsets from /sys/glass/gpio/gpiochipN/label fields
    get-gpio-offsets
    offsets_file=/mnt/emmc/gpio_offsets.txt
    MIO0_OFFSET=$(grep MIO0_OFFSET $offsets_file | cut -d = -f2)
    AXI_GPIO_MAX_OFFSET=$(grep AXI_GPIO_MAX_OFFSET $offsets_file | cut -d = -f2)
    echo "Using MIO0_OFFSET from $offsets_file : $MIO0_OFFSET"
    MIO0=$((MIO0_OFFSET + 0))
    echo "PS Button MIO0 : $MIO0"
    MIO52=$((MIO0_OFFSET + 52))
    echo "PS Red LED MIO52 : $MIO52"
    MIO53=$((MIO0_OFFSET + 53))
    echo "PS Green LED MIO53 : $MIO53"
    echo "Using AXI_GPIO_MAX_OFFSET from $offsets_file : $AXI_GPIO_MAX_OFFSET"
    AXI0=$((AXI_GPIO_MAX_OFFSET - 0))
    echo "PL Green LED AXI0 : $AXI0"
    AXI1=$((AXI_GPIO_MAX_OFFSET - 1))
    echo "PL Red LED AXI1 : $AXI1"
    
    
    # PS Button:
    echo $MIO0 > /sys/class/gpio/export
    echo in > /sys/class/gpio/gpio$MIO0/direction
    # PS Red LED:
    echo $MIO52 > /sys/class/gpio/export
    echo out > /sys/class/gpio/gpio$MIO52/direction
    echo 1 > /sys/class/gpio/gpio$MIO52/value
    
    
    # PS Green LED:
    echo $MIO53 > /sys/class/gpio/export
    echo out > /sys/class/gpio/gpio$MIO53/direction
    echo 1 > /sys/class/gpio/gpio$MIO53/value
    
    
    # PL Green LED:
    echo $AXI0 > /sys/class/gpio/export
    echo out > /sys/class/gpio/gpio$AXI0/direction
    echo 1 > /sys/class/gpio/gpio$AXI0/value
    
    
    # PL Red LED:
    echo $AXI1 > /sys/class/gpio/export
    echo out > /sys/class/gpio/gpio$AXI1/direction
    echo 1 > /sys/class/gpio/gpio$AXI1/value

     

    Here is content of gpio_offsets.txt file:

    MIO0_OFFSET=903

    AXI_GPIO_MAX_OFFSET=1023

     

    Webserver

    Here is the content of provided webserver.py code. It is using a web server to get commands and using sysfs to write to GPIOs and control leds. If you stop webserver and try to start it again it may fail with socket errors. In this case just wait for a couple of seconds to give OS chance to perform cleanup.

    #!/usr/bin/python
    
    
    """
    Save this file as server.py
    >>> python server.py
    Serving on localhost:8000
    You can use this to test GET and POST methods.
    """
    
    
    import http.server
    import socketserver
    import logging
    import cgi
    import sys
    import re
    import subprocess
    import time, struct
    
    
    #Read GPIO offsets from a file that /sys/glass/gpio/gpiochipN/label fields
    for line in open("/mnt/emmc/gpio_offsets.txt"):
     if "MIO0_OFFSET" in line:
      MIO0_OFFSET = line.split("=")[-1]
     if "AXI_GPIO_MAX_OFFSET" in line:
      AXI_GPIO_MAX_OFFSET = line.split("=")[-1]
    PsButtonPortnumber = str(int(MIO0_OFFSET)+int(0))
    PS_RedPortnumber = str(int(MIO0_OFFSET)+int(52))
    PS_GreenPortnumber = str(int(MIO0_OFFSET)+int(53))
    PL_RedPortnumber = str(int(AXI_GPIO_MAX_OFFSET)-int(1))
    PL_GreenPortnumber = str(int(AXI_GPIO_MAX_OFFSET)-int(0))
    
    
    if len(sys.argv) > 2:
        PORT = int(sys.argv[2])
        I = sys.argv[1]
    elif len(sys.argv) > 1:
        PORT = int(sys.argv[1])
        I = ""
    else:
        PORT = 8000
        I = ""
    
    
    class ServerHandler(http.server.SimpleHTTPRequestHandler):
    
    
        def do_GET(self):
            logging.warning("======= GET STARTED =======")
            logging.warning(self.headers)
    
            http.server.SimpleHTTPRequestHandler.do_GET(self)
    
    
        def do_POST(self):
            logging.warning("======= POST STARTED =======")
            logging.warning(self.headers)
            form = cgi.FieldStorage(
                fp=self.rfile,
                headers=self.headers,
                environ={'REQUEST_METHOD':'POST',
                         'CONTENT_TYPE':self.headers['Content-Type'],
                         })
            logging.warning("Host: %s", form.getvalue('Host'));
    
    
            if (form.getvalue('SETPSLED')):
                ledChosen = form.getvalue('PSledSel')
                logging.warning("PS LED Setting is %s", ledChosen)
                RedPath = '/sys/class/gpio/gpio' + PS_RedPortnumber + '/value'
                RedFile= open (RedPath,'w')
                GreenPath = '/sys/class/gpio/gpio' + PS_GreenPortnumber + '/value'
                GreenFile= open (GreenPath,'w')
                #"""
                if (int(ledChosen) == 0):
                    RedFile.write('0')
                    GreenFile.write('0')
                elif (int(ledChosen) == 1):
                    RedFile.write('1')
                    GreenFile.write('0')
                elif (int(ledChosen) == 2):
                    RedFile.write('0')
                    GreenFile.write('1')
                else:
                    RedFile.write('1')
                    GreenFile.write('1')
                """
                # Start for PS Button testing:
                ButtonPath = '/sys/class/gpio/gpio' + PsButtonPortnumber + '/value'
                ButtonFile= open (ButtonPath,'r')
                ButtonStatus = ButtonFile.read()
                ButtonFile.close()
                logging.warning("Button is %s", ButtonStatus)
                if (int(ButtonStatus) == 1):
                    RedFile.write('1')
                    GreenFile.write('0')
                else:
                    RedFile.write('0')
                    GreenFile.write('1')
                # End for PS Button testing
                """
                RedFile.close()
                GreenFile.close()
    
    
    
    
            if (form.getvalue('SETPLLED')):
                ledChosen = form.getvalue('PLledSel')
                logging.warning("PL LED Setting is %s", ledChosen)
                RedPath = '/sys/class/gpio/gpio' + PL_RedPortnumber + '/value'
                RedFile= open (RedPath,'w')
                GreenPath = '/sys/class/gpio/gpio' + PL_GreenPortnumber + '/value'
                GreenFile= open (GreenPath,'w')
                #time.sleep(0.5)
                if (int(ledChosen) == 0):
                    RedFile.write('0')
                    GreenFile.write('0')
                elif (int(ledChosen) == 1):
                    RedFile.write('1')
                    GreenFile.write('0')
                elif (int(ledChosen) == 2):
                    RedFile.write('0')
                    GreenFile.write('1')
                else:
                    RedFile.write('1')
                    GreenFile.write('1')
                RedFile.close()
                GreenFile.close()
    
    Handler = ServerHandler
    httpd = socketserver.TCPServer(("", PORT), Handler)
    httpd.serve_forever()

     

     

    It is easy to monitor status of GPIO from OS. I was able to monitor PS button status from the terminal:

    root@MiniZed:~# ls -la /sys/class/gpio/gpio903
    lrwxrwxrwx    1 root     root             0 Mar  6 00:55 /sys/class/gpio/gpio903 -> ../../devices/soc0/amba/e000a000.gpio/gpiochip3/gpio/gpio903
    root@MiniZed:~# cat /sys/class/gpio/gpio903/value
    0
    root@MiniZed:~# cat /sys/class/gpio/gpio903/value
    1

     

    Next steps

    1. I need to map Arduino compatible pins to sysfs, so I can control them and read their status from Python.

    2. I need to explore BLE tutorial and expose GPIO status from BLE interface.

    3. Connect the air quality sensors to MiniZed board. It will require some voltage reduction from 5V tot 3.3V level supported by the board potrs.

    4. Implement PL (FPGA) logic for processing sensor readings

     

    Conclusion

    MiniZed, Xilinx development platform, documentation are very powerful.

    If you don't have past FPGA / Vivado experience then you need to have a very good use case for FPGA and you need to plan significant amount of time to be successful with MiniZed.

    I think expanding MiniZed/FPGA development platform to makers movement will require the toolset simplification and related investments in support of Arduino IDE and/or cloud IDEs.


Comments

Also Enrolling

Enrollment Closes: Nov 20 
Enroll
Enrollment Closes: Nov 15 
Enroll
Enrollment Closes: Nov 5 
Enroll
Enrollment Closes: Oct 29 
Enroll
Enrollment Closes: Nov 18 
Enroll
Enrollment Closes: Nov 15 
Enroll
Enrollment Closes: Oct 30 
Enroll