Skip to main content
Chris Rice
Associate III
May 1, 2018
Question

Getting started question -- do I have to enable the STM32F7 cache?

  • May 1, 2018
  • 6 replies
  • 2351 views
Posted on May 01, 2018 at 17:58

Hello, I'm moving from 8-bit programming to an STM32f769, and it's a bit overwhelming.  I've been combing through source code and the datasheets, trying to decide where to use the supplied code and where to write my own.  I feel like writing my own is generally better because I will be closer to the hardware and understand more.  But it's pretty deep/complex with this kind of CPU.

My question is, the first command in the sample applications provided start with CPU_CACHE_Enable, which call SCB_EnableICache and SCB_EnableDCache, which manipulate the SCB-->ICIALLU, SCB-->CCR, and other registers.

Please forgive my naivete, but I'm coming from CPUs that don't even allow you to manipulate the cache... what if I don't do this (enable the cache)?  Is this an optimization, or something that is necessary to do?  If necessary, why is it even in code, why isn't it the reset behavior?

Thank you.  I'm unable to find a description at the right level for me, so any answers will be very helpful and get me pointed in the right direction (beyond the specific answer, I'm sure).

Thanks.

#stm32f7 #cache
This topic has been closed for replies.

6 replies

Tesla DeLorean
Guru
May 1, 2018
Posted on May 01, 2018 at 19:05

Without the cache you expose the inherent slowness of the memories. You don't need to enable caches.

Review the ARM TRM (Technical Reference Manual) and Joseph Yiu's books on the Cortex-Mx series to get up to speed.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Chris Rice
Associate III
May 1, 2018
Posted on May 01, 2018 at 19:12

Thank you very much.