Created
October 21, 2020 12:38
-
-
Save thibthibaut/f6f04d840f73b18957b9e4b6ed49475f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 32-byte alignment buffer for cache coherency operations. BUFF_SIZE is a 32-bytes multiple. */ | |
uint8_t pBuff[BUFF_SIZE] __attribute__ ((aligned (32))); | |
/* Write data to main memory with DMA */ | |
fancy_dma_operation(pBuff); | |
/* Make subsequent CPU reads coherent with DMA writes to main memory */ | |
SCB_InvalidateDCache_by_Addr((uint32_t *)pBuff, BUFF_SIZE); | |
/* Read/write data with CPU to a cached memory region */ | |
fancy_cpu_operation(pBuff); | |
/* Make subsequent DMA reads coherent with DMA reads to main memory */ | |
SCB_CleanDCache_by_Addr((uint32_t *)pBuff, BUFF_SIZE); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment