cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
8,446 Views
Registered: ‎08-13-2010

how to read text file in edk platform

I am using spartan3e board and edk11.1 platform.

I want to read a text file from my pc. In convention c code it can be done using some basic functions like fopen, fclose etc.

but in system c code these function needs lots of memory space. is there any other alternatives to read a text file from pc

0 Kudos
9 Replies
Highlighted
Advisor
Advisor
8,442 Views
Registered: ‎10-05-2010

Re: how to read text file in edk platform

Can you transmit the text file from the PC to the FPGA using a serial port?

0 Kudos
Highlighted
Explorer
Explorer
8,439 Views
Registered: ‎08-13-2010

Re: how to read text file in edk platform

No, i cant, fopen() taking lots of memory space. Do u have any suggestion about that matter??

0 Kudos
Highlighted
Mentor
Mentor
8,436 Views
Registered: ‎06-09-2011

Re: how to read text file in edk platform

rourabpaul,

 

As far as I know, fopen and fclose and all functions like this are applicable on PC which can have access to the storage!... 

Here you are on a board and want to read a file from PC!... You only can transfer your file to your board and then do what ever you like.

If you have a USB or UART connection you can run a software at PC side waiting for requests from your board - which MB or PPC probably is running - then you try to get the file contents via your media with you own protocol or other available protocols.

This way you will be simulating fopen functions with a procedure you have created.

Further more, if you have a LAN connection on your board you can send your files through FTP to your board which is a quite a bit complicated approach.

 

Have a nice file transfer,

Hossein Moradi Sarvandi

 

Thanks,
Hossein
0 Kudos
Highlighted
Explorer
Explorer
8,431 Views
Registered: ‎08-13-2010

Re: how to read text file in edk platform

@ embedded :

thank u for your reply

I have successfully sent the text file via hyper terminal. There is an option in hyper terminal 'send text file'. I have easily received text data by this option. But is there any other option to send any kind of data file via hyper terminal.

0 Kudos
Highlighted
Mentor
Mentor
8,427 Views
Registered: ‎06-09-2011

Re: how to read text file in edk platform

 

You're welcome. I didn't see any restrictions for file type in hyper terminal transfers, except to the recipent side which should  be able to store and interpert received data. 

 

Have a nice time,

Hossein Moradi Sarvandi


Thanks,
Hossein
0 Kudos
Highlighted
Advisor
Advisor
8,426 Views
Registered: ‎10-05-2010

Re: how to read text file in edk platform

Yes, HyperTerminal supports several binary file transfer protocols, if the text file method is screwing up your binary data.

 

There are a few open source implementations of all of these. Here's something that looks like an incredibly simple MicroBlaze implementation of Xmodem.

 

0 Kudos
Highlighted
Visitor
Visitor
8,423 Views
Registered: ‎10-30-2010

Re: how to read text file in edk platform

If you just want access to the plain text in the file, another option is to parse the file into a character array using a script prior to programming the FPGA, and then store the character array in a header file or the Objective C equivalent in your application.  It can then be accessed using normal array indexing from within your application code.

 

It's also possible to create an object file representation of your text file using mb-objcopy and then linking it in SDK, but that process is a little more difficult.  I've done it successfully with C, but not Objective C.

 

In order to use fopen, fclose, etc, as embedded pointed out, it's necessary to have a file system in place, and there are the memory restrictions.

0 Kudos
Highlighted
Moderator
Moderator
8,405 Views
Registered: ‎09-12-2007

Re: how to read text file in edk platform

0 Kudos
Highlighted
8,023 Views
Registered: ‎12-21-2012

Re: how to read text file in edk platform

hi, i want read the text file using hyperterminal. i am beginner for this i got some videos for EDK, n i dont know how to read a text file and how to create microblaze, so can u help me.

 

plz send me the procedure how to transfer it....here its my mail id- rohankandalkar02@gmail.com.

0 Kudos