element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • 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
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • 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
Avnet & Tria Boards Community
  • Products
  • Dev Tools
  • Avnet & Tria Boards Community
  • More
  • Cancel
Avnet & Tria Boards Community
Avnet Boards Blog PYNQ v2.6 on Ultra96v2
  • Avnet Boards Blog
  • Forums
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Avnet & Tria Boards Community to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: ralphjy
  • Date Created: 3 Nov 2020 6:19 AM Date Created
  • Views 7023 views
  • Likes 3 likes
  • Comments 30 comments
  • ultra96-v2
  • pmbus
  • pynq v2.6
Related
Recommended

PYNQ v2.6 on Ultra96v2

ralphjy
ralphjy
3 Nov 2020

Last week I saw an announcement that PYNQ v2.6 is available for the Ultra96v1 and Ultra96v2 https://discuss.pynq.io/t/pynq-v2-6-is-avialable-for-ultra96-v1-and-v2/1951 .

 

PYNQ v2.6 is compatible with Xilinx tools version 2020.1.  DPU-PYNQ for v2.6 isn't available yet but because a pre-built image for the Ultra96v2 is available for PYNQ v2.6, I thought that I'd see what has changed from v2.5.

 

The first thing that I noticed is that there are 3 new notebooks in the Common directory

  1. display_port_introduction.ipynb
  2. programming_pybind11.ipynb
  3. ultra96_pmbus.ipynb

 

image

 

The pmbus notebook caught my eye because I had attended the PMBus webinar that Chris Ammann ctammann  had presented back in July PMBus and Power Supply Telemetry .

Chris had mentioned to me that the next BSP release will include the capability to update the PMICs on the Ultra96v2 and the UltraZed-EV and I expect will also include the sensors program that will display the PMIC settings.

 

I hoped that this pmbus notebook might provide the same information as that sensors program provided, i.e. the voltage and current measurements and settings for the all the PMICs.

 

The slide from the webinar shows the 3 PMICs and the 11 voltages that they control on the Ultra96v2 (I am not sure about the configuration of the Ultra96v1).

image

 

Running the pynq.get_rails() function almost works.  It provides the voltage, current and power information for the 2 IRPS5401 parts.  Unfortunately it lists the 10 voltages in alphabetical order by name rather than by IC position.  I can fix that easily enough but I don't understand why IR38060 (5V) isn't listed.  I also don't understand all the garbled stuff at the end.

 

image

 

I looked at the ultra96.conf file in /etc/sensors.d/ directory and the entry for the IR38060 at the end looks incorrect but I'm not quite sure what it should be.

I think it should be :

chip "*-i2c-6-45"

        label in1 "5V"

        label curr1 "5V"

        label power1 "5V"

 

I'll try that tomorrow.

 

ultra96.conf

bus "i2c-6" "i2c-0-mux (chan_id 4)"


chip "*-i2c-6-43"
        ignore in1
        ignore power1
        ignore curr1
        label in2 "AUX"
        label in3 "1V2"
        label in4 "PSDDR"
        label in5 "INT"
        label in6 "3V3_D"
        label power2 "AUX"
        label power3 "1V2"
        label power4 "PSDDR"
        label power5 "INT"
        label power6 "3V3_D"
        label curr2 "AUX"
        label curr3 "1V2"
        label curr4 "PSDDR"
        label curr5 "INT"
        label curr6 "3V3_D"

chip "*-i2c-6-44"
        ignore in1
        ignore power1
        ignore curr1
        label in2 "PSAUX"
        label in3 "PSINT_LP"
        label in4 "3V3"
        label in5 "PSINT_FP"
        label in6 "PSPLL"
        label power2 "PSAUX"
        label power3 "PSINT_LP"
        label power4 "3V3"
        label power5 "PSINT_FP"
        label power6 "PSPLL"
        label curr2 "PSAUX"
        label curr3 "PSINT_LP"
        label curr4 "3V3"
        label curr5 "PSINT_FP"
        label curr6 "PSPLL"

chip "*-i2c-6-45"
        #ignore power1
        label in1 "VIN"
        label curr1 "5V"
        label power1 "5V"
        label in2 "5V"
        compute in2 @/256,@*256

 

 

Anyway, I'll play with this some more.  The notebook also includes a DataRecorder class that allows you to record/plot the sensor measurements while running tests.  Here's a link to the PYNQ library documentation https://pynq.readthedocs.io/en/v2.6.1/pynq_libraries/pmbus.html .

 

Hope the updated DPU-PYNQ is available soon and also the new BSP release so I can update the current limit for running the DPU.

  • Sign in to reply

