cancel
Showing results for 
Search instead for 
Did you mean: 
Explorer
Explorer
136 Views
Registered: ‎10-09-2017

How to really write into DDR in petalinux and not cache

I write into ddr or ram ,then I read in PL. As cache, I sometimes get the old value. Somebody help me in sdk.

But I don't know how to do it in petalinux.

In SDK, the solution is in 

https://forums.xilinx.com/t5/Memory-Interfaces-and-NoC/Why-does-my-pl-read-ddr-and-get-old-one-not-new-one/m-p/1087092#M16679

It only Xil_DCacheDisable();

He also told me a link ablout petalinux as 

https://forums.xilinx.com/t5/Embedded-Linux/how-disable-cache-in-Linux/m-p/741237#M17996

I can't know how to do,although  it has a solution.

In fact, I don't want to disable the cache. I only need ensure that the data is really written into ram.

Any idea? 

0 Kudos
1 Reply
Highlighted
Explorer
Explorer
51 Views
Registered: ‎10-09-2017

Re: How to really write into DDR in petalinux and not cache

I follow the function Xil_DCacheDisable(), In fact, I only need the Xil_DCacheFlush().

What's the function name in petalinux for Xil_DCacheFlush()?  DCacheFlush() ?

After I change ram, follow with Xil_DCacheFlush(), the ram read with PL is right.

I google and find:

http://man7.org/linux/man-pages/man2/cacheflush.2.html

in linux, cacheflush is for it, maybe the answer.

0 Kudos