Jump to content
  • 0

Tim S. Zybo Z7-20 PetaLinux project 1 - documentation resources?


Tim S.

Question

Hi.  I'd like to ask if Digilent staff or forum users have any tips for finding PetaLinux or Embedded Linux documentation on any of the following:

1. xlnx,axi-gpio - how to read on edge or level interrupt from Zynq PL pins by adding to the device tree and not using the sysfs gpio-demo. Polling is not sufficient. Purpose: connect Pmod PIR.

2. xlnx,axi-iic - how to configure the device tree for AMBA PL Xilinx IIC, and perform more custom commands than i2cset and i2cget allow. I am thinking a custom kernel driver is in order. Purpose: read Pmod HYGRO readings.

3. xlnx,axi-quad-spi - how to configure the device tree for Mode 0 or Mode 3 standard devices for AMBA PL Xilinx Quad SPI in standard SPI mode. I am thinking a custom kernel driver is in order. Purpose: read the Pmod ALS reading, read the Pmod ACL2 readings.

4. xlnx,axi-quad-spi - how to configure the device tree AMBA PL Xilinx Quad SPI in Quad SPI mode, to connect a NOR flash to the Zynq PL and have it show up as a MTD device. The Digilent Demo already shows how to add the NOR flash as MTD device for the Zynq PS. Purpose: MTD block device access of the Pmod SF3.

Just a note that this is a hobby project, not school or employment, and that I do have professional background in Embedded Linux.

Thanks for any input.

Cheers.

Tim S.

 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
4 hours ago, Tim S. said:

Hi.  I'd like to ask if Digilent staff or forum users have any tips for finding PetaLinux or Embedded Linux documentation on any of the following:

1. xlnx,axi-gpio - how to read on edge or level interrupt from Zynq PL pins by adding to the device tree and not using the sysfs gpio-demo. Polling is not sufficient. Purpose: connect Pmod PIR.

2. xlnx,axi-iic - how to configure the device tree for AMBA PL Xilinx IIC, and perform more custom commands than i2cset and i2cget allow. I am thinking a custom kernel driver is in order. Purpose: read Pmod HYGRO readings.

3. xlnx,axi-quad-spi - how to configure the device tree for Mode 0 or Mode 3 standard devices for AMBA PL Xilinx Quad SPI in standard SPI mode. I am thinking a custom kernel driver is in order. Purpose: read the Pmod ALS reading, read the Pmod ACL2 readings.

4. xlnx,axi-quad-spi - how to configure the device tree AMBA PL Xilinx Quad SPI in Quad SPI mode, to connect a NOR flash to the Zynq PL and have it show up as a MTD device. The Digilent Demo already shows how to add the NOR flash as MTD device for the Zynq PS. Purpose: MTD block device access of the Pmod SF3.

Just a note that this is a hobby project, not school or employment, and that I do have professional background in Embedded Linux.

Thanks for any input.

Cheers.

Tim S.

 

I answered my own question on testing the Pmod HYGRO from the command-line.

Retrieving the raw values:

root@Petalinux-2022:~# i2ctransfer -y 3 w1@0x40 0x00
root@Petalinux-2022:~# i2ctransfer -y 3 r4@0x40
0x5f 0xcc 0xa4 0x68
root@Petalinux-2022:~# i2ctransfer -y 3 w1@0x40 0x00 && usleep 100000 && i2ctransfer -y 3 r4@0x40
0x5f 0xdc 0xa3 0xe8
root@Petalinux-2022:~# i2ctransfer -y 3 w1@0x40 0x00 && usleep 100000 && i2ctransfer -y 3 r4@0x40
0x5f 0xe0 0xa3 0xe8

Processing the raw values to Fahrenheit and RH% with a Python shell on the workstation:

>>> ((225 * 0x5fe0) / (2**9) - 4000) / 100
67.859375
>>> ((225 * 0x5fdc) / (2**9) - 4000) / 100
67.841796875
>>> ((225 * 0x5fe0) / (2**9) - 4000) / 100
67.859375
>>> ((0xa468 * 625) / (2**12)) / 100
64.22119140625
>>> ((0xa3e8 * 625) / (2**12)) / 100
64.02587890625

