Search the Community

Showing results for tags 'uio'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • News
    • New Users Introduction
    • Announcements
  • Digilent Technical Forums
    • FPGA
    • Digilent Microcontroller Boards
    • Non-Digilent Microcontrollers
    • Add-on Boards
    • Scopes & Instruments
    • LabVIEW
    • FRC
    • Other
  • General Discussion
    • Project Vault
    • Learn
    • Suggestions & Feedback
    • Buy, Sell, Trade
    • Sales Questions
    • Off Topic
    • Educators
    • Technical Based Off-Topic Discussions

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL







Found 7 results

  1. Hello, finally i was able to make a petalinux build with the BSP 2017.4 - so far, so good. Then i find out, which uio device is connected with the Arty-Z7-20 Buttons and switches. Both - the Buttons and also the Switches - are connected to one GPIO-IP-Core (Dual-Channel, all inputs). One AXI-GPIO has one base address and a dual channel GPIO has even only one base address. So the only way to address both channels is to use the base address offset for channel one and for channel two, isn't it? If i read channel one - which is assigned to the Buttons - then i can read the Buttons. If i read the channel two (Switches) - one code line later - then i got no result. So my questions is: What must i do to read the Arty-Z7-20 Switches (petalinux, BSP 2017.4)? Thank you...
  2. Hello, i made the following design: You can see two GPIO Ports: - GPIO_RGB_LED, 3 Bit, Output only - GPIO_SW, two data bits plus one interrupt bit (e.g. Input clk), this port should throw Interrupts into the Linux App. After i build that design with Vivado, i used petalinux to create a Linux image. Here you can see the "/dev"-Folder which contains the installed Drivers: You can see three GPIO-Drivers. Now my question: In former questions i ask for the Driver Support in Linux and how i can write or use them. You told me, that there is a simple way to access memory mapped ip-cores with the "uio"-Driver. First i was glad to see that the Drivers are automaticaly added to the image. But i'am missing the expected "uio"-Drivers. What must i do to get the "uio"-Drivers for my design with petalinux? Thank you...
  3. Hello, i need urgently a Zynq board which is able to run petalinux; it must support tcp/ip-select and uio-interrupt. I do not know, which digilent board has the examples that include the needed funtionality. I would buy this board because i Need it for my Masterthesis! If you do not have such a board (with the right examples) then please tell me who such a board sells. Or, you give me please a very simple but complete project with only one gpio (Interrupt) that fits on the Arty-Z7-20 board including a petalinux image with the described functionality. My given time is limited and it is very important to me Thank you...
  4. Hello, i have an issue with the uio Interrupt handling. An AXI-GPIO ip core with enabled interrupt is connected with the interrupt system of the Zynq on an Arty-Z7-20 board. With petalinux i created an minimalistic Linux image which is running on that design and gives the GPIO-HW an uio device. I can read and write data throu that GPIO-HW via the Linux uio device. Now i wish to use the Interrupt ability. I know that i must make a blocking read Operation on the uio device to wait for an incomming Interrupt. If i push the "make Interrupt"-Button, then i do not receive an Interrupt (blocking read does not return). The GPIO IP core was configured like on a bare metal System. The "proc/Interrupts" file is empty, so Linux detected no Interrupts. I think that i must configure petalinux (e.g. petalinux-config -c kernel) to process Interrupts with Linux but i do not know which part of the large configuration i should Change and in which way. So here my questions: 1. What are the needed petalinux config items and there values to enable the uio Interrupt handling on Linux (petalinux)? 2. Are there special c function calls to enable the Linux Interrupt ability? 3. Has anybody ever seen an uio interrupt handling application on a zynq and could you give me the example code? 4. Is there a digilent eval board with a demo app uses that Technologie? 5. What is the Price in US-$ to get that informations? Thank you...
  5. The uio_dmem_genirq driver is backwards compatible with the uio_pdrv_genirq driver but with the addition that it dynamically allocates continuous memory. How do the device tree entries have to be defined to load the dmem driver? The working configuration for the pdrv version consists of the following device tree entry: spw0@7aa00000 { compatible = "generic-uio"; reg = <0x7aa00000 0x10000>; interrupts = <0x0 0x1D 0x4>; interrupt-parent = <0x3>; clocks = <0x1>; }; and changing the bootargs to console=ttyPS0,115200 root=/dev/mmcblk0p1 rw rootwait earlyprintk uio_pdrv_genirq.of_id=generic-uio. My current configuration for the dmem version looks as follows, but does not load the UIO driver despite it being compiled into the kernel. This is the output of /lib/modules/4.4.0-xilinx/modules.builtin kernel/drivers/uio/uio.ko kernel/drivers/uio/uio_pdrv_genirq.ko kernel/drivers/uio/uio_dmem_genirq.ko The two different styles used to try and configure the drivers are: spw0@7aa00000 { compatible = "generic-uio"; reg = <0x7aa00000 0x10000>; uio,number-of-dynamic-regions = <1>; uio,dynamic-regions-sizes = <0x4000>; interrupts = <0x0 0x1D 0x4>; interrupt-parent = <0x3>; clocks = <0x1>; }; spw1@7aa00000 { compatible = "generic-uio"; num_dynamic_regions = <2>; dynamic_region_sizes = <0x8000>; interrupts = <0x0 0x1E 0x4>; interrupt-parent = <0x3>; clocks = <0x1>; }; And the bootargs are updated to console=ttyPS0,115200 root=/dev/mmcblk0p1 rw rootwait earlyprintk uio_dmem_genirq.of_id=generic-uio. Note: this is based on my StackOverflow question
  6. Hello, if i type in the Linux console (Arty-Z7 with Linux, Standard Linux image) in the "dev"-Folder the command "ls" then i see three UIO devices (UIO0, UIO1, UIO2). Now my question: Are these devices reserved, or can i manipulate them to access my custom Hardware? Thank you...
  7. Dear Experts I need help regarding interrupt handling using UIO. I am using Vivado 2015.4 and Petalinux 2015.4. The board used is Zedboard. I made the following vivado project attached as image. The interrupts from AXI and Fabric (PL-PS) are enabled. Afterwards i was able to export it as UIO and it shows in /dev as uio0. Now I implemented the following code by following this link: My code is as follows: /* * File: main.c * Author: fss * * Created on August 23, 2017, 12:35 PM */ #include <sys/mman.h> #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <poll.h> #include <fcntl.h> #include <errno.h> #define GPIO_DATA_OFFSET 0x00 #define GPIO_TRI_OFFSET 0x04 #define GPIO_DATA2_OFFSET 0x08 #define GPIO_TRI2_OFFSET 0x0C #define GPIO_GLOBAL_IRQ 0x11C #define GPIO_IRQ_CONTROL 0x128 #define GPIO_IRQ_STATUS 0x120 unsigned int get_memory_size(char *sysfs_path_file) { FILE *size_fp; unsigned int size; // open the file that describes the memory range size that is based on the // reg property of the node in the device tree size_fp = fopen(sysfs_path_file, "r"); if (size_fp == NULL) { printf("unable to open the uio size file\n"); exit(-1); } // get the size which is an ASCII string such as 0xXXXXXXXX and then be stop // using the file fscanf(size_fp, "0x%08X", &size); fclose(size_fp); return size; } void reg_write(void *reg_base, unsigned long offset, unsigned long value) { *((volatile unsigned long *)(reg_base + offset)) = value; } unsigned long reg_read(void *reg_base, unsigned long offset) { return *((volatile unsigned long *)(reg_base + offset)); } uint8_t wait_for_interrupt(int fd_int, void *gpio_ptr) { static unsigned int count = 0, bntd_flag = 0, bntu_flag = 0; int flag_end=0; int pending = 0; int reenable = 1; unsigned int reg; unsigned int value; // block (timeout for poll) on the file waiting for an interrupt struct pollfd fds = { .fd = fd_int, .events = POLLIN, }; int ret = poll(&fds, 1, 100); printf("ret is : %d\n", ret); if (ret >= 1) { read(fd_int, (void *)&reenable, sizeof(int)); // &reenable -> &pending // channel 1 reading value = reg_read(gpio_ptr, GPIO_DATA_OFFSET); if ((value & 0x00000001) != 0) { printf("Interrupt recieved"); } count++; usleep(50000); // anti rebond if(count == 10) flag_end = 1; // the interrupt occurred for the 1st GPIO channel so clear it reg = reg_read(gpio_ptr, GPIO_IRQ_STATUS); if (reg != 0) reg_write(gpio_ptr, GPIO_IRQ_STATUS, 1); // re-enable the interrupt in the interrupt controller thru the // the UIO subsystem now that it's been handled write(fd_int, (void *)&reenable, sizeof(int)); } return ret; } int main(void) { int fd = open("/dev/uio0", O_RDWR); if (fd < 0) { perror("open"); exit(EXIT_FAILURE); } int gpio_size = get_memory_size("/sys/class/uio/uio0/maps/map0/size"); /* mmap the UIO devices */ void * ptr_axi_gpio = mmap(NULL, gpio_size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); while (1) { wait_for_interrupt(fd,ptr_axi_gpio); } close(fd); exit(EXIT_SUCCESS); } But the issue is that this code is not catching the interrupt. Kindly help me in this. Any suggestion/links are more than welcomed Regards