i.MX8MM QSPI booting and partition

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

i.MX8MM QSPI booting and partition

跳至解决方案
7,093 次查看
vignesh-baskaran
Contributor III

Hi,

We having Custom board based on iMX8MM-EVk,

We replaced Qspi memory chip mt25qu02g. No issues in detecting in u-boot and linux.

 

 

We were trying to do porting Images and booting from QSPI, Please refer below images.

 



0 项奖励
回复
1 解答
6,969 次查看
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @vignesh-baskaran,

I hope you are doing well.

One can follow below-mentioned steps to load images in QSPI Flash in u-boot.

1. Load Image and dtb in RAM using fatload command.

#fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}

#fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdtfile}

2. Flash the Image and dtb in flash using sf write.

#sf write ${loadaddr} <offset> <len>
# sf write ${fdt_addr_r} <offset> <len>

 - Please make sure to use correct offset and length while writing Image and dtb to flash & make sure that they don't overwrite each other.

  One can find the correct length (size) using the below command

# fatls mmc ${mmcdev}:${mmcpart}

 Please share the output of the above command.

Please try after erasing flash memory.

Thanks & Regards,
Dhruvit Vasavada

在原帖中查看解决方案

0 项奖励
回复
8 回复数
7,044 次查看
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @vignesh-baskaran,

I hope you are doing well.

Errors in the attached image suggest that the device tree is not loaded correctly. Please make sure that you have used the correct offset and size.

Instead of using dd , one can flash Image and fdt using the sf write command in u-boot.

Please provide me with an output of the printenv command.

Please share the output of  the below-mentioned commands after loading device tree (using sf read )

=>  fdt addr ${fdt_addr_r} 

=>  fdt print 

Thanks & Regards,
Dhruvit Vasavada

 

0 项奖励
回复
7,034 次查看
vignesh-baskaran
Contributor III

Hi @Dhruvit,

1) Please refer the attachment for printenv .

 

2)

u-boot=>  fdt addr ${fdt_addr_r} 
libfdt fdt_check_header(): FDT_ERR_BADMAGIC

u-boot=> fdt print               
No FDT memory address configured. Please configure
the FDT address via "fdt addr <address>" command.
Aborting!

 

3)

Instead of using dd , one can flash Image and fdt using the sf write command in u-boot.

You suggested Sf write for writing to qspi,

Let assume i have images from SD card and want to copy to  QSPi, How can i do that?

 

Please let us know how to do it. it will be helpful. 

 

 

Thanks

0 项奖励
回复
6,970 次查看
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @vignesh-baskaran,

I hope you are doing well.

One can follow below-mentioned steps to load images in QSPI Flash in u-boot.

1. Load Image and dtb in RAM using fatload command.

#fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}

#fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdtfile}

2. Flash the Image and dtb in flash using sf write.

#sf write ${loadaddr} <offset> <len>
# sf write ${fdt_addr_r} <offset> <len>

 - Please make sure to use correct offset and length while writing Image and dtb to flash & make sure that they don't overwrite each other.

  One can find the correct length (size) using the below command

# fatls mmc ${mmcdev}:${mmcpart}

 Please share the output of the above command.

Please try after erasing flash memory.

Thanks & Regards,
Dhruvit Vasavada

0 项奖励
回复
6,923 次查看
vignesh-baskaran
Contributor III

Hi @Dhruvit ,

 

Thanks for the input. its working for us.

 

if Anyone facing same issue. This is because of the SPI mode selecting during Sf probe.

 

 

Thanks.

 

0 项奖励
回复
6,767 次查看
vignesh-baskaran
Contributor III

Hi @Dhruvit 

 

Thanks for the support.

0 项奖励
回复
6,775 次查看
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @vignesh-baskaran,

I hope you are doing well.

Glad to know that issue is resolved.

Can I mark this case as close?

Thanks & Regards,
Dhruvit Vasavada

0 项奖励
回复
6,953 次查看
vignesh-baskaran
Contributor III

Hi @Dhruvit,

 

We believe somehow sf read and sf write is not working as we expected. 

 

We load the image from SD to RAM and check 

=> fdt addr ${fdt_addr}
=> fdt print ${fdt_addr}.

it is working perfectly.

But when We try to load from QSPI to RAM 

We getting error.

libfdt fdt_check_header(): FDT_ERR_BADMAGIC

 

We thought this could be issue with size we loading. We cross verified it, its not the issue. 

 

Note: We tried erase operation before the sf write. 

 

 

Can you please let us know about the issue?

0 项奖励
回复
7,068 次查看
vignesh-baskaran
Contributor III

Hi,

 

Can anyone please look into this?

标记 (1)
0 项奖励
回复