This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Clean Whole Cache on Cortex-A9

I am doing some benchmarking and I need to clear the cache before each test. I have this example here:

Caches and Self-Modifying Code

However, I just want to clean the whole cache. Is there an easy way to do that? I do not need to know the start and end address of the functions.  I just want some simple code

Thanks.

Parents
  • The ARMv7-A/R Architecture gives an example sequence for cleaning the entire data and unified cache, using set/way operations.  It's right at the end of chapter B2.2.7 (Cache and branch predictor maintenance operations), under a sub-heading of "Performing cache maintenance operations".  My recommendation would to use that code.

    If you have DS-5 installed, the "startup_Cortex-A9" example in the Bare-metal_examples.zip includes a version of this code.  The difference is the code in the example is doing an invalidate rather than a clean operation.  But that is easy enough to change.

Reply
  • The ARMv7-A/R Architecture gives an example sequence for cleaning the entire data and unified cache, using set/way operations.  It's right at the end of chapter B2.2.7 (Cache and branch predictor maintenance operations), under a sub-heading of "Performing cache maintenance operations".  My recommendation would to use that code.

    If you have DS-5 installed, the "startup_Cortex-A9" example in the Bare-metal_examples.zip includes a version of this code.  The difference is the code in the example is doing an invalidate rather than a clean operation.  But that is easy enough to change.

Children