element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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 AXI VDMA works, but the bottom few lines are not proper
  • 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 13 replies
  • Subscribers 314 subscribers
  • Views 1078 views
  • Users 0 members are here
Related

AXI VDMA works, but the bottom few lines are not proper

Former Member
Former Member over 12 years ago

Hi, all

I am trying to make a simple vdma test demo on zedboard.
Here is my steps.I want to send my own picture(32-bit per pixel) for FPGA  processing.
  1. I read my own picture to memory and copy them to DDR.
  2. Using video dma core to send the input stream from DDR to my own pcore;
  3. Samely, recieve the input stream from my pcore to DDR;
  4. Finally, Write the output stream from DDR.
But i found the results in the bottom few lines are not proper, always comes with paceket loss?

Any ideas to fix this bug?



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

    Did you flush the cache?

    • 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

    Did you mean flush the vdma cache or OCM cache?

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

    From what I understood you use the MM2S Channel of the vdma, to the send an image from the ARM to the FPGA.
    So the CPUs L1/L2 cache.

    • 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

    Thanks for tips. Did you mean i must use fflush function in my programming begging? Now I increased the Vertical Size, such as 1000 to 1024, the results is OK.

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

    No, fflush() does something completely unrelated.
    Are you on bare metal? Then try a Xil_DCacheDisable() in the beginning of your program.

    • 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

    Oh, I am on Linux, not on bare metal. I found the Xil_DCacheDisable() in Zynq BSP, this function cannot use under linux. Any similar function to do this on Linux?

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

    How do you access the Memory? From Kernel or Userspace?
    And if userspace, do you mmap or something else?

    • 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

    Two methods I have done: insmod linux driver module or use mmap to operator registers.

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

    Details please, for mmap you could for example set pgprot_noncached() in the kernel.

    • 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

    Oh, I use mmap such as: clear memory for DDR start address
    void clearMemory(unsigned long startAddress, unsigned long size)
    {
    tint fd = open("/dev/mem", O_RDWR);
    tunsigned long int i = 0;

    tunsigned char *virtual_addr_in;

    tvirtual_addr_in = (unsigned char *)mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, (off_t)startAddress);

    tfor(i = 0; i < size; i++)
    t{
    ttvirtual_addr_in[i] = 0;
    t}
    tmunmap((void *)virtual_addr_in, size);
    tclose(fd);
    }
    In the beginning of programming, i use this function to clear MM2S and S2MM Start Address.

    And my application is under linux-digilent kernel(https://github.com/Digilent/linux-digilent).

    In his xilinx_dma driver (https://github.com/Digilent/linux-digilent/blob/master/drivers/dma/xilinx_dma.c), it uses dma_pool, so I think this is a coherent dma mapping.

    • 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