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 wave85
Visitor
946 Views
Registered: ‎05-25-2018

Read from file in SDK 2017.1

Hi, i need to read data from a file in a bare metal application. Since the file contains too much data, it crashes. Is there a way to do it?

0 Kudos
7 Replies
Moderator
Moderator
906 Views
Registered: ‎09-12-2007

Re: Read from file in SDK 2017.1

Are you using a file system (for example xilmfs)
https://github.com/Xilinx/embeddedsw/blob/master/lib/sw_services/xilmfs/src/xilmfs.h

You can enable this in the bsp, and config t his as needed. See ug1026 as this uses the mfs for the webserver.
0 Kudos
Visitor wave85
Visitor
889 Views
Registered: ‎05-25-2018

Re: Read from file in SDK 2017.1

Thank you im gonna take a look into it !! I must load a lot of weights for a convolutional net and when the layers are too big it crashes. Previously i've been using linux and it ran perfectly probably because there is a file system. Now i moved the application on bare metal and i've been having some issues. I'll let you know how it works. 

0 Kudos
Visitor wave85
Visitor
880 Views
Registered: ‎05-25-2018

Re: Read from file in SDK 2017.1

Hi, i was taking a look to xilmfs. It seems i can create my own file system in DDR, create , open , write and read files in it. But can i copy files from my computer's file system to the new file system? I have some files containing "weights" which i need to transfer in DDR. 

0 Kudos
Moderator
Moderator
855 Views
Registered: ‎09-12-2007

Re: Read from file in SDK 2017.1

Yes, linux would be much easier here as there are utilities you could easily use. With BM you can use the available libraries such as the one I mentioned. Or create your own app using the available interfaces in your system.

With the mfs you would need to create the mfs file ( see xapp1026 for help here) that contains your files. Then use the xil_mfs api to read the file.

If you wanted to read directly from pc, you could use the use, uart or Ethernet for example and use the driver API. However, you would need to create the application here. I'm not aware of any applications here.
0 Kudos
Visitor wave85
Visitor
849 Views
Registered: ‎05-25-2018

Re: Read from file in SDK 2017.1

Thanks a lot , i will try creating the mfs file which contains my files and then use mfs apis to read it. Unfortunately i avoided using linux because in my application im using the DMAC PL330 and it gives me several problems on linux, while it perfectly works on bare metal. I will let you know in a few days , thank you. 

0 Kudos
Scholar ericv
Scholar
838 Views
Registered: ‎04-13-2015

Re: Read from file in SDK 2017.1

@wave85

 

There is a way in SDK to load a file from your computer and put its contents in the device memory.

Under the "Xilinx" upper tab, select "Dump/Restore Data File"

Then fill the info in the pop-up window.

 

 

0 Kudos
Visitor wave85
Visitor
823 Views
Registered: ‎05-25-2018

Re: Read from file in SDK 2017.1

Thank you Ericv , i will test both methods tomorrow when i get back to the office. 

Update: i tested the dump/restore memory feature and it does not work for my purpose. I am writing a file in a memory location but when i read from it , i always read the same number value despite from the file i load into it.

0 Kudos