nxp-imx / mfgtools

Freescale/NXP I.MX Chip image deploy tools.
BSD 3-Clause "New" or "Revised" License
536 stars 296 forks source link

qustion: flash bootloader to sdcard with uuu #300

Open qianfan-Zhao opened 2 years ago

qianfan-Zhao commented 2 years ago

Hi:

I found this scripts in uuu/sd_burn_loader.lst

FB: ucmd setenv fastboot_dev mmc
FB: ucmd setenv mmcdev ${sd_dev}
FB: ucmd mmc dev ${sd_dev}
FB: flash bootloader _image
FB: Done

And have some quesitions:

  1. bootloader should a MBR partition, and how to create this partition by using uuu?
  2. RM told that bootloader should position in 1K offset when booting from SD. this is means bootloader partition located at 1K offset?

Thanks

nxpfrankli commented 2 years ago

UUU don't create partition. it is hardcode and write to 1k offset. wic's image partition table already skip this space

qianfan-Zhao commented 2 years ago

@nxpfrankli

I can flash bootloader by using dd: 'dd if=u-boot-with-spl.imx of=/dev/sdx bs=1K seek=1', but failed with uuu: 'uuu -b sd burn u-boot-with-spl.imx'

how to flash bootloader by uuu?

nxpfrankli commented 2 years ago

uuu -b sd u-boot-with-spl.imx
your uboot need enable fastboot support

qianfan-Zhao commented 2 years ago

I am tested with 'mx6ul_14x14_evk_defconfig', fastboot is enabled. it doesn't work.

nxpfrankli commented 2 years ago

what's problem your met? Any log from uart?

qianfan-Zhao commented 2 years ago

All the test under: '2021.04+fslc':

make mx6ul_14x14_evk_defconfig
make -j4

u-boot-with-spl.imx is generated, but 'uuu u-boot-with-spl.imx' doesn't work. Download and startup the bootloader by imx_usb:

imx_usb SPL
imx_usb u-boot.img

After that the u-boot is startup, I can connect the device by using fastboot or uuu.

My board work in 'serial download' mode, no emmc. A microSD card is connected on MMC1. I want burn u-boot-with-spl.bin to microSD card, but failed:

➜  u-boot-fslc git:(2021.04+fslc) ✗ uuu -b sd u-boot-with-spl.imx
uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.2.135-324-g0e14621

Success 0    Failure 1

2:15     4/ 5 [invalid partition or device           ] FB: flash bootloader u-boot-with-spl.imx

It reported that can't find a partition named 'bootloader'

** Bad device specification mmc bootloader **
Couldn't find partition mmc bootloader
nxpfrankli commented 2 years ago

Not sure what version of uboot do you use?

it should miss some patch, refer:

https://source.codeaurora.org/external/imx/uboot-imx/tree/drivers/fastboot/fb_fsl?h=lf_v2020.04

uuu download spl, it should be

uuu spl. uuu SDPU: write -f uboot.img uuu SDPU: Jump.

uuu supposed spl and uboot.img package into a file, such as flash.bin. but still need some patch to support. I am not sure if such patch upstreamed.

uuu -b spl flash.bin

qianfan-Zhao commented 2 years ago

@nxpfrankli Thanks for yours guide. I used u-boot-fslc cloned from: u-boot-fslc, it is leak some patchs.

I will try u-boot-imx.

but why nxp maintain two version of u-boot(u-boot-fslc and uboot-imx)?