UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor nithin.p
Visitor
6,494 Views
Registered: ‎03-18-2014

File handling header file used in SDK

Hello,

 

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,

Nithin Ponnrasseri

0 Kudos
7 Replies
Xilinx Employee
Xilinx Employee
6,482 Views
Registered: ‎06-14-2012

Re: File handling header file used in SDK

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:

http://zedboard.org/design/1521/11
"FMC-IMAGEON IP Cores and Tutorials for Vivado"

 

http://forums.xilinx.com/t5/3rd-Party-Other-Boards-and-Kits/How-to-read-and-write-to-DDR3-in-Zedboard/td-p/435206

0 Kudos
Scholar sampatd
Scholar
6,475 Views
Registered: ‎09-05-2011

Re: File handling header file used in SDK

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:

mem_dump.png

 

 

0 Kudos
Visitor nithin.p
Visitor
6,426 Views
Registered: ‎03-18-2014

Re: File handling header file used in SDK

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.

 

FILE *test_file;

        test_file = fopen ("test.txt", "w");
        if ( test_file == NULL )
       {
        printf ( "Cannot open file" ) ;

        }

Thanks & Regards,

Nithin

0 Kudos
Scholar sampatd
Scholar
6,423 Views
Registered: ‎09-05-2011

Re: File handling header file used in SDK

You can also use the xmd commands to achieve this.

 

For example, 

 

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.

0 Kudos
Visitor senthilxi
Visitor
5,878 Views
Registered: ‎09-04-2014

Re: File handling header file used in SDK

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.

0 Kudos
Adventurer
Adventurer
5,552 Views
Registered: ‎11-02-2014

Re: File handling header file used in SDK

please help me 

 

i have got the same problem, i am not able open the file in sdk like

 

file *fp

 

fp = fopen("test.txt", "w");

 

if(fp == NULL)

{

print("not able to create momory for fp");

so please help me out......

0 Kudos
Visitor xuebao1942
Visitor
3,174 Views
Registered: ‎04-14-2016

Re: File handling header file used in SDK

Hello! Why I can't restore the data. There is  "Access Denied" beside the "ARM Cortex-A9 MPCore #0".

捕获.PNG
0 Kudos