cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer
Observer
241 Views
Registered: ‎05-17-2020

How can I access memory using Petalinux 2018.3 user application in zcu102

Jump to solution

Hello.

I made a FPGA configuration and a C code that access to zcu102 memory as follows,

 

 

int main()
{
    init_platform(); 
    short a;
    Xil_Out16((UINTPTR)XPAR_BRAM_0_BASEADDR, 255); 
    a = Xil_In16((UINTPTR)XPAR_BRAM_0_BASEADDR);
    printf("%hd\n\r",a);
    cleanup_platform();
    return 0;
}

 

 

 

When I works this code in Vivado SDK with Jtag, It works well.

But I want my FPGA configuration to be imported when ZCU102 boots with the SD card containing Petalinux 2018.3.

So I followed the document(ug1144 page.103) below,

Screenshot from 2020-05-25 14-41-22.png

 

Next, I made an user-application and I ran the application.

But I got an error message.

sd_200522.JPG

 

How can I access memory using petalinux user application?

I desperately need help..

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Moderator
Moderator
138 Views
Registered: ‎09-12-2007

Re: How can I access memory using Petalinux 2018.3 user application in zcu102

Jump to solution
5 Replies
Highlighted
Moderator
Moderator
205 Views
Registered: ‎09-12-2007

Re: How can I access memory using Petalinux 2018.3 user application in zcu102

Jump to solution

The xil_io.h is a baremetal library. You should use a mmap in Linux:

 

https://www.kernel.org/doc/html/v4.12/driver-api/uio-howto.html

0 Kudos
Highlighted
Observer
Observer
163 Views
Registered: ‎05-17-2020

Re: How can I access memory using Petalinux 2018.3 user application in zcu102

Jump to solution

Thank you for you reply.

But I am already using that library to use the Xil_Out, Xil_In function.

Is there anything else to do?

0 Kudos
Highlighted
Moderator
Moderator
139 Views
Registered: ‎09-12-2007

Re: How can I access memory using Petalinux 2018.3 user application in zcu102

Jump to solution
Highlighted
Observer
Observer
111 Views
Registered: ‎05-17-2020

Re: How can I access memory using Petalinux 2018.3 user application in zcu102

Jump to solution

Oh, I see.

Maybe, I have to use peekpoke application..

Thank you so much!

0 Kudos
Highlighted
Observer
Observer
92 Views
Registered: ‎05-17-2020

Re: How can I access memory using Petalinux 2018.3 user application in zcu102

Jump to solution

I tried again with peekpoke application, but when I type "poke 0xa0001000 0x11", the process stop as picture below..

unnamed.png

Do I have to do something like creating a module to control memory or modifying device tree??

0 Kudos