Top Comments

  • ctammann
    ctammann over 5 years ago +1
    Hey Ralph, Thanks for your interest in this functionality. Let me follow up with my team specifically about the 38060. Without knowing the code, what you say above makes sense if the called out address…
  • ctammann
    ctammann over 5 years ago in reply to ralphjy +1
    Hey Ralph, So the PS vs PL only matters for the reporting from the UltraScale device. The regulator info should still be accessible the same way. I don't know that there is a config file for that, but…
  • ctammann
    ctammann over 5 years ago in reply to ralphjy +1
    Hey Ralph, Check out this dtsi on the UltraZed platform - https://github.com/Avnet/meta-avnet/blob/master/recipes-bsp/device-tree/files/uz7ev-evcc/system-bsp.dtsi specifically lines 48 - 86 where the I2C…
  • ctammann
    ctammann over 5 years ago in reply to ralphjy

    Hey Ralph,

     

    We are talking Ultra96-V2, right? As far as updating the PMICs? If your board needs an update you can determine that from issuing the sensors command from the JTAG terminal. If you look at IOUT4, the "max" and "crit max" should be 4.75A and 5.25A respectively. I've highlighted that in this captureimage

    Can you verify that your board needs updating?

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

    Hi Mario,

    Just a quick update and a couple of questions.

     

    It looks like my problem with the pre-built Vitis-AI 1.2 may be an issue with my hardware configuration, but not quite sure.  I didn't have the debug console hooked up so I didn't see the errors initially (I usually SSH in after boot).  I'm getting errors associated with matchbox and the display.  I've always used an active HDMI adapter cable on the display port output and up until now it's been working okay.  With this build I'm getting an EDID error and some EGL errors.  As a matter of fact it's been working currently with PYNQ v2.6.  So, not sure what's happening but I can get to a login prompt so I've been trying the PMBus stuff.  I did verify that the ir38060 is setup correctly.  I guess if we added the labels that Chris uses for the supplies in /etc/sensors.d/sensors.conf  that might make the readings more meaningful.  We could call it ultra96v2.conf to make it more distinct like they do in the PYNQ build (they don't name all the labels however).

     

    First question - may have to ask Chris if you don't know.  I see that there is a pmic-prog directory and it has a pmic_prog executable and a pmic-configs directory with files for the 3 PMICs.  Does this mean that I can use this to update my board?

     

    Second question - if you get the chance can you measure the current irps5401-i2c-6-43:iout4 when you are running the worst case DPU programs.  I'll get to it at some point but maybe not for a while.

     

    Good news is no problems running Vitis-AI 1.2 on the UltraZed-EV and I also discovered that I already have the correct voltage in the PMIC so I don't have to update it.

     

    Ralph

     

    Quick edit - I found a couple of typos on the UltraZed-EV.

    In the directory  ~/Vitis-AI/VART/samples/pose_detection the model name is misspelled "model_dir_for_B4096_hr/ssd_pedestrain_pruned_0_97.elf".

    In the directory ~/Vitis-AI/vitis_ai_library/ the subdirectory should be "demos" but it is "demo".

    I fixed these on the SD card but you should either fix the SD image or your instructions.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • albertabeef
    albertabeef over 5 years ago in reply to ralphjy

    Ralph,

     

    The image should boot out of the box ... if you pop it into a linux machine, can it see the BOOT and ROOTFS partitions ?

     

    I discovered that the sensors data can also be accessed via python with the PySensors package (pip3 install pysensors).

    This python script will display the pout/iout values for the irps5401 devices (I multiply by 1000.0 to get the mW / mA values):

    ===========================================================

    import sensors

    import time

     

     

    sensors.init()

     

     

    #

    # Create list of power/current meters

    #

    irps5401_power_features = []

    irps5401_current_features = []

    for chip in sensors.iter_detected_chips():

        device_name = str(chip)

        adapter_name = str(chip.adapter_name)

        print( "%s at %s" % (device_name, adapter_name) )

        if 'irps5401' in device_name:

            for feature in chip:

                feature_name = str(feature.label)

                if 'pout' in feature_name:

                    label = device_name + ":" + feature_name

                    irps5401_power_features.append( (label, feature) )

                    #feature_value = feature.get_value() * 1000.0

                    #print( " %s : %8.3f mW" % (feature_name, feature_value) )

                if 'iout' in feature_name:

                    label = device_name + ":" + feature_name

                    irps5401_current_features.append( (label, feature) )

                    #feature_value = feature.get_value() * 1000.0

                    #print( " %s : %8.3f mA" % (feature_name, feature_value) )

     

     

    #

    # Display current value of power meters

    #

    while True:

        time.sleep(1)

        print (time.strftime("%H:%M:%S"))

        for (i, (label,feature)) in enumerate(irps5401_power_features):

            feature_value = feature.get_value() * 1000.0

            print( "\t %s : %8.3f mW" % (label, feature_value) )

     

     

     

     

    sensors.cleanup()

    ===========================================================

     

    This displays power values as follows:

    ===========================================================

    ir38060-i2c-6-45 at i2c-0-mux (chan_id 4)

    irps5401-i2c-6-43 at i2c-0-mux (chan_id 4)

    iio_hwmon-isa-0000 at ISA adapter

    irps5401-i2c-6-44 at i2c-0-mux (chan_id 4)

    16:34:50

             irps5401-i2c-6-43:pout1 :  187.500 mW

             irps5401-i2c-6-43:pout2 :    0.000 mW

             irps5401-i2c-6-43:pout3 :   93.750 mW

             irps5401-i2c-6-43:pout4 : 1156.250 mW

             irps5401-i2c-6-43:pout5 :    0.000 mW

             irps5401-i2c-6-44:pout1 :  281.250 mW

             irps5401-i2c-6-44:pout2 :  250.000 mW

             irps5401-i2c-6-44:pout3 :  437.500 mW

             irps5401-i2c-6-44:pout4 :  562.500 mW

             irps5401-i2c-6-44:pout5 :   31.250 mW

    16:34:51

             irps5401-i2c-6-43:pout1 :  187.500 mW

             irps5401-i2c-6-43:pout2 :    0.000 mW

             irps5401-i2c-6-43:pout3 :   93.750 mW

             irps5401-i2c-6-43:pout4 : 1156.250 mW

             irps5401-i2c-6-43:pout5 :    0.000 mW

             irps5401-i2c-6-44:pout1 :  281.250 mW

             irps5401-i2c-6-44:pout2 :  250.000 mW

             irps5401-i2c-6-44:pout3 :  437.500 mW

             irps5401-i2c-6-44:pout4 :  562.500 mW

             irps5401-i2c-6-44:pout5 :   31.250 mW

    ...

    ===========================================================

     

    I am now trying to plot the data with matplotlib, but am running into an unexpected issue :

    ===========================================================

    animate.py:46: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.

      plt.show()

    ===========================================================

     

    I know that opencv can display graphics with the imshow function ... so not certain why matplotlib cannot access the x engine ...

    I am thinking of creating an image with the plot data, then displaying that ... definitely not elegant by any means ...

     

    Yes, I do see what you mean about the "convenience of PYNQ" ...

    I am struggling with things I do not understand ...

     

    Mario.

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

    Hi Mario,

    I did see your project on Hackster but hadn't gotten around to trying it.  Nice to know that you can read the sensors - I didn't realize that command was working.  I had a problem getting the pre-built image to boot last night so I'll need to debug that.

     

    Have you tried reading the 5V PMIC?  I guess that would be ir38060-i2c-6-45.  I noticed that I'm missing the patch that Chris mentioned but maybe it is in your build.

     

    I was trying to set up PYNQ because of the convenience of being able to capture and plot the power data within the notebook for the different tests.  Of course for the DPU I'll need to wait for the upgrade for DPU-PYNQ to be released for v2.6.

     

    Are you posting your data?

     

    Ralph

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • albertabeef
    albertabeef over 5 years ago in reply to ralphjy

    Ralph,

     

    Just F.Y.I., the PMBus functionnality is working on the following Vitis-AI 1.2 design for Ultra96-V2:

    http://avnet.me/vitis-ai-1.2-project

     

    I would be curious to know what strategy you want to take to measure the current/voltage/power ?

    Here is what I have already experimented with on the Ultra96-V2:

    I have a script (display_power_all.sh) that reads certain power results every second

         #/bin/bash

         while [ true ]

         do

              sleep 1

              echo irps5401-i2c-6-43

              sensors irps5401-i2c-6-43 | grep pout

              echo irps5401-i2c-6-44

              sensors irps5401-i2c-6-44 | grep pout

         done


    I then run this script in the background, while I run one of the Vitis-AI-Library performance tests:
         source /mnt/sd-mmcblk0p1/power_testing_ultra96v2/display_power_all.sh &

         sleep 10

         cd /home/root/Vitis-AI/vitis_ai_library/samples/classification

         echo MODEL : resnet50

         ./test_performance_classification resnet50 ./test_performance_classification.list

     

    I can see that the pout4 reading from device rps5401-i2c-6-44 increases while the DPU examples are running.


    Chris,

    Which output from the sensors utility should we be monitoring ?

     

    Regards,
    Mario Bergeron.

    • 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 © 2026 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