i.MX8MM QSPI booting and partition

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

i.MX8MM QSPI booting and partition

Jump to solution
3,032 Views
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 Kudos
Reply
1 Solution
2,908 Views
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

View solution in original post

0 Kudos
Reply
8 Replies
2,983 Views
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 Kudos
Reply
2,973 Views
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 Kudos
Reply
2,909 Views
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 Kudos
Reply
2,862 Views
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 Kudos
Reply
2,706 Views
vignesh-baskaran
Contributor III

Hi @Dhruvit 

 

Thanks for the support.

0 Kudos
Reply
2,714 Views
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 Kudos
Reply
2,892 Views
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 Kudos
Reply
3,007 Views
vignesh-baskaran
Contributor III

Hi,

 

Can anyone please look into this?

Tags (1)
0 Kudos
Reply