UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Explorer
Explorer
1,962 Views
Registered: ‎03-22-2017

AXI4-lite read/write hangs in Linux

I have problems with a Vivado HLS generated module that has an AXI4-lite interface.The board is a ZynqMP (ZCU102). The problem occurs only when I run it in Linux. The bare-metal execution (Vivado SDK) works well.

 

The AXI4-lite interface is mapped at 0x00_A000_0000 (it is a Cortex-A53). 

 
If I try to read or write the AXI4-lite memory mapped registers, the entire board hangs:
 
$ devmem2 0x00_A000_0000
 
The same happens with the following code. Does anyone experienced the same issue or have a comment?
 
 
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/mman.h>

#define FILTER_3X3_BLUR_AXIM_BASE_ADDRESS 0xA0000000

int main()
{
        int fd;
        int flag;
        unsigned long page_size;
        unsigned long page_addr;
        unsigned long page_offset;
        unsigned long *ptr;

        unsigned long done;

        fd = open("/dev/mem", O_RDWR);

        page_size = sysconf(_SC_PAGESIZE);
        page_addr = (FILTER_3X3_BLUR_AXIM_BASE_ADDRESS & (~(page_size-1)));
        page_offset = FILTER_3X3_BLUR_AXIM_BASE_ADDRESS - page_addr;
        ptr = mmap(NULL, page_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, page_addr);

        // Program the accelerator
        *((unsigned long*) (ptr + page_offset)) = 16; // It hangs here!

        flag = munmap(ptr, page_size);
        close(fd);
        return 0;
}
 

 

0 Kudos
3 Replies
Xilinx Employee
Xilinx Employee
1,884 Views
Registered: ‎02-26-2014

Re: AXI4-lite read/write hangs in Linux

Hi,

 

Check if the issue is related to following Answer Record about 'clk_ignore_unused' boot arg:

 

https://www.xilinx.com/support/answers/63208.html

 

Regards,

Ravi

0 Kudos
Visitor evam.gilotra
Visitor
379 Views
Registered: ‎07-05-2018

Re: AXI4-lite read/write hangs in Linux

Hi @gdg 

 

Were you able to resolve the issue of hanging of AXI4-lite?

 

Currently, I am also facing the exact same problem. I am trying to read and write multiple times to a Vivado HLS generated accelerator on the same board(ZCU102). But the AXI hangs after 16 read transactions and stops reading the remaning data. As a result, the accelerator never completes it's computaion and the ARM processor keeps waiting for results, driving it to sleep mode.

 

Any help on the matter would be really appreciated.

Thank you

Evam

0 Kudos
Contributor
Contributor
318 Views
Registered: ‎12-23-2018

回复: AXI4-lite read/write hangs in Linux

Hello friend! I am confused by using custom IP in Linux, and that will be very kind of you to help.

Are you using your custom IP in PL? I learn that if I wanna use my custom IP in PL, I would have to write a device driver for it. Unfortunately, I have no idea how to write one......  Can't I just put the data into the physical space or directly configure the registers which my custom IP owns?

0 Kudos