cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
keshava7887
Observer
Observer
374 Views
Registered: ‎06-19-2020

Uboot flash sf read error MX66U2G45G

Jump to solution

Hi I am using Macronix MX66U2G45G in my custom design with zynq mpsoc petalinux 2020.1.

I am able to boot board with jtag mode and create  four partition and copy respective  files in partition using flashcp command. I have applied required patches for petalinux to detect the flash device.

[ 3.387977] 0x000000000000-0x000000ec0000 : "boot"
[ 3.393550] 0x000000ec0000-0x000000f00000 : "bootenv"
[ 3.399181] 0x000000f00000-0x000000f40000 : "bootscr"
[ 3.404833] 0x000000f40000-0x000005540000 : "kernel"

When, I boot the device in QSPI mode I could see board stops at uboot command prompt with error  Wrong image format for "source" command. Further analysis on the issue I could see that fit image image.ub written on to flash read back incorrectly. I have tried to flash binaries using uboot command by copying image.ub to ram address 0x10000000 and writing it to flash by uboot command sf write 0x10000000 0xf40000 0xe4b6bc. When I compare sf read 0x20000000 0xf40000 0xe4b6bc with md command they are different. I tried writing flash with vitis flash programmer and linux flashcp command results were same.

Results with SF write 

Before writing in to flash

