Forum Discussion
Altera_Forum
Honored Contributor
7 years agoHi,
I'm using the the alt_remap_uncached() function from Nios Gen1 with minor changes: # include "sys/alt_warning.h" # include "sys/alt_cache.h" # include "system.h" volatile void* alt_remap_uncached(void* ptr, alt_u32 len) { # ifdef NIOS2_MMU_PRESENT /* Convert KERNEL region address to IO region address */ # define BYPASS_DCACHE_MASK (0x1 << 29) # else /* Set bit 31 of address to bypass D-cache */ # define BYPASS_DCACHE_MASK (0x1 << 31) # endif const size_t num_lines = (len + ALT_CPU_DCACHE_LINE_SIZE - 1) / ALT_CPU_DCACHE_LINE_SIZE; const size_t aligned_size = num_lines * ALT_CPU_DCACHE_LINE_SIZE; alt_dcache_flush (ptr, aligned_size); return (void*) (((alt_u32) ptr) | BYPASS_DCACHE_MASK); } In my case it works. May be it helps you Jens