I've been searching for any pointers to enable read / write access of HPS ram from the FPGA but cannot find any example code.
The rocket board link fails (even when I have logged into the rocket board site), could you confirm the link or (big ask) share your project?
--- Quote Start ---
Hi kstolp,
I have got a working block in the FPGA that masters transfers from HPS RAM to FPGA RAM. I experienced a similar issue along the way (many times!), the HPS seems to 'hang' so the terminal freezes up and if you are debugging you lose the connection. This happens from my experience for one of two reasons, the HPS is attempting to address a slave bus that is not yet configured (e.g. if the fpga has not been programmed or there is a problem with your FPGA design).
The second reason is if you attempt to access an area of HPS RAM that you're not supposed to (I'm guessing the OS is doing something critical with the data stored in these locations?). I don't know why but accesses to some areas caused my design to crash.
I used the example module
http://www.rocketboards.org/foswiki/.../myfirstmodule. This allocates a buffer in HPS RAM and, importantly, you can read the physical address of the buffer. This allows the FPGA to access data that your application copies into this buffer. This is safer since you know that this area in the HPS RAM will only have your data in. In my design I had to divide the physical address by 4 (to make 32-bit aligned) and add an offset of 0x2000 0000 (I don't know why!) to get the physical address of my HPS buffer from the FPGA viewpoint. I found this out mainly by trial and error.
It should be possible to do allocate the buffer using kmalloc() in your code and then get the physical address using virt_to_phys() but I have not been able to get this working due to issues with the compiler, but this is done for you if you use the module anyway.
--- Quote End ---