一.Update SD card
1.In linux console
df //查看当前linux目录层次
ls /dev/disk/by-partlabel
PC $> dd if=tf-a.stm32 of=/dev/mmcblk0p1 conv=fdatasync
PC $> dd if=tf-a.stm32 of=/dev/mmcblk0p2 conv=fdatasync
PC $> dd if=/dev/zero of=/dev/mmcblk0p3 conv=fdatasync
PC $> dd if=u-boot.stm32 of=/dev/mmcblk0p3 conv=fdatasync
- Uboot console
//把sd卡通过usb 接口挂载到ubuntu系统下。
Board $> mmc dev 0
Board $> ums 0 mmc 0
- use dd cmd (update whole image)
PC $> cd build-openstlinuxweston-stm32mp1/tmp-glibc/deploy/images/stm32mp1/scripts/
PC $> ../scripts/create_sdcard_from_flashlayout.sh .flashlayout_st-image-weston/FlashLayout_sdcard_stm32mp157a-dk1-optee.tsv
PC $> sudo dd if=../flashlayout_st-image-weston_FlashLayout_sdcard_stm32mp157a-dk1-optee.raw of=/dev/sdb bs=8M conv=fdatasync status=progress
二. Update of e•MMC
1.On A linux Console
Board $> echo 0 > /sys/class/block/mmcblk1boot0/force_ro
Board $> mmc bootbus set single_backward x1 x1 dev/mmcblk1
#To update TF-A in boot1 and select this boot partition:
Board $> dd if=tf-a.stm32 of=/dev/mmcblk1boot0 conv=fdatasync
Board $> mmc bootpart enable 1 1 /dev/mmcblk1
#To update TF-A in boot2 and select this boot partition:
Board $> dd if=tf-a.stm32 of=/dev/mmcblk1boot1 conv=fdatasync
Board $> mmc bootpart enable 2 1 /dev/mmcblk1
#To update U-Boot in the first GPT partition:
Board $> dd if=/dev/zero of=/dev/mmcblk1p1 conv=fdatasync
Board $> dd if=u-boot.stm32 of=/dev/mmcblk1p1 conv=fdatasync
2.On A uboot Console
#To update FSBL=TF-A, select the boot1 HW partition and come back to the user area at the end.
#ums command,you can directly export the available block devices (sd/mmc/usb) as USB mass storage devices with ums command:
# ums = USB mass storage
Board $> mmc dev 1
Board $> mmc partconf 1 1 1 1
Board $> ums 0 mmc 1
PC $> dd if=tf-a.stm32 of=/dev/sdb conv=fdatasync
Board $> mmc partconf 1 1 1 0
#To update SSBL = U-Boot in the first GPT partition in the user partition
Board $> mmc dev 1
Board $> ums 0 mmc 1
PC $> dd if=u-boot.stm32 of=/dev/sdb1 conv=fdatasync
Board $> mmc bootbus 1 0 0 0
3.updating bootfs
PC $> scp stm32mp157c-mydevicetree-mx.dtb root@<Target_IP>:/boot/
PC $> mkdir -p $WORKING/bootfs
PC $> mount -o loop <st-image-bootfs-openstlinux-weston-stm32mp1.ext4> $WORKING/bootfs
##Then copy the new dtb file at the root of $WORKING/bootfs
PC $> umount $WORKING/bootfs
PC $> sync
PC $> dd if=<st-image-bootfs-openstlinux-weston-stm32mp1.ext4> of=/dev/mmblk0p4 conv=fdatasync