Forums » Software Development »
Reading memory into a file
Added by Anonymous over 10 years ago
Hi,
Do you have any examples on reading memory in software?
We need to grab the data we have in memory into a file and export it via Ethernet.
Thanks!
Jack
Replies (9)
RE: Reading memory into a file - Added by Bob Duke over 10 years ago
Jack,
We don't have any general examples to provide.
If you're trying to share data over FTP or ssh in a human-readable format, you can use fprintf to print the data from memory into a file.
http://www.cplusplus.com/reference/cstdio/fprintf/
-Bob
RE: Reading memory into a file - Added by Anonymous over 10 years ago
Hi,
I managed to read memory into a file but we got another problem.
We are following your example - write to hps memory. In that example a command has to be issued in order to write to memory via the FPGA
memtool -32 0xffc25080=0x110
This command resets the FPGA SDRAM port out of reset
And then after this command we run the code that sends the dispatcher.
Our problem is that we want to use our own software that reads the memory. But our code does not work once the dispatcher is sent, the data we are reading are all zeroes, but when we run memtool we are getting the correct data.
To further complicate the issue, if we do not send the command that resets memory and the dispatcher program, and just use our custom software to grab the data we get the correct values exactly as we see in memtool.
Any suggestions? I attached my code
Jack
memaccess.rar (6.38 KB) memaccess.rar |
RE: Reading memory into a file - Added by Gregory Gluszek over 10 years ago
Hi Jack,
Do you run into any problems if you use your software without first sending the command to enable the SDRAM? We'll try to get you an explanation for what you're seeing and in the mean time try using your software without running 'memtool -32 0xffc25080=0x110' first. Keep us updated if that results in any issues.
Thanks,
\Greg
RE: Reading memory into a file - Added by Anonymous over 10 years ago
Hi Greg,
I have no problem with the software wihtout first sending the command to enable the SDRAM. The data that I get from memtool matches the data that I get from my software.
Thanks!
Jack
RE: Reading memory into a file - Added by Gregory Gluszek over 10 years ago
Hi Jack,
It may take us some time to get to the bottom of this. We'll post in this thread as soon as we have additional information.
Please keep us informed if you run into any issues with the current work around of not running 'memtool -32 0xffc25080=0x110'.
Thanks,
\Greg
RE: Reading memory into a file - Added by Anonymous over 10 years ago
Hi,
Is there a way for memtool to output the memory into a file?
Thanks,
Jack
RE: Reading memory into a file - Added by Anonymous over 10 years ago
Hi Greg,
Any update on this?
Did you guys manage to resolve the issue?
Thanks,
Jack
RE: Reading memory into a file - Added by Anonymous over 10 years ago
Actually don't worry about it.
We managed to solve it.
Thanks,
Jack