element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
Software Application Development How to Communicate the DDR memory locations of Zedboard
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Avnet Boards Forums to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 12 replies
  • Subscribers 328 subscribers
  • Views 1508 views
  • Users 0 members are here
Related

How to Communicate the DDR memory locations of Zedboard

Former Member
Former Member over 12 years ago

Hi,
I created Boot.bin file for developing xilinx-linux on ZedBoard(Digilent),
Then copied Boot.bin and other files(ramdisk,devicetree,Zimage,zynq_fsbl.elf) to sdcard and
Booted xilinux OS on Zedboard Successfully,

Now iam trying to running c,c++ codes on xilinx Linux of Zed-Board,Those are executing fine,
But my codes having some hexadecimal input data,i want to move those to DDR memory loacation's of Zedboard usnig xilinux Linux OS,

Can any provide some help for communicating the DDR of
ZedBoard(on xilinux Linux) and provide sample links's for this Communication.

I searched and tried some exaples on ZedBoard.org,this
communication can done through using Standalone OS,In standalone OS,provided some API's,Macro's for this interaction with DDR of ZEDboard and Also some sample
examples provided in Zedboard.org.

Now same way i want to perform some RD/WR operations on DDR of Zedboard using xilinx Linux OS.....

Can any one please suggest me for this DDR interaction through xilinx Linux....

  • Sign in to reply
  • Cancel
  • Former Member
    0 Former Member over 12 years ago

    Hi,

    It's not clear to me what you're attempting to do. If you want to copy some data to a specific address in physical memory space (e.g. a certain region in the DDR memory), you'll have to write a small kernel driver for this. At a minimum, this kernel driver needs to map the specific physical memory chunk into virtual address space. Otherwise it can't be reached from Linux.

    As a side note, it looks like you want to communicate data with the PL (logic part) of the device. You may want to use the Xillybus streams for this purpose (see http://xillybus.com)

    Note that you may configure (and immediately download) your custom Xillybus IP core online to meet your communication needs.

       Eli

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to Former Member

    Hi Eli,

    Thanks for ur reply...
    here i am trying to accessing the some memory region's of Zed for moving my input data's to corresponding location's.

    For this communication's needed the linux driver's..
    wt u mentioned in the above,

    In the same way,on Standalone OS,zedboard.org provided some API's and examples for communicating with DDR,OCM,PL region's through DMA,
    here i am able to accessing the memory region's of Zed,
    But in my code files,i used c-format  fopen()and other file function's.
    By using this function call's i am trying to accessing the my hexa data from input.txt files and then trying to move my data's to OCM or other memory region's of Zed.

    Compilation of my c-codes in SDK is fine,
    when i am trying to debugging the my code,step by step,the fopen() system call giving the problem,
    for example: File *fp=fopen("cur.txt","r");
    i am using this way for reading my data from input files,
    But in SDK,in Debugging time my *fp is always going to NULL,

    can you please let me know about this isssue,where i am doing wrong,
    Is it fopen() and c-forat file function's are able to use in the xilinx SDK or Not?
    Please provide some help in this issue?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to Former Member

    When using Xillinux, I recommend compiling the C code on the Zedboard itself with gcc (possibly using "make" as well). A lot of things can go wrong when cross-compiling user space applications.

    Another thing to keep in mind, is that examples that were written for a bare-metal ("standalone"?) setting, i.e. without Linux, are irrelevant. In the bare-metal situation, you can access any peripheral just by setting a pointer to its address in physical memory, and use the pointer. Linux (or any decent OS) doesn't let you do that.

    So that leaves you with two choices:
    (1) Write a small driver for the kernel to mediate between the user space program and the physical resources.
    (2) Use some existing kit. For general-purpose I/O with the logic fabric, Xillybus or Xillybus Lite may come handy. These are already installed in Xillinux.

    As for your question about the return value of fopen() being NULL, this simply indicates that opening the file failed. The most plausible reason is that the file didn't exist.

    A final note: Xillinux is a full-blown Linux OS, which behaves very much like a desktop distribution of Linux (Ubuntu 12.04 for PCs in particular). If you're struggling a bit with the plain C programming part, I would suggest installing Linux on a desktop, and get those issues sorted out first, possibly with Eclipse for C/C++. I wouldn't install Eclipse on Xillinux itself, but you should be able to export the project into a plain sources + Makefile bundle in any decent IDE for Linux.

    For the purpose of plain programs in C, anything that runs on the desktop should run on Xillinux exactly the same.

    Hope this moves you forward,
        Eli

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to Former Member

    Hi Eli,

    Thanks for ur reply and your suggession's.......

    Previously i created xillinx Linux(Ubuntu) on Zedboard by using xillybus,i compiled and executed large c,c++ codes on xillinux successfully,

    For communication,can u please provide some sample link's or sample example stuff on this Linux side.

    HEVC codes also i executed successfully on this.

    But now i am trying on Standalone OS Zed,
    As now i am trying to compiling and executing nearly 10 c-code files on Standalone Zed,
    In this files i used file operation's on c-format file sys calls(fopen,etc)...

    same files i am trying to running on Zed(standalone),
    there i given  exact path to my input file in the fopen(),file also exist...
    but still my still my *fp is always goes to NULL,

    can u plz let me know is c-format file related sys calls is possible to xilinx SDK?
    for same purpose any changes required on SDK environment?

    Please provide some help on this..................


    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to Former Member

    Xillybus' documentation explains the communication issue pretty extensively, and the demo bundle's code shows an initial setting to start off with.

    As for a non-Linux setting, I can't help much, as my focus is working with Linux.

       Eli

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to Former Member

    Hi Eli,

    I followed the steps in the below pdf document for AMP running,
    http://www.xilinx.com/support/documentation/application_notes/xapp1078-amp-linux-bare-metal.pdf

    Here i am able to debugging the code files related to app_cpu1 project,amp_fsbl project by using Standalone OS in  xilinx SDK,
    when i am trying to debugging Softuart and rwmem projeccts created using Linux OS on xilinx SDK,

    i am facing error as

    .gdbinit: No such file or directory.
    kill
    The program is not being run.

    can you please provide some solution for this problem.

    Here my main theme is to debug the sample program which is created by using the Linux OS in xilinx SDK.

    can u please provide some help for this debugging using Linux OS.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to Former Member

    Personally, I don't use debuggers at all, but the common basic tool used on Linux is gdb. It's not very convenient to use, because it's a command-line tool. But it has several graphical front ends (ddd is an ancient one, and I suppose there are newer tools).

    Anyhow, it seems like there's no ready-to-run graphical front-end for gdb packaged for Ubuntu 12.04 on ARM.

    To make things even worse, there is no gdb server either, so one can't run a remote debugger front end.

    I don't know how much this is helpful, but if you have a friendly debugger for ARM, which can attach to a remote target running gdbserver (see http://en.wikipedia.org/wiki/Gdbserver ) then this is the way to install it on Xillinux (by native compilation). But I'm really not sure about how to set up the client.

    (the first command gets libtermcap, which is necessary for the compilation)

    # apt-get install libncurses5-dev
    # wget http://ftp.gnu.org/gnu/gdb/gdb-7.6.tar.gz
    # tar -xzf gdb-7.6.tar.gz
    # cd gdb-7.6/
    # ./configure
    # make

    Another alternative seems to be to compile a graphical debugger tool, but that isn't all that easy.

    I hope this helps somehow.
       Eli

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to Former Member

    Hi Eli,
    Thank's for ur reply and your great suggestion's to me...

    please check the pdf document once(in this Linux OS steps availble form page no 18 to 34....) for debugging the codes using Linux OS,
    currently i am following these steps for xmd debugging,
    http://www.xilinx.com/support/documentation/application_notes/xapp1078-amp-linux-bare-metal.pdf
    Here also,able to debugging the codes related to app_cpu1 using with standalone OS,
    and SoftUart ,rwmem project created using with Linux OS in xilinx SDK,
    But when debugging the Linux OS related project using with XMD,
    i am facing the error as
    .gdbinit: No such file or directory.
    kill
    The program is not being run.
    and launching debug has encountered a problem.

    can u please provide some help for this way of debugging using XMD in xilinx SDK using Linux OS.



    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to Former Member

    As I mentioned earlier, I don't use debuggers at all myself (or more precisely, "printf" is my debugger). Besides, debuggers that are integrated with an IDE may not cooperate when you try to debug something that wasn't compiled with the integrated compiler. I don't know how the SDK (which is derived from Eclipse) behaves on this matter.

    And compiling user space application is best done natively, mostly because they depend on libraries.

    Ideally, you would be able to connect the SDK's debugger to the gdbserver running directly on the board. The docs say that XDB behaves like a GDB server, so this could work. You may want to give this a go.

    Anyhow, I suggest opening a new thread on this forum about running debuggers. Others may answer better than myself, but they probably haven't seen your second question because of the subject of the entire thread.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to Former Member

    Ok,sure....
    I will try  to open the new thread on this forum for debugging.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube