element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • More
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • More
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • More
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • More
  • 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
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
Software Application Development Invalidating the data cache
  • Forums
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Avnet Boards Forums requires membership for participation - click to join
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 11 replies
  • Subscribers 41 subscribers
  • Views 594 views
  • Users 0 members are here
Related

Invalidating the data cache

Former Member
Former Member over 7 years ago

I have a problem that I am trying to fix in a program I have written.

I receive internet packets, the Rx interrupt affects a bool so that in a loop I can to to then request the RxBD from the hardware. I then copy out the packets into some linked list containers that I have before returning the BDs to the hardware.


My problem is that when I go to read the data that the BD points to, the cached data is wrong, so I invalidate it. Except that using

void Xil_DCacheInvalidateRange(unsigned int adr, unsigned len)

invalidates a cache line but not necessarily where the packet information starts. It looks at the address I pass to it, then it moves from there to the start of the first cache line and only then begins invalidating the cache.


This leads to varying parts of my packet information being "chopped off". Anywhere from 0 to 28 bytes worth of data.


A solution to this, as stated in the Xilinxs documentation seems to be to cache align the... sections of memory that the BD point to. The problem is, I have no idea how to do this.


I have tried simply disabling the entire cache at the start of the program, however this doesn't seem to work. I don't know if it is my attempt that doesn't work, or if it simply doesn't fix the problem.

(Code used to try to disable the entire cache)
Xil_L2CacheDisable();
Xil_L1DCacheDisable();
Xil_L1ICacheDisable();
dsb();
isb();

  • Reply
  • Cancel
  • Cancel
Parents
  • Former Member
    0 Former Member over 7 years ago

    In the IEEE 1588 PTP example, which is what I am building my project on op of, when I go to xemacps_ieee1588.h and change XEMACPS_IEEE1588_BD_ALIGNMENT from 4 to 32, I end up with an error, the output of it reading "Direction 2, ErrorWord 0". Where do I go to find out what this error maens?
    I I try to disable the entire cache (using Xil_DCacheDisable()), my linked lists stop working.

    What does Dicrection, ErrorWord 0 2 mean? How can I look it up to find out more about it?

    • Cancel
    • Up 0 Down
    • Reply
    • Verify Answer
    • Cancel
  • hemilshah0211
    0 hemilshah0211 over 1 year ago in reply to Former Member

    Hi josevi, I am trying to implement the same IEEE 1588 example in my project but facing some issues, need your help.
    Could you please tell me in what manner are the boards connected. It looks like one of my boards is not entering into the slave mode.



    • Cancel
    • Up 0 Down
    • Reply
    • Verify Answer
    • Cancel
Reply
  • hemilshah0211
    0 hemilshah0211 over 1 year ago in reply to Former Member

    Hi josevi, I am trying to implement the same IEEE 1588 example in my project but facing some issues, need your help.
    Could you please tell me in what manner are the boards connected. It looks like one of my boards is not entering into the slave mode.



    • Cancel
    • Up 0 Down
    • Reply
    • Verify Answer
    • Cancel
Children
No Data
Element14

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 © 2022 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

  • Facebook
  • Twitter
  • linkedin
  • YouTube