How can I boot from nandflash on imx93 EVK

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

How can I boot from nandflash on imx93 EVK

927 次查看
howeWW
Contributor I

Hello, we use imx93 and the lastet bsp 6.12.20-2.0.0. Now we want to boot from nandflash and we have confirmed th imx93 support this. But when we use uuu to flash the nandflash, it always report a error like this:

howeWW_0-1751016116464.png

which report "we cant find the right rom version" by kobs-ng, so we read the source code form git, and we find kobs-ng not support imx93. So, it's my misunderstand? And can you help me to solve the problem. Thank you very much!

howeWW_1-1751016363761.png

 

标记 (1)
0 项奖励
回复
5 回复数

898 次查看
pengyong_zhang
NXP Employee
NXP Employee

Hi @howeWW 

What is UUU command do you run?

 

0 项奖励
回复

886 次查看
howeWW
Contributor I

Hello,@pengyong_zhang

Which like ranYang's said,the first we try the uuu eexample-script, and it stucked at kobs-ng. And today we try the another script which from 把手教你以 Standalone 方式编译(八)- NAND Flash

uuu_version 1.2.39

SDPS: boot -f flash.bin

# These commands will be run when use SPL and will be skipped if no spl
# SDPU will be deprecated. please use SDPV instead of SDPU
# {
SDPU: delay 1000
SDPU: write -f flash.bin -offset 0x57c00
SDPU: jump
# }

# These commands will be run when use SPL and will be skipped if no spl
# if (SPL support SDPV)
# {
SDPV: delay 1000
SDPV: write -f flash.bin -skipspl
SDPV: jump
# }


FB: ucmd setenv fastboot_buffer ${loadaddr}
FB: download -f flash.bin
FB: ucmd if test ! -n "$fastboot_bytes"; then setenv fastboot_bytes $filesize; else true; fi
FB[-t 60000]: ucmd fspinand init spi-nand0 ${fastboot_buffer} ${fastboot_bytes}
FB: ucmd setenv fastboot_buffer ${loadaddr}
FB: download -f Image
FB: ucmd setenv fastboot_buffer ${fdt_addr}
FB: download -f imx93-11x11-evk-flexspi-nand-m2.dtb
FB: ucmd setenv fastboot_buffer ${initrd_addr}
FB: download -f fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.zst.u-boot
FB: ucmd setenv bootargs ${bootargs} ${mtdparts}
FB: acmd ${kboot} ${loadaddr} ${initrd_addr} ${fdt_addr}

