iMX8M-EVK QSPI failed to write 8 bytes to flash

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMX8M-EVK QSPI failed to write 8 bytes to flash

Jump to solution
1,212 Views
mileswang
Contributor II

Dear sir,

I found that iMX8M-EVK QSPI failed to write 8 bytes to flash, it was OK to write 16 bytes to flash.

1. Memory 41000000: 03020100 07060504 0b0a0908 0f0e0d0c ................

2. Write 16 bytes to flash address 0.    

   u-boot=> sf write 41000000 0 10
   The result is OK if read back from flash
3. Write 8 bytes to flash address 0x10. 

    u-boot=> sf write 41000000 10 8

    The vaule alway is 0 if read back from flash.

Please help check the issue. Thanks.

Below is detailed operation steps:

U-Boot SPL 2017.03 (Jan 24 2018 - 01:18:13)
PMIC: PFUZE100 ID=0x10
check ddr4_pmu_train_imem code
check ddr4_pmu_train_imem code pass
check ddr4_pmu_train_dmem code
check ddr4_pmu_train_dmem code pass
PLL bypass to 100MTS setting done
Training PASS
PLL bypass to 400MTS setting done
Training PASS
Training PASS
check ddr4_pmu_train_imem code
check ddr4_pmu_train_imem code pass
check ddr4_pmu_train_dmem code
check ddr4_pmu_train_dmem code pass
Training PASS
Normal Boot
Trying to boot from MMC1


U-Boot 2017.03 (Jan 24 2018 - 01:18:13 +0800)

CPU: Freescale i.MX8MQ rev2.0 at 1000 MHz
Reset cause: POR
Model: Freescale i.MX8MQ EVK
DRAM: 3 GiB
MMC: FSL_SDHC: 0, FSL_SDHC: 1
*** Warning - bad CRC, using default environment

In: serial
Out: serial
Err: serial
flash target is MMC:0
Net:
Warning: ethernet@30be0000 using MAC address from ROM
eth0: ethernet@30be0000
Fastboot: Normal
Hit any key to stop autoboot: 0
u-boot=> sf probe
SF: Detected n25q256 with page size 256 Bytes, erase size 64 KiB, total 32 MiB
u-boot=> sf erase 0 10000
SF: 65536 bytes @ 0x0 Erased: OK
u-boot=> sf read 41000000 0 100
device 0 offset 0x0, size 0x100
SF: 256 bytes @ 0x0 Read: OK
u-boot=> md 41000000 20
41000000: ffffffff ffffffff ffffffff ffffffff ................
41000010: ffffffff ffffffff ffffffff ffffffff ................
41000020: ffffffff ffffffff ffffffff ffffffff ................
41000030: ffffffff ffffffff ffffffff ffffffff ................
41000040: ffffffff ffffffff ffffffff ffffffff ................
41000050: ffffffff ffffffff ffffffff ffffffff ................
41000060: ffffffff ffffffff ffffffff ffffffff ................
41000070: ffffffff ffffffff ffffffff ffffffff ................
u-boot=> mm 41000000
41000000: ffffffff ? 03020100
41000004: ffffffff ? 07060504
41000008: ffffffff ? 0b0a0908
4100000c: ffffffff ? 0f0e0d0c
41000010: ffffffff ? .
u-boot=> md 41000000 20
41000000: 03020100 07060504 0b0a0908 0f0e0d0c ................
41000010: ffffffff ffffffff ffffffff ffffffff ................
41000020: ffffffff ffffffff ffffffff ffffffff ................
41000030: ffffffff ffffffff ffffffff ffffffff ................
41000040: ffffffff ffffffff ffffffff ffffffff ................
41000050: ffffffff ffffffff ffffffff ffffffff ................
41000060: ffffffff ffffffff ffffffff ffffffff ................
41000070: ffffffff ffffffff ffffffff ffffffff ................
u-boot=> sf write 41000000 0 10
device 0 offset 0x0, size 0x10
SF: 16 bytes @ 0x0 Written: OK
u-boot=> sf write 41000000 10 8
device 0 offset 0x10, size 0x8
SF: 8 bytes @ 0x10 Written: OK
u-boot=> mw 41000000 0 20
u-boot=> md 41000000 20
41000000: 00000000 00000000 00000000 00000000 ................
41000010: 00000000 00000000 00000000 00000000 ................
41000020: 00000000 00000000 00000000 00000000 ................
41000030: 00000000 00000000 00000000 00000000 ................
41000040: 00000000 00000000 00000000 00000000 ................
41000050: 00000000 00000000 00000000 00000000 ................
41000060: 00000000 00000000 00000000 00000000 ................
41000070: 00000000 00000000 00000000 00000000 ................
u-boot=> sf read 41000000 0 40
device 0 offset 0x0, size 0x40
SF: 64 bytes @ 0x0 Read: OK
u-boot=> md 41000000 20
41000000: 03020100 07060504 0b0a0908 0f0e0d0c ................
41000010: 00000000 00000000 ffffffff ffffffff ................
41000020: ffffffff ffffffff ffffffff ffffffff ................
41000030: ffffffff ffffffff ffffffff ffffffff ................
41000040: 00000000 00000000 00000000 00000000 ................
41000050: 00000000 00000000 00000000 00000000 ................
41000060: 00000000 00000000 00000000 00000000 ................
41000070: 00000000 00000000 00000000 00000000 ................
u-boot=>

Labels (1)
Tags (2)
1 Solution
898 Views
Yuri
NXP Employee
NXP Employee

Hello,

 

  Please try the attached patch.

 

Have a great day,

Yuri

 

------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer

button. Thank you!

View solution in original post

0 Kudos
2 Replies
899 Views
Yuri
NXP Employee
NXP Employee

Hello,

 

  Please try the attached patch.

 

Have a great day,

Yuri

 

------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer

button. Thank you!

0 Kudos
899 Views
mileswang
Contributor II

Thanks. The patch fix the issue.