Sorry, you need to enable JavaScript to visit this website.

File io program - Zed board

Unsolved
2 posts / 0 new
viswapraveen's picture
viswapraveen
Junior(0)
File io program - Zed board

I have a problem in creating FILE pointer like FILE *fp; and then i opend a file like fp = fopen("c:/user/xilinx/project1/hello.txt","w");
and I didn't get any address in file pointer while debugging and i didn't get any dump file hello.text in my project1,, help me

JFoster's picture
JFoster
Moderator(48)
Hello Viswapraveen

Hello Viswapraveen

Assuming that you are attempting to program a Zynq device on something like a Zedboard, you need to first understand the embedded system you are working with. Programming on the Zynq is not the same as writing a C program to run under Windows on your PC. The statement you have listed above assumes that there is a "C:" hard drive available to the system (C: is on your host PC, not on the ZedBoard), and that you have a file system implemented on the "C" drive, and that you have an operating system, like Windows, that  supports the 'fopen' operation.

 

On a ZedBoard there is only the RAM memory internal to the Zynq device, the DDR3 DRAM, the SD Card (if installed) and the QSPI Flash device, no 'C' hard drive. Then, to perform a file operation on one of these available memory resources, you would need to implement an Operating System (such as Linux, PetaLinux, FreeRTOS, etc.) or at least one of the file system libraries (xilmfs).

 

I suggest that you study to familiarize yourself with the Zynq system by using the resources referred to the answer in this posts: http://www.zedboard.org/content/helloworldelf-storage-location-zedboard

 

Then perhaps move on to the PetaLinux Speedway material available at the same page pointed to for the Zynq Software and Hardware Speedway material or some other resources for embedded systems.

 

--Josh