cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Observer
Observer
5,401 Views
Registered: ‎10-13-2011

Why data from PL in not valid?

Jump to solution

Hi, all,

 

I am debugging my own zynq board. PL part is periodically taking images from camera module and compress them using JPEG encoder. Right now, I am tranferring the jpg file from PL to LPDDR2 which shared with PS through AXI_HP port. But on PS, through mmap() method, I can only get the first image correctly after Linux boots.

 

I did some troubleshooting:

1. using test data generated from inner counters to replace the source image data, so, after compression all the jpg data are the same, then I can got all correct jpg file from mmap().

2. I modified the script in linux, so that it will reboot once it saved a jpg file after booting, then I can get correct jpg data everytime. 

I am fully confident about my jpg encoder, also from 1 and 2, it shows it works.

I think the problem is the confilicts between mmap() and PL writing, but I don't know why. I isolated the memory space for PL using bootargs in devicetree so that kernel will not mess up the isolated memory, and from 1, I think it works as expected.

 

Anybody give me some idea?

Thanks.

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Scholar
Scholar
9,152 Views
Registered: ‎10-26-2012

Probably cache coherency.

 

You'll have to mark the memory as non-cacheble, or allocate it in coherent mode. You cannot do this via user-space programs using mmap. You probably need to write a real driver now to handle this properly.

View solution in original post

0 Kudos
2 Replies
Highlighted
Scholar
Scholar
9,153 Views
Registered: ‎10-26-2012

Probably cache coherency.

 

You'll have to mark the memory as non-cacheble, or allocate it in coherent mode. You cannot do this via user-space programs using mmap. You probably need to write a real driver now to handle this properly.

View solution in original post

0 Kudos
Highlighted
Observer
Observer
5,371 Views
Registered: ‎10-13-2011
Thanks for replying.
I tried flush function, it works for one time saving, but some jpg files still get messed up when they are taken continuously. I was trying to save effort, maybe I should switch to design a real driver for it.
Thanks.
0 Kudos