I was trying to flash only cboot with the following command but although the flash command exits normally, it puts the module into a boot loop. The only way to recover is to flash all.
The first command with the “-no-systemimg” would have modified things. Can you cleanly reflash all and then run the version without “-no-systemimg”? Or are you saying you had a booting system and the final command left it in a boot loop too?
I’ve also tried flashing cpu-bootloader_b and bootloader-dtb with the default images with the same result.
When you flash everything, the script erases the entire qspi-nor device before writing to it. If you flash only a single partition, I wonder if that partition’s erase blocks aren’t being erased before the partition is written resulting in corrupted data.
Oh by the way… --no-systemimg still writes the system image.
Oh by the way… --no-systemimg still writes the system image.
Actually, flash.sh is a script with long history since TK1 era. There are some options that may not be verified now.
It seems you insist using “–no-systmeimg”. However, this option is probably not verified for long time so I don’t suggest to use it.
Please just use below to flash and it should not erase your app partition.
@WayneWWW
is it possible to share ETA for this fix?
Every time I have to flash full image to update the cboot. is there any other way to update the cboot in QSPI memory faster.
2 patches are needed. Please try to add them to your flash.sh.
Patch1
diff --git a/scripts/flash.sh b/scripts/flash.sh
index 407cedd..bcba0fd 100755
--- a/scripts/flash.sh
+++ b/scripts/flash.sh
@@ -910,6 +910,8 @@
echo "Board ID(${board_id}) version(${board_version}) sku(${board_sku}) revision(${board_revision})" >/dev/stderr;
}
+ext_target_board_canonical=`readlink -e "${ext_target_board}".conf`
+ext_target_board_canonical=`basename "${ext_target_board_canonical}" .conf`
source ${ext_target_board}.conf
# set up path variables
@@ -1471,7 +1473,7 @@
echo -n "copying initrd(${kernelinitrd})... ";
cp -f "${kernelinitrd}" initrd;
chkerr;
- # Code below for the initrd boot. Further details: http://nvbugs/2053323
+ # Code below for the initrd boot. Further details: see 2053323
if [ "${target_rootdev}" = "cloning_root" ]; then
clone_restore_dir="${LDK_DIR}/clone_restore"
if [ ! -f ${clone_restore_dir}/nvbackup_copy_bin.func ]; then
@@ -2300,7 +2302,7 @@
;;
#
# Comment out sc7 support. It is found that sc7 sigheader is different and it needs special handling
- # See bug http://nvbugs/200617500
+ # See 200617500
#
# sc7 | sc7_b) target_partfile="${wb0bootname}";
# need_sign=1;
@@ -2381,8 +2383,15 @@
if [ ${no_flash} -eq 1 ]; then
FLASHARGS="--chip ${tegraid} --cmd \"sign ${target_partfile}\" ";
else
- # issue an erase command before write
- FLASHARGS+="erase ${target_partname}; ";
+ # Only issue erase command for QSPI device.
+ # The sdmmc erase/trim operation may corrupt other partitions.
+ # See 200565454 and 200615787
+ if [[ "${ext_target_board_canonical}" == "p3509-0000+p3668"* ||
+ "${ext_target_board_canonical}" == "p3448-0000-sd"* ||
+ "${ext_target_board_canonical}" == "p3448-0000-max-spi"* ]]; then
+ # issue an erase command before write
+ FLASHARGS+="erase ${target_partname}; ";
+ fi
if [ ${need_sign} -eq 1 ]; then
# special handling for MB1_BCT and T210
Patch 2
diff --git a/scripts/flash.sh b/scripts/flash.sh
index 8a2e90f..084d566 100755
--- a/scripts/flash.sh
+++ b/scripts/flash.sh
@@ -2348,6 +2348,9 @@
if [ ${no_flash} -eq 1 ]; then
FLASHARGS="--chip ${tegraid} --cmd \"sign ${target_partfile}\" ";
else
+ # issue an erase command before write
+ FLASHARGS+="erase ${target_partname}; ";
+
if [ ${need_sign} -eq 1 ]; then
# special handling for MB1_BCT and T210
if [ "${target_partname}" = "MB1_BCT" ] ||