FBK: ucmd cat /proc/mtd
FBK: ucmd cat /proc/mtd | while read dev size erase name; do mtd=${dev:3}; mtd=${mtd%:}; name=${name%\"}; name=${name#\"}; echo export $name=$mtd >> /tmp/mtd.sh; done;

FBK: ucmd chmod 777 /tmp/mtd.sh

FBK: ucmd mount -t debugfs debugfs /sys/kernel/debug

# burn kernel
FBK: ucmd source /tmp/mtd.sh; flash_erase /dev/mtd${nandkernel} 0 0
FBK: ucp Image t:/tmp/img
FBK: ucmd source /tmp/mtd.sh; nandwrite -p /dev/mtd${nandkernel} -p /tmp/img

# burn dtb
FBK: ucmd source /tmp/mtd.sh; flash_erase /dev/mtd${nanddtb} 0 0
FBK: ucp imx93-11x11-evk-flexspi-nand-m2.dtb t:/tmp/dtb
FBK: ucmd source /tmp/mtd.sh; nandwrite -p /dev/mtd${nanddtb} -p /tmp/dtb

# burn uTee
# FBK: ucmd source /tmp/mtd.sh; flash_erase /dev/mtd${nandtee} 0 0
# FBK: ucp _tee t:/tmp/tee
# FBK: ucmd source /tmp/mtd.sh; nandwrite -p /dev/mtd${nandtee} -p /tmp/tee

# burn rootfs
FBK: ucmd source /tmp/mtd.sh; flash_erase /dev/mtd${nandrootfs} 0 0
FBK: ucmd source /tmp/mtd.sh; ubiattach /dev/ubi_ctrl -m ${nandrootfs}
FBK: ucmd source /tmp/mtd.sh; ubimkvol /dev/ubi0 -Nnandrootfs -m
FBK: ucmd source /tmp/mtd.sh; mkdir -p /mnt/mtd
FBK: ucmd source /tmp/mtd.sh; mount -t ubifs ubi0:nandrootfs /mnt/mtd
FBK: acmd export EXTRACT_UNSAFE_SYMLINKS=1; tar --zstd --warning=no-timestamp -x -C /mnt/mtd
FBK: ucp core-image-base-imx93-11x11-lpddr4x-evk.rootfs-20241211083856.tar.zst t:-
FBK: sync
FBK: ucmd umount /mnt/mtd

FBK: done

But, it still stuck the fspinand cmd, and it report follow error:

[2025-06-30 10:21:07]  u-boot=> fspinand init spi-nand0 ${fastboot_buffer} ${fastboot_bytes}
[2025-06-30 10:21:17]  Unknown command 'fspinand init spi-nand0' - try 'help'
标记 (1)
0 项奖励
回复

837 次查看
pengyong_zhang
NXP Employee
NXP Employee

please use the uuu -b nand <bootloader> command

nand burn boot loader to NAND flash
arg0: _flash.bin bootloader
arg1: _image[Optional] image burn to nand, default is the same as bootloader

0 项奖励
回复

894 次查看
ranYang
Contributor III
in uboot print info as follows:
u-boot=> sf probe
drivers/mtd/nand/spi/core.c:1032- spinand_detect() spi-nand: spi_nand spi-nand@0: Winbond SPI NAND was found.
drivers/mtd/nand/spi/core.c:1034- spinand_detect() spi-nand: spi_nand spi-nand@0: 512 MiB, block size: 128 KiB, page size: 2048, OOB size: 128
u-boot=> mtd list
drivers/mtd/spi/spi-nor-core.c:1592- spi_nor_read_id() jedec_spi_nor flash@0: unrecognized JEDEC id bytes: ff, ef, ba
List of MTD devices:
* spi-nand1
- device: spi-nand@0
- parent: spi@425e0000
- driver: spi_nand
- path: /soc@0/bus@42000000/spi@425e0000/spi-nand@0
- type: NAND flash
- block size: 0x20000 bytes
- min I/O: 0x800 bytes
- OOB size: 128 bytes
- OOB available: 56 bytes
- 0x000000000000-0x000020000000 : "spi-nand1"

and I need use other command do it,example : fspinand


0 项奖励
回复

896 次查看
ranYang
Contributor III
uuu_version 1.2.39

# Please replace below item with actual name
# @_flash_fw.bin | boot loader firmware, for i.MX8QM/QX, it's different from _flash.bin, for all other platforms, it's same as _flash.bin
# @_flash.bin | boot loader file burn to NAND
# @_Image | linux kernel image, zImage for arm32, Image for arm64
# @_board.dtb | board dtb file
# @_initramfs.cpio.zst.uboot | initramfs
# @_tee | optee image
# @_rootfs.tar.zst | rootfs

# This command will be run when i.MX6/7 i.MX8MM, i.MX8MQ
SDP: boot -f _flash_fw.bin

# This command will be run when ROM support stream mode
# i.MX8QXP, i.MX8QM
SDPS: boot -f _flash_fw.bin

# These commands will be run when use SPL and will be skipped if no spl
# SDPU will be deprecated. please use SDPV instead of SDPU
# {
SDPU: delay 1000
SDPU: write -f _flash_fw.bin -offset 0x57c00
SDPU: jump
# }

# These commands will be run when use SPL and will be skipped if no spl
# if (SPL support SDPV)
# {
SDPV: delay 1000
SDPV: write -f _flash_fw.bin -skipspl
SDPV: jump
# }

FB: ucmd setenv fastboot_buffer ${loadaddr}
FB: download -f _Image
FB: ucmd setenv fastboot_buffer ${fdt_addr}
FB: download -f _board.dtb
FB: ucmd setenv fastboot_buffer ${initrd_addr}
FB: download -f _initramfs.cpio.zst.uboot
FB: ucmd setenv bootargs ${bootargs} ${mtdparts}
#FB: ucmd setenv bootargs ${mtdparts} console=ttyLP0,115200
#FB: ucmd printenv bootargs

FB: acmd ${kboot} ${loadaddr} ${initrd_addr} ${fdt_addr}

FBK: ucmd ls /proc/*

FBK: ucmd cat /proc/mtd
FBK: ucmd cat /proc/mtd | while read dev size erase name; do mtd=${dev:3}; mtd=${mtd%:}; name=${name%\"}; name=${name#\"}; echo export $name=$mtd >> /tmp/mtd.sh; done;

FBK: ucmd chmod 777 /tmp/mtd.sh
FBK: ucmd cat /tmp/mtd.sh
FBK: ucmd mount -t debugfs debugfs /sys/kernel/debug
#FBK: ucmd ls /dev/mtd*
#FBK: ucmd echo ${nandboot}
# write boot loader
FBK: ucmd source /tmp/mtd.sh; flash_erase /dev/mtd${nandboot} 0 0
FBK: ucp _flash.bin t:/tmp/boot
#FBK: ucmd ls -l /tmp/*

FBK: ucmd cat /sys/devices/soc0/soc_id
FBK: ucmd cat /proc/cpuinfo

FBK: ucmd source /tmp/mtd.sh; cd /tmp; if [[ ! `cat /sys/devices/soc0/soc_id` =~ .*MX8(Q|DXL|MN|MP).* ]]; then pad="-x"; fi; kobs-ng init $pad -v --chip_0_device_path=/dev/mtd${nandboot} /tmp/boot

FBK: done
0 项奖励
回复