ZynqMP> md 0x10000000
10000000: edfe0dd0 18b8e400 38000000 48b4e400 ...........8...H
10000010: 28000000 11000000 10000000 00000000 ...(............
10000020: 74000000 10b4e400 00000000 00000000 ...t............
10000030: 00000000 00000000 01000000 00000000 ................
10000040: 03000000 04000000 64000000 814b735f ...........d_sK.
10000050: 03000000 47000000 00000000 6f422d55 .......G....U-Bo
10000060: 6620746f 6d497469 20656761 20726f66 ot fitImage for
10000070: 61746550 756e694c 2e352f78 69672b34 PetaLinux/5.4+gi
10000080: 54554174 434e494f 6232322b 34623137 tAUTOINC+22b71b4
10000090: 2f323631 716e797a 672d706d 72656e65 162/zynqmp-gener
100000a0: 00006369 03000000 04000000 0c000000 ic..............
100000b0: 01000000 01000000 67616d69 00007365 ........images..
100000c0: 01000000 6e72656b 31406c65 00000000 ....kernel@1....
100000d0: 03000000 0d000000 00000000 756e694c ............Linu
100000e0: 656b2078 6c656e72 00000000 03000000 x kernel........
100000f0: 85f25e00 1b000000 08088b1f 5f734b81 .^...........Ks_
ZynqMP> sf write 0x10000000 0xf40000 0xe4b818
device 0 offset 0xf40000, size 0xe4b818
SF: 14989336 bytes @ 0xf40000 Written: OK
ZynqMP> sf read 0x10000000 0xf40000 0xe4b818
device 0 offset 0xf40000, size 0xe4b818
SF: 14989336 bytes @ 0xf40000 Read: OK
ZynqMP> md 0x10000000
10000000: 2802280e 00000002 00002802 00000000 .(.(.....(......
10000010: 74020001 27000101 febaa2eb bebb2e2a ...t...'....*...
10000020: eeff4580 bbabeebf 000001b0 b0ab0000 .E..............
10000030: 00a2ef00 2e000001 0100faae 1d50011c ..............P.
10000040: a6eceb5a 5660ff03 362490d0 63a2c233 Z.....`V..$63..c
10000050: 67fc5c95 fde00843 010f9f20 0d66bf67 .\.gC... ...g.f.
10000060: 6af36db3 f5b23f53 53c6427e 59ab1dac .m.jS?..~B.S...Y
10000070: 7c6d5b8e 3b8eadef 1570df7c fa4fb109 .[m|...;|.p...O.
10000080: eb5bd7e3 f0905f8f e3a89733 3ddb66b5 ..[.._..3....f.=
10000090: 9d47c671 cf635563 21416ff1 675575a7 q.G.cUc..oA!.uUg
100000a0: e8c714b5 56d591dc 2e5b3cda c852c7ee .......V.<[...R.
100000b0: 306b7d86 731e605d e71896b7 579733f5 .}k0]`.s.....3.W
100000c0: 26c87302 a643909c 01ab9f1b f41df873 .s.&..C.....s...
100000d0: 732291da c7c4baff 71042459 7cd03236 .."s....Y$.q62.|
100000e0: a7669479 94a81dea da4659a4 84f96cd0 y.f......YF..l..
100000f0: c4c4f426 fc158298 b4c256d0 1cb85beb &........V...[..
ZynqMP>

 

with SF update command 

Before writing 

ZynqMP> md 0x10000000
10000000: edfe0dd0 18b8e400 38000000 48b4e400 ...........8...H
10000010: 28000000 11000000 10000000 00000000 ...(............
10000020: 74000000 10b4e400 00000000 00000000 ...t............
10000030: 00000000 00000000 01000000 00000000 ................
10000040: 03000000 04000000 64000000 814b735f ...........d_sK.
10000050: 03000000 47000000 00000000 6f422d55 .......G....U-Bo
10000060: 6620746f 6d497469 20656761 20726f66 ot fitImage for
10000070: 61746550 756e694c 2e352f78 69672b34 PetaLinux/5.4+gi
10000080: 54554174 434e494f 6232322b 34623137 tAUTOINC+22b71b4
10000090: 2f323631 716e797a 672d706d 72656e65 162/zynqmp-gener
100000a0: 00006369 03000000 04000000 0c000000 ic..............
100000b0: 01000000 01000000 67616d69 00007365 ........images..
100000c0: 01000000 6e72656b 31406c65 00000000 ....kernel@1....
100000d0: 03000000 0d000000 00000000 756e694c ............Linu
100000e0: 656b2078 6c656e72 00000000 03000000 x kernel........
100000f0: 85f25e00 1b000000 08088b1f 5f734b81 .^...........Ks_

ZynqMP> sf update 0x10000000 0xf40000 0xe4b818
device 0 offset 0xf40000, size 0xe4b818
14989336 bytes written, 0 bytes skipped in 72.142s, speed 214133 B/s
ZynqMP> sf read 0x10000000 0xf40000 0xe4b818
device 0 offset 0xf40000, size 0xe4b818
SF: 14989336 bytes @ 0xf40000 Read: OK
ZynqMP> md 0x10000000
10000000: 2802280e 00000002 00002802 00000000 .(.(.....(......
10000010: 74020001 27000101 febaa2eb bebb2e2a ...t...'....*...
10000020: eeff4580 bbabeebf 000001b0 b0ab0000 .E..............
10000030: 00a2ef00 2e000001 0100faae 1d50011c ..............P.
10000040: a6eceb5a 5660ff03 362490d0 63a2c233 Z.....`V..$63..c
10000050: 67fc5c95 fde00843 010f9f20 0d66bf67 .\.gC... ...g.f.
10000060: 6af36db3 f5b23f53 53c6427e 59ab1dac .m.jS?..~B.S...Y
10000070: 7c6d5b8e 3b8eadef 1570df7c fa4fb109 .[m|...;|.p...O.
10000080: eb5bd7e3 f0905f8f e3a89733 3ddb66b5 ..[.._..3....f.=
10000090: 9d47c671 cf635563 21416ff1 675575a7 q.G.cUc..oA!.uUg
100000a0: e8c714b5 56d591dc 2e5b3cda c852c7ee .......V.<[...R.
100000b0: 306b7d86 731e605d e71896b7 579733f5 .}k0]`.s.....3.W
100000c0: 26c87302 a643909c 01ab9f1b f41df873 .s.&..C.....s...
100000d0: 732291da c7c4baff 71042459 7cd03236 .."s....Y$.q62.|
100000e0: a7669479 94a81dea da4659a4 84f96cd0 y.f......YF..l..
100000f0: c4c4f426 fc158298 b4c256d0 1cb85beb &........V...[..

Please help me in resolving the issue.   

 

Thanks 

Keshava murthy p

Screenshot from 2020-09-30 16-26-13.png
Screenshot from 2020-09-30 16-13-57.png
Screenshot from 2020-09-30 16-26-19.png
0 Kudos
Reply
1 Solution

Accepted Solutions
ibaie
Xilinx Employee
Xilinx Employee
317 Views
Registered: ‎10-06-2016

Hi @keshava7887 

It would be expected that after sf write/read operation to have the issue if you don't take care of erasing the flash section previously, but with sf update that should be handled for you.

Did you try to slow down the QSPI interface with sf probe? I'm just wondering if you have some kind of signal integrity issue at max clock.

Regards


Ibai
Don’t forget to reply, kudo, and accept as solution.

View solution in original post

0 Kudos
Reply
3 Replies
ibaie
Xilinx Employee
Xilinx Employee
318 Views
Registered: ‎10-06-2016

Hi @keshava7887 

It would be expected that after sf write/read operation to have the issue if you don't take care of erasing the flash section previously, but with sf update that should be handled for you.

Did you try to slow down the QSPI interface with sf probe? I'm just wondering if you have some kind of signal integrity issue at max clock.

Regards


Ibai
Don’t forget to reply, kudo, and accept as solution.

View solution in original post

0 Kudos
Reply
keshava7887
Observer
Observer
282 Views
Registered: ‎06-19-2020
I have reduced QSPI flash read write speed using uboot command
sf probe 108000000
to resolve the issue.
Thanks
ibaie
0 Kudos
Reply
keshava7887
Observer
Observer
219 Views
Registered: ‎06-19-2020

How do I change default qspi clock frequency in uboot( sf probe 0 0 0; to sf probe 108000000), so that it will automatically read at low speed during boot sequence without failing.

 

  

0 Kudos
Reply