So the sensor reads my desk space as 67.86 degrees Fahrenheit and 64% Relative Humidity.

I also found an old, probably incomplete, GPLv3 I2C kernel driver for PmodTMP2, which is similar in concept.

https://github.com/inipro/zynqmp_linux/blob/master/petalinux/workspaces/pmodtmp2/pmodtmp2.c

 

Link to comment
Share on other sites

  • 0
On 5/28/2023 at 4:52 PM, Tim S. said:

Hi.  I'd like to ask if Digilent staff or forum users have any tips for finding PetaLinux or Embedded Linux documentation on any of the following:

1. xlnx,axi-gpio - how to read on edge or level interrupt from Zynq PL pins by adding to the device tree and not using the sysfs gpio-demo. Polling is not sufficient. Purpose: connect Pmod PIR.

2. xlnx,axi-iic - how to configure the device tree for AMBA PL Xilinx IIC, and perform more custom commands than i2cset and i2cget allow. I am thinking a custom kernel driver is in order. Purpose: read Pmod HYGRO readings.

3. xlnx,axi-quad-spi - how to configure the device tree for Mode 0 or Mode 3 standard devices for AMBA PL Xilinx Quad SPI in standard SPI mode. I am thinking a custom kernel driver is in order. Purpose: read the Pmod ALS reading, read the Pmod ACL2 readings.

4. xlnx,axi-quad-spi - how to configure the device tree AMBA PL Xilinx Quad SPI in Quad SPI mode, to connect a NOR flash to the Zynq PL and have it show up as a MTD device. The Digilent Demo already shows how to add the NOR flash as MTD device for the Zynq PS. Purpose: MTD block device access of the Pmod SF3.

Just a note that this is a hobby project, not school or employment, and that I do have professional background in Embedded Linux.

Thanks for any input.

Cheers.

Tim S.

 

I put together a UIO example PetaLinux program that waits for GPIO interrupts from 2 Pmod PIR, Buttons, and Switches, and outputs to the four basic LEDs. This experiment answered my UIO questions for these components. References listed at the head of the file.

 

Edited by Tim S.
File removed because of need to license GPL 2.0.
Link to comment
Share on other sites

  • 0
On 5/28/2023 at 4:52 PM, Tim S. said:

Hi.  I'd like to ask if Digilent staff or forum users have any tips for finding PetaLinux or Embedded Linux documentation on any of the following:

1. xlnx,axi-gpio - how to read on edge or level interrupt from Zynq PL pins by adding to the device tree and not using the sysfs gpio-demo. Polling is not sufficient. Purpose: connect Pmod PIR.

2. xlnx,axi-iic - how to configure the device tree for AMBA PL Xilinx IIC, and perform more custom commands than i2cset and i2cget allow. I am thinking a custom kernel driver is in order. Purpose: read Pmod HYGRO readings.

3. xlnx,axi-quad-spi - how to configure the device tree for Mode 0 or Mode 3 standard devices for AMBA PL Xilinx Quad SPI in standard SPI mode. I am thinking a custom kernel driver is in order. Purpose: read the Pmod ALS reading, read the Pmod ACL2 readings.

4. xlnx,axi-quad-spi - how to configure the device tree AMBA PL Xilinx Quad SPI in Quad SPI mode, to connect a NOR flash to the Zynq PL and have it show up as a MTD device. The Digilent Demo already shows how to add the NOR flash as MTD device for the Zynq PS. Purpose: MTD block device access of the Pmod SF3.

Just a note that this is a hobby project, not school or employment, and that I do have professional background in Embedded Linux.

Thanks for any input.

Cheers.

Tim S.

 

I added functionality to control the Zybo Z7-20 RGB LEDs based on a combination of switch selections, button presses, and Pmod PIR interrupts. Find the example attached. Find my full project at:

https://github.com/timothystotts/Zybo-Z7-HW-1

https://github.com/timothystotts/Zybo-Z7-OS-1

branches: independent/Tim_S_project_1

Cheers.

Tim S.

 

 

Edited by Tim S.
Need to license example code as GPL-2.0.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...