05-13-2014 06:20 AM
I am working on Zedboard as part of my masters thesis. I need to write the memory data to a text file or .csv. But I dont understand what the file handling header file to be used in SDK.
One more clarrification - is there any dedicated memory location in DDR3 (Zedboard zync 7000) for OS? if so please tell me from which memory location we can use for general purpose?
Thanks & Regards,
05-13-2014 09:49 PM
You won't be able to open a file on a host PC without using a file system. You can however, use the UART and using the API ( these can be found in the install dir for XPS/SDK in the driver folder) you can use the Tera term to input a text file. You can also dump the contents of the serial output into a text file
On the other note, ZED board has a 512 mb space. You can also refer to the following threads., there is a video reference design that I think can help you with DDR3/VDMA on the Reference Designs/Tutorials page located here:
"FMC-IMAGEON IP Cores and Tutorials for Vivado"
05-13-2014 11:02 PM
If you just want a memory dump, please follow the steps below:
1. Open your SDK workspace
2. Xilinx Tools > Program FPGA (If you have a bitstream)
3. Right Click on the ELF (application) > Launch on Hardware ..
Make sure the application executes by checking the output on a serial terminal. Also, check the Linker Script to see where you are executing the application (OCM or DDR etc.. )
4. Next, Xilinx Tools > Launch Shell
type the command ""hw_server" (without quotes) to launch the hardware server
5. Xilinx Tools > Dump/Restore Data File (only available from SDK 14.6 and higher)
6. Select Processor..Should be something like Local > APU > ARM Cortex-A9 MPCore #0 (or 1) depending on which cpu is executing the application.
7. Connection Field should be "Local" (if your system is directly connected to board)
8. File Location --> Browse to a location and give .bin as file extension... for example, C:/test/dump.bin
9. Choose Dump Memory
10. Start Address --> Give the start address of the memory where the application is executing. For example, if the application executes from DDR (with base address 0x00100000) then enter 0x00100000
11. Give the size in bytes for example 64 and click OK
12. You can now open the .bin file with your favorite text editor (TextPad :)) and check the memory contents:
05-19-2014 05:17 AM
Thanks for your reply.
you were mentioning that, ' You can also dump the contents of the serial output into a text file'. Actually, this is what I want to know how I can dumb the data to a text file. I couldnt create a text file and was not able to write any data to it.
bellow is the code I have used to create a text file. But it always gives a NULL value to the pointer. How can I solve this issue.
test_file = fopen ("test.txt", "w");
if ( test_file == NULL )
printf ( "Cannot open file" ) ;
Thanks & Regards,
05-19-2014 07:39 AM
You can also use the xmd commands to achieve this.
XMD% set fp [open test.log w]
XMD% puts $fp [mrd 0 10]
XMD% close $fp
You can write this in a tcl as well. This example will redirect the output of mrd 0 10 to test.log.
09-04-2014 11:03 PM
When I following the instructions given by you, I get an error after performing step 5.
The Dump/Restore Data File window shows an error as 'Invalid Processor/Context'. Please tell me what I am doing wrong. I am trying to get data from a Zync 706 board.
11-03-2014 01:42 AM
please help me
i have got the same problem, i am not able open the file in sdk like
fp = fopen("test.txt", "w");
if(fp == NULL)
print("not able to create momory for fp");
so please help me out......