Features Supported
- APIs to perform below cache operations
- region based writeback
- region based invalidate
- region based writeback invalidate
- enable and disable APIs for I cache and D cache
- full cache writeback, write invalidte
Features NOT Supported
NA
Important Usage Guidelines
- The region based cache APIs, CacheP_wb, CacheP_wbInv, CacheP_inv, operate on a CPU cache line, hence its strongly recommended to make sure 'addr' is cache line aliged and 'size` is a multiple of cache line size
- Start address is calculated as follows, start_addr = floor(addr, CPU_CACHE_LINE)
- End address is calculated as follows, end_addr = ceil(addr + size, CPU_CACHE_LINE)
- No error is returned, for unaligned addr and size
- On R5F,
- CPU cache lines sizes for reference
- On R5F, It is recommended to enable both program and data cache in R5F in all applications. In R5F for cache to be enabled MPU needs to be enabled.
- On M4F, the CPU does not support cache so these APIs when used with M4F, will be blank and will have no effect
Example Usage
Include the below file to access the APIs,
Example usage for cache write back invalidate,
char buf[1024];
uint32_t
size =
sizeof(buf);
Example usage for cache invalidate,
API
APIs for Cache,