Jump to content

stevers

Members
  • Posts

    7
  • Joined

  • Last visited

Posts posted by stevers

  1. Trying to detect PS MIO mapped button btn4 (mio 50, pin B13) and btn5 (mio51, pin B9) via sysfs reads. Built petalinux images from the digilent bsp for 2022.1 tools.

    The auto-generate dts for the gpio controller for this bsp is:

    gpio@e000a000 {
    compatible = "xlnx,zynq-gpio-1.0";
    #gpio-cells = <0x02>;
    clocks = <0x01 0x2a>;
    gpio-controller;
    interrupt-controller;
    #interrupt-cells = <0x02>;
    interrupt-parent = <0x04>;
    interrupts = <0x00 0x14 0x04>;
    reg = <0xe000a000 0x1000>;
    emio-gpio-width = <0x40>;
    gpio-mask-high = <0x00>;
    gpio-mask-low = <0x5600>;
    phandle = <0x0a>;
    };

    My test for the mio button detection is to configure the pins in /sus/class/gpio as follows, press and hold the button and performs reads.

    root@Petalinux-2022:/sys/class/gpio# cat gpiochip905/
    base       device/    label      ngpio      power/     subsystem/ uevent     
    root@Petalinux-2022:/sys/class/gpio# cat gpiochip905/label 
    zynq_gpio
    root@Petalinux-2022:/sys/class/gpio# cat gpiochip905/ngpio 
    118   
    root@Petalinux-2022:/sys/class/gpio# cat gpiochip905/base 
    905
    root@Petalinux-2022:/sys/class/gpio# echo 955 > /sys/class/gpio/export
    root@Petalinux-2022:/sys/class/gpio# echo 956 > /sys/class/gpio/export                                     
    root@Petalinux-2022:/sys/class/gpio# echo in > /sys/class/gpio/gpio955/direction 
    root@Petalinux-2022:/sys/class/gpio# echo in > /sys/class/gpio/gpio956/direction                        
    root@Petalinux-2022:/sys/class/gpio# cat /sys/class/gpio/gpio956/value                                  
    1
    root@Petalinux-2022:/sys/class/gpio# cat /sys/class/gpio/gpio956/value 
    1
    root@Petalinux-2022:/sys/class/gpio# cat /sys/class/gpio/gpio956/value 
    1

    Note I am always detecting a 1 value for both buttons in both pressed and released state. Am I missing something in the configuration?

    I am able to toggle the PS LED output on mio7 using similar tests.

  2. Hello,

    First time trying to load a vivado project for the '10/Petalinux/master' branch of the git@github.com:Digilent/Zybo-Z7-HW.git project. I obtained the vivado source for the project as follows:

    $ git clone -b 10/Petalinux/master --recursive git@github.com:Digilent/Zybo-Z7-HW.git

    The instructions in https://digilent.com/reference/programmable-logic/documents/git?redirect=1, indicate there should be a digilent_vivado_checkout.tcl available under to root to reconstruct the project but I cannot find it?

    Is there a different method required to create the Petalinux vivado project file for the zybo-z7 10?

    Thanks

  3. Good suggestion lonel.

    To test the PS side mio I successfully toggled the LED4 at mio 7. I exported the gpio at 905+7 = 912 as an output as below:

    echo 912 > /sys/class/gpio/export
    echo out > /sys/class/gpio/gpio912/direction
    echo 1 > /sys/class/gpio/gpio912/value
    echo 0 > /sys/class/gpio/gpio912/value

    Not seeing an input chage at BTN4, and BTN5 mio mappings:

    echo 955 > /sys/class/gpio/export
    echo 956 > /sys/class/gpio/export
    echo in > /sys/class/gpio/gpio955/direction
    echo in > /sys/class/gpio/gpio956/direction

    The following always return the same value when pressing the btn4 and btn5

    cat /sys/class/gpio/gpio955/val
    cat /sys/class/gpio/gpio956/val

    Thanks 

  4. Working with a zybo-z7 (XC7Z010-1CLG400C) trying to register a uio driver over the button 4 (mio50) gpio connected to the PS.

    The design already included a gpio module as: 

    / {
        amba: axi {
            gpio0: gpio@e000a000 {
                compatible = "xlnx,zynq-gpio-1.0";
                #gpio-cells = <2>;
                clocks = <&clkc 42>;
                gpio-controller;
                interrupt-controller;
                #interrupt-cells = <2>;
                interrupt-parent = <&intc>;
                interrupts = <0 20 4>;
                reg = <0xe000a000 0x1000>;
            };
        };
    };


            
    I have added the following btn_4 dts node in system-user.dtsi:

    / {
    
        chosen {
            bootargs = "console=ttyPS0,115200 earlyprintk uio_pdrv_genirq.of_id=generic-uio";
        };
    
        ...
    
        btn_4 {
        compatible ="generic-uio";
        interrupt-parent = <&gpio0>;
        // mio 50, rising edge
        interrupts = <50 1>;
        };
    };

    There kernel config includes:

    CONFIG_UIO=y
    CONFIG_UIO_PDRV_GENIRQ=y


    On booting the device with the new uio node, I see the btn_4 registered in the interrupt table:

    root@Petalinux-2022:~# cat /proc/interrupts 
               CPU0       CPU1  
    ...
     66:          0          0  zynq-gpio  50 Edge      btn_4
    ...
    
    But after pressing the button I don't see the interrupt count increase in /proc/interrupts  
               CPU0       CPU1  
    ...
     66:          0          0  zynq-gpio  50 Edge      btn_4
    ...


    Is there something incorrect about how the uio interrupt is configured for the new btn_4 node?

  5.  

    Trying to get the petalinux u-boot tftpboot to connect from a tftp server from a zybo-z7. The peltalinux demo was obtained from https://digilent.com/reference/programmable-logic/zybo-z7/demos/petalinux. The network configuration between tftp server and zybo is through a switch.

    The tftp server is configured as below:

    $ cat /etc/default/tftpd-hpa
    TFTP_USERNAME="tftp"
    TFTP_DIRECTORY="/var/lib/tftpboot"
    TFTP_ADDRESS=":69"
    TFTP_OPTIONS="--secure"

    $ ll /var/lib | grep tftpboot
    drwxrwxrwx   4 tftp          tftp          4096 Nov 26 11:54 tftpboot/

    $ ll /var/lib/tftpboot/ | grep system.bit
    -rw-r--r--   1 tftp tftp    978568 Nov 26 11:54 system.bit
     

    The server has been restarted:

    sudo systemctl restart tftpd-hpa

    When attempting a tftp transfer a connection does not seem to be made to the server at 192.168.1.28 (timeouts):

    Zynq> printenv ipaddr                            
    ipaddr=192.168.1.150
    Zynq> tftpboot 0x1000000 192.168.1.28:system.bit

    Using ethernet@e000b000 device
    TFTP from server 192.168.1.28; our IP address is 192.168.1.150
    Filename 'system.bit'.
    Load address: 0x1000000
    Loading: T T T T ...

    pings from u-boot seems ok:

    Zynq> ping 192.168.1.28
    Using ethernet@e000b000 device
    host 192.168.1.28 is alive

    pings from tftp server to zybo only work when the zybo u-boot tftp transfer is being attempted. When u-boot is not trying to tftp from tftp server to zybo fail as follows:

    tftp_server$ ping 192.168.1.150
    PING 192.168.1.150 (192.168.1.150) 56(84) bytes of data.
    From 192.168.1.28 icmp_seq=1 Destination Host Unreachable
    From 192.168.1.28 icmp_seq=2 Destination Host Unreachable
    From 192.168.1.28 icmp_seq=3 Destination Host Unreachable

    When u-boot is trying to tftp from tfto server to zybo fail as follows:

    $ ping 192.168.1.150
    PING 192.168.1.150 (192.168.1.150) 56(84) bytes of data.
    64 bytes from 192.168.1.150: icmp_seq=1 ttl=64 time=0.196 ms
    64 bytes from 192.168.1.150: icmp_seq=2 ttl=64 time=0.171 ms
    64 bytes from 192.168.1.150: icmp_seq=3 ttl=64 time=0.130 ms
     

    Anyone have success for tftp loading images from tftp server to zybo petalinux u-boot ?

×
×
  • Create New...