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 linux.fpga
Visitor
1,233 Views
Registered: ‎11-01-2018

QSPI - u-boot command

Hi Everyone,

I want to access the QSPI flash partition to check if file.txt file is on it. I want to work in u-boot. For tftp, I have command tftpboot 0x1000000 file.txt. Is there something similar for QSPI flash?

Thanks.

0 Kudos
4 Replies
Moderator
Moderator
1,203 Views
Registered: ‎04-24-2017

Re: QSPI - u-boot command

Hi @linux.fpga,

 

Here is some example.

 

ZynqMP> sf probe 0 0 0
SF: Detected n25q512a with page size 512 Bytes, erase size 128 KiB, total 128 MiB
ZynqMP> tftpboot 0x10000000 file.txt
ZynqMP> sf erase <QSPI-partition-address> <QSPI-partition-size>
ZynqMP> sf write 0x10000000 <QSPI-partition-address> ${filesize}
Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
Visitor linux.fpga
Visitor
1,162 Views
Registered: ‎11-01-2018

Re: QSPI - u-boot command

Thanks Sandeep,

 

But I don't want to download file from tftpboot. I only want to check if the file file.txt exists on QSPI flash partition.


In petalinux the file file.txt is saved by the following example:

 

I ran mtdinfo and I checked that all partitions exist.


I created a folder /opt/temp and I mounted mtd4 on /opt/temp.

 

root@plnx_arm:~# mount -t jffs2 /dev/mtdblock4 /opt/temp/

 

In /opt/temp I created the file file.txt and I checked with command ls /opt/temp that file.txt exists.

 

I umounted /opt/temp.

 

I mounted mtd4 again and I checked the file.txt exists in /opt/temp.


After that I umounted /opt/temp and I rebooted ststem.


I stopped in u-boot and now I want to check if the file file.txt exists on QSPI flash partition.

 

Regards.

0 Kudos
Explorer
Explorer
1,108 Views
Registered: ‎06-03-2015

Re: QSPI - u-boot command

Hi 

 

from u-boot prompt: " cmp " is command to check from SPI offset for your existing Image to see the data after you write into one location.

 

ex.

sf write 0x90000000  0x200000 <file size>

Copying file from DDR address 0x90000000 to SPI flash offset address 0x200000 of size file size in Hex.

 

cmp 0x200000 with file size

It prints same as what you have copied in banary format

 

check sf help on u-boot prompt

 

Thanks & Regards

Satish G

 

G Satish Kumar
0 Kudos
Highlighted
Visitor linux.fpga
Visitor
1,062 Views
Registered: ‎11-01-2018

Re: QSPI - u-boot command

Thank you, everyone.

 

In the end, I decided to use fw_printenv and fw_setenv commands.
I added below line in <plnx-proj-root>/project-spec/meta-user/conf/petalinuxbsp.conf (see link https://forums.xilinx.com/t5/Embedded-Linux/How-to-include-U-Boot-s-quot-fw-printenv-quot-tool-in-Petalinux/td-p/770629).

IMAGE_INSTALL_append += " \
u-boot-fw-utils \
"
Instead of creating file I created environment variable in linux and than I checked in u-boot if environment variable exists.

 

Regards.

0 Kudos