Save file from pynq Z1 to SD card

Is it possible to save file to the SD card for booting? I found that there are seldom example for that,
I need this function for my project.
Thank you!

Hi,

Can you elaborate?

You can write to /boot/ this is the partition that is used for boot.

Mario

I suppose you want to start your program at boot time. if that is the case, there is a detailed tutorial by peter you can find here.

1 Like

In that case,

You can use the boot.py file

Mario

1 Like

To be more clear, I am doing a project on sensor, I need to save the I/O value as CSV or excel. T
hank you in advance.

What are you trying to do? If you just need to get your sensor data off the board, you have lots of ways to do this that would be easier (in my opinion!) than writing to the boot SD card.
Remember that PYNQ is running on a Linux OS.
You could connect another USB drive to one of the USB ports and save data to this device. You wouldn’t need to shutdown the board to transfer the data - just disconnect the secound USB drive.
If your board is connected to your network, you could access the file directly from the other computer or device via Samba, or download from Jupyter notebook.
You could also upload your file directly to the internet (dropbox etc.), host a webserver on your board or transfer the data over the network in many other ways …

Cathal

1 Like

Basically a potentiostat, I am thinking USB is better too, but my boss ask for this, I never program the USB data transfer before though. Network is good, will try in the future. Thank you.

1 Like

Hai guys, I too have the same issue , here i have used some analog input which was converted into digital samples by using xadc of pynqz1 and now i want to save these samples into a csv file and load it into sd card. then i would like to use this data from sd card for further activities. so can anyone please help me out doing this?

you can save a numpy array directly using numpy function and it can be loaded quickly afterward.

# To save data:
numbers = numpy.asarray([ [1,2,3], [4,5,6], [7,8,9] ])
numpy.savetxt("filename.csv", numbers , delimiter=",")

# To load data:
load_numbers= numpy.loadtxt("filename.csv", delimiter=",")

OK But actually i am taking the data from xadc using vivado, it didnt work for me using python. because all the examples listed on github were using groove,but i want the sensor to be directly interfaced with Pynq Z1. can you please suggest me something now?

Enclosing the previous log from mine these modulator only answer question without show the entire picture mostly (nothing personal here).

Maybe I elaborate a bit more:
PYNQ overlay is a high-level idea under python control.
If you design to have sensor or control below 100ms after powerup than my log post is what you want as it can bypass any unnecessary delay and just run things on FPGA alone.
But if Linux control is what you expecting than this is what the boot.py you want as now brown-out power on consideration aren’t the case here.
There are many application for example Over-the-air firmware updates or other same concept.
Cloud FPGA like AWS services.

See the detail can correct me if this is not your case.