2 \defgroup cache_functions_m7 Cache Functions (Level-1)
3 \brief Functions for level-1 instruction and data cache.
5 Enhanced Cortex processors (like M7 and M55) include a memory system, which includes an optional
6 Harvard level-1 data and instruction cache with ECC. The optional CPU cache has an instruction
7 and data cache with sizes of \token{[0;4;8;16;32;64]KB}.
8 Both instruction and data cache RAM can be configured at implementation time to have Error
9 Correcting Code (ECC) to protect the data stored in the memory from errors.
11 All cache maintenance operations are executed by writing to registers in the memory mapped
12 System Control Space (SCS) region of the internal PPB memory space.
15 After reset, you must invalidate each cache before enabling it.
17 The functions are grouped for:
18 - \ref Icache_functions_m7
19 - \ref Dcache_functions_m7
25 \defgroup Icache_functions_m7 I-Cache Functions
26 \brief Functions for the level-1 instruction cache.
33 \brief Enable I-Cache.
35 The function turns on the instruction cache.
37 Before enabling the instruction cache, you must invalidate (\ref SCB_InvalidateICache) the entire instruction cache if
38 external memory might have changed since the cache was disabled.
40 After reset, you must invalidate (\ref SCB_InvalidateICache) each cache before enabling it.
42 __STATIC_FORCEINLINE void SCB_EnableICache (void);
46 \brief Disable I-Cache.
48 The function turns off the instruction cache.
51 __STATIC_FORCEINLINE void SCB_DisableICache (void);
55 \brief Invalidate I-Cache.
57 The function invalidates the instruction cache.
58 The instruction cache is never dirty so cache RAM errors are always recoverable by invalidating the cache and retrying the instruction.
60 After reset, you must invalidate each cache before enabling (\ref SCB_EnableICache) it.
63 __STATIC_FORCEINLINE void SCB_InvalidateICache (void);
67 \brief I-Cache Invalidate by address
68 \details Invalidates I-Cache for the given address.
69 I-Cache is invalidated starting from a 32 byte aligned address in 32 byte granularity.
70 I-Cache memory blocks which are part of given address + given size are invalidated.
71 \param[in] addr address
72 \param[in] isize size of memory block (in number of bytes)
74 __STATIC_FORCEINLINE void SCB_InvalidateICache_by_Addr (volatile void *addr, int32_t isize);
77 @} // close ICache functions
81 \defgroup Dcache_functions_m7 D-Cache Functions
82 \brief Functions for the level-1 data cache.
88 \brief Enable D-Cache.
90 The function turns on the entire data cache.
92 Before enabling the data cache, you must invalidate the entire data cache (\ref SCB_InvalidateDCache), because external
93 memory might have changed from when the cache was disabled.
96 After reset, you must invalidate (\ref SCB_InvalidateDCache) each cache before enabling it.
98 __STATIC_FORCEINLINE void SCB_EnableDCache (void);
102 \brief Disable D-Cache.
104 The function turns off the entire data cache.
107 When disabling the data cache, you must clean (\ref SCB_CleanDCache) the entire cache to ensure that any dirty data is
108 flushed to external memory.
111 __STATIC_FORCEINLINE void SCB_DisableDCache (void);
115 \brief Invalidate D-Cache.
117 The function invalidates the entire data cache.
120 After reset, you must invalidate each cache before enabling (\ref SCB_EnableDCache) it.
123 __STATIC_FORCEINLINE void SCB_InvalidateDCache (void);
127 \brief Clean D-Cache.
129 The function cleans the entire data cache.
131 __STATIC_FORCEINLINE void SCB_CleanDCache (void);
135 \brief Clean & Invalidate D-Cache.
137 The function cleans and invalidates the entire data cache.
139 __STATIC_FORCEINLINE void SCB_CleanInvalidateDCache (void);
143 \brief D-Cache Invalidate by address
144 \param[in] addr address (aligned to 32-byte boundary)
145 \param[in] dsize size of memory block (in number of bytes)
147 The function invalidates a memory block of size \em dsize [bytes] starting at address \em address. The address is aligned to 32-byte boundary.
149 __STATIC_FORCEINLINE void SCB_InvalidateDCache_by_Addr (volatile void *addr, int32_t dsize);
153 \brief D-Cache Clean by address
154 \param[in] addr address (aligned to 32-byte boundary)
155 \param[in] dsize size of memory block (in number of bytes)
157 The function cleans a memory block of size \em dsize [bytes] starting at address \em address. The address is aligned to 32-byte boundary.
161 __STATIC_FORCEINLINE void SCB_CleanDCache_by_Addr (volatile void *addr, int32_t dsize);
165 \brief D-Cache Clean and Invalidate by address
166 \param[in] addr address (aligned to 32-byte boundary)
167 \param[in] dsize size of memory block (in number of bytes)
169 The function invalidates and cleans a memory block of size \em dsize [bytes] starting at address \em address. The address is aligned to 32-byte boundary.
171 __STATIC_FORCEINLINE void SCB_CleanInvalidateDCache_by_Addr (volatile void *addr, int32_t dsize);
174 @} // close D-Cache Functions