DMA controller and data cache problems

Jiri Gaisler jiri at
Thu Jun 2 16:34:27 UTC 2005

Solution 1:

Enable leon2 cache snooping to keep caches synchronized with
main memory. You need to synthesize leon2 with cache snooping
enabled, and then set the snoop enable bit in the cache
control register.

Solution 2:

Use asm("flush") to flush the cache after DMA. Affects
performance since the whole cache is flushed.


Carl-Johan Hansson wrote:
> I'm using LEON2 with an IO device that uses DMA to write data to the 
> sram memory. The problem I have is that when I read the data from memory 
> everything is fine the first time I access it, but when I read the same 
> address a second time I only receive the old value stored in cache. I 
> tried rtems_cache_flush_entire_data() and 
> rtems_cache_invalidate_entire_data() but I still have the same problem, 
> anyone know a solution? I made a test with the data cache disabled and 
> everything looked good so I know that the hardware and my software work.
> _________________________________________________________________
> Hitta sommarflörten på MSN!
> .

More information about the users mailing list