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

Disabling PFU / instruction pre-fetch on Cortex-R4?

Hello,

I'm trying to find the proper way to disable PFU / instruction pre-fetch on an R4. System control register bit 12 might do the job, but it's not clear to me:

Determines if instructions can be cached at any available cache level:
0 = instruction caching disabled at all levels. This is the reset value.
1 = instruction caching enabled.

Does "instruction caching disabled at all levels" mean that PFU is disabled? I would guess not, because the TRM says "The PFU obtains instructions from the instruction cache, the TCMs, or from external memory".

If SCR bit 12 doesn't disable PFU, what's the proper way to completely disable instruction pre-fetch?

Thanks!

Parents
  • I'd suggest using the MPU.  Before starting the test, mark the flash as execute (or no access, if the test doesn't involve direct access by the processor).  Then after the test is complete, re-enable execution/access.  The processor won't prefetch instructions from a region without execution permissions.

Reply
  • I'd suggest using the MPU.  Before starting the test, mark the flash as execute (or no access, if the test doesn't involve direct access by the processor).  Then after the test is complete, re-enable execution/access.  The processor won't prefetch instructions from a region without execution permissions.

Children
No data