Skip to content

Commit 4f4977b

Browse files
hanxu-nxpnxpfrankli
authored andcommitted
burn large file in some chunks for spi nor.
change the spi nor built-in script to burn large files in small chunks to avoid uuu timeout. Signed-off-by: Han Xu <han.xu@nxp.com>
1 parent 3b48945 commit 4f4977b

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

uuu/qspi_burn_loader.lst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,16 @@ FB: ucmd if test ! -n "$fastboot_bytes"; then setenv fastboot_bytes $filesize; e
3333

3434
# Check Image if include flexspi header
3535
FB: ucmd if qspihdr dump ${fastboot_buffer}; then setenv qspihdr_exist yes; else setenv qspihdr_exist no; fi;
36+
# Check Image size if larger than 16M, then use uboot command to write image
37+
FB: ucmd if itest ${fastboot_buffer} -gt 1000000; then setenv qspihdr_large yes; else setenv qspihdr_large no; fi;
3638

37-
FB[-t 60000]: ucmd if test ${qspihdr_exist} = yes; then qspihdr init ${fastboot_buffer} ${fastboot_bytes} safe; else true; fi;
39+
FB[-t 60000]: ucmd if test ${qspihdr_exist} = yes -a ${qspihdr_large} = no; then qspihdr init ${fastboot_buffer} ${fastboot_bytes} safe; else true; fi;
3840

3941
#if uboot can't support qspihdr command, use uboot image to write qspi image, which require image include qspi flash header
4042
FB: ucmd if test ${qspihdr_exist} = no; then sf probe; else true; fi;
4143
FB[-t 40000]: ucmd if test ${qspihdr_exist} = no; then sf erase 0 +${fastboot_bytes}; else true; fi;
4244
FB[-t 20000]: ucmd if test ${qspihdr_exist} = no; then sf write ${fastboot_buffer} 0 ${fastboot_bytes}; else true; fi;
45+
# if Image is larger than 16M, use uboot command to write image
46+
FB: ucmd if test ${qspihdr_large} = yes; then sf probe; else true; fi;
47+
FB: write -f _image -format "sf erase @off +@size; sf write ${fastboot_buffer} @off @size" -blksz 1 -each 0x100000
4348
FB: done

0 commit comments

Comments
 (0)