How to update uboot and kernel in the running time

Looks like an issue. Let me check this.

thank you for reply.
and I used dd to updat u-boot,but also error.
used: 1.copy boot.img.encrypt to the target device
sudo dd if=/boot.img.encrypt of=/dev/mmcblk0p5 //LNX-1
sudo dd if=/boot.img.encrypt of=/dev/mmcblk0p9 //LNX
but failed!

root@localhost:/home/scala# reboot
[ 142.702336] [dhd-wlan0] wl_android_wifi_off : in g_wifi_on=1, on_failure=1
[ 142.709883] [dhd-wlan0] wl_android_wifi_off : out
[ 142.854277] watchdog: watchdog0: watchdog did not stop!
[ 142.873546] systemd-shutdow: 50 output lines suppressed due to ratelimiting
[ 143.438219] reboot: Restarting system
[0000.207] [L4T TegraBoot] (version 00.00.2018.01-l4t-2d758fea)
[0000.212] Processing in cold boot mode Bootloader 2
[0000.217] A02 Bootrom Patch rev = 1023
[0000.220] Power-up reason: software reset
[0000.224] No Battery Present
[0000.227] pmic max77620 reset reason
[0000.230] pmic max77620 NVERC : 0x0
[0000.233] RamCode = 0
[0000.236] Platform has DDR4 type RAM
[0000.239] max77620 disabling SD1 Remote Sense
[0000.243] Setting DDR voltage to 1125mv
[0000.247] Serial Number of Pmic Max77663: 0x2639ed
[0000.255] Entering ramdump check
[0000.258] Get RamDumpCarveOut = 0x0
[0000.261] RamDumpCarveOut=0x0, RamDumperFlag=0xe59ff3f8
[0000.266] Last reboot was clean, booting normally!
[0000.271] Sdram initialization is successful
[0000.275] SecureOs Carveout Base=0x00000000ff800000 Size=0x00800000
[0000.281] Lp0 Carveout Base=0x00000000ff780000 Size=0x00001000
[0000.287] BpmpFw Carveout Base=0x00000000ff700000 Size=0x00080000
[0000.293] GSC1 Carveout Base=0x00000000ff600000 Size=0x00100000
[0000.299] GSC2 Carveout Base=0x00000000ff500000 Size=0x00100000
[0000.305] GSC4 Carveout Base=0x00000000ff400000 Size=0x00100000
[0000.310] GSC5 Carveout Base=0x00000000ff300000 Size=0x00100000
[0000.316] GSC3 Carveout Base=0x000000017f300000 Size=0x00d00000
[0000.332] RamDump Carveout Base=0x00000000ff280000 Size=0x00080000
[0000.338] Platform-DebugCarveout: 0
[0000.342] Nck Carveout Base=0x00000000ff080000 Size=0x00200000
[0000.347] Non secure mode, and RB not enabled.
[0000.364] Csd NumOfBlocks=0
[0000.556] *** Booting BFS0.
[0000.559] Read PT from (0:3)
[0000.565] Using BFS PT to query partitions
[0000.569] PT: Partition LNX NOT found !
[0001.170] *** Failing over to KFS1.
[0000.293] [L4T TegraBoot] (version 00.00.2018.01-l4t-2d758fea)
[0000.298] Processing in cold boot mode Bootloader 2
[0000.303] A02 Bootrom Patch rev = 1023
[0000.306] Power-up reason: software reset
[0000.310] No Battery Present
[0000.313] pmic max77620 reset reason
[0000.316] pmic max77620 NVERC : 0x0
[0000.319] RamCode = 0
[0000.322] Platform has DDR4 type RAM
[0000.325] max77620 disabling SD1 Remote Sense
[0000.329] Setting DDR voltage to 1125mv
[0000.333] Serial Number of Pmic Max77663: 0x2639ed
[0000.341] Entering ramdump check
[0000.344] Get RamDumpCarveOut = 0x0
[0000.347] RamDumpCarveOut=0x0, RamDumperFlag=0xe59ff3f8
[0000.352] Last reboot was clean, booting normally!
[0000.357] Sdram initialization is successful
[0000.361] SecureOs Carveout Base=0x00000000ff800000 Size=0x00800000
[0000.367] Lp0 Carveout Base=0x00000000ff780000 Size=0x00001000
[0000.373] BpmpFw Carveout Base=0x00000000ff700000 Size=0x00080000
[0000.379] GSC1 Carveout Base=0x00000000ff600000 Size=0x00100000
[0000.385] GSC2 Carveout Base=0x00000000ff500000 Size=0x00100000
[0000.390] GSC4 Carveout Base=0x00000000ff400000 Size=0x00100000
[0000.396] GSC5 Carveout Base=0x00000000ff300000 Size=0x00100000
[0000.402] GSC3 Carveout Base=0x000000017f300000 Size=0x00d00000
[0000.418] RamDump Carveout Base=0x00000000ff280000 Size=0x00080000
[0000.424] Platform-DebugCarveout: 0
[0000.428] Nck Carveout Base=0x00000000ff080000 Size=0x00200000
[0000.433] Non secure mode, and RB not enabled.
[0000.450] Csd NumOfBlocks=0
[0000.642] *** Booting BFS1.
[0000.644] Read PT from (0:3)
[0000.650] Using BFS PT to query partitions
[0000.655] PT: Partition LNX NOT found !
[0001.255] *** Failing over to KFS2.

What is the file size of your binary file?

boot.img.encrypt 499,712 bytes

hello rd1,

you’re not doing right, it’s kernel image and also u-boot binary included in the LNX partition.
please also check developer guide, U-Boot Customization chapter for reference.

The kernel is installed into the filesystem alongside the boot configuration file. The kernel (LNX) partition contains U-Boot.

you may perform flash scripts to flash a specific partition instead of flashing the whole device.
please also include --no-flash options to performs all steps except physically flashing the board, in order to generate sign and encrypt files.
for example, $ sudo ./flash.sh --no-flash -k LNX jetson-nano-devkit mmcblk0p1
after that, you may use dd commands to overwrite LNX partition.
thanks

Hi:
I used $ sudo ./flash.sh --no-flash -k LNX jetson-nano-emmc-smpsq mmcblk0p1
it is error:
###############################################################################

L4T BSP Information:

R32 , REVISION: 4.2

###############################################################################
Board ID() version() sku() product_id(smpsq)
Error: missing dtbfile (/home/scala/work/NVT210_03_04/bsp/kernel/dtb/smpsq-tegra210-p3448-0000-p3449-0000-a00.dtb).

our dtb is /home/scala/work/NVT210_03_04/bsp/kernel/dtb/smpsq-tegra210-p3448-0000-p3449-0000-b00.dtb, not *-a00.dtb

what should we do?

hello rd1,

are you having board customization?
since it’s board info detection during flash process, you might update the flash config or using offline approach to assign board info to the flash command-line.
thanks

Hello JerryChange:
we used sudo BOARDID=3448 BOARDSKU=0002 FAB=400 FUSELEVEL=fuselevel_production ./nvmassflashgen.sh jetson-nano-emmc-smpsq mmcblk0p1 to generate the final image.
after I used this command ,I try to generate u-boot upadte bin.
I try to modify the p3448-0000.conf.common to pass the error, but it will fail at other error.

###############################################################################

L4T BSP Information:

R32 , REVISION: 4.2

###############################################################################
Board ID() version() sku() product_id(smpsq)
copying bctfile(/home/scala/work/NVT210_03_04/bsp/bootloader/t210ref/BCT/P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.cfg)… done.
copying bootloader(/home/scala/work/NVT210_03_04/bsp/bootloader/t210ref/cboot.bin)… done.
copying initrd(/home/scala/work/NVT210_03_04/bsp/bootloader/l4t_initrd.img)… done.
populating kernel to rootfs… done.
populating initrd to rootfs… done.
populating /home/scala/work/NVT210_03_04/bsp/kernel/dtb/smpsq-tegra210-p3448-0002-p3449-0000-b00.dtb to rootfs… done.
Making Boot image… done.
Existing sosfile(/home/scala/work/NVT210_03_04/bsp/bootloader/nvtboot_recovery.bin) reused.
copying tegraboot(/home/scala/work/NVT210_03_04/bsp/bootloader/t210ref/nvtboot.bin)… done.
copying cpu_bootloader(/home/scala/work/NVT210_03_04/bsp/bootloader/t210ref/cboot.bin)… done.
copying bpffile(/home/scala/work/NVT210_03_04/bsp/bootloader/t210ref/sc7entry-firmware.bin)… done.
Existing badpagefile(/home/scala/work/NVT210_03_04/bsp/bootloader/badpage.bin) reused.
copying wb0boot(/home/scala/work/NVT210_03_04/bsp/bootloader/t210ref/warmboot.bin)… done.
Existing tosfile(/home/scala/work/NVT210_03_04/bsp/bootloader/tos-mon-only.img) reused.
Existing eksfile(/home/scala/work/NVT210_03_04/bsp/bootloader/eks.img) reused.
copying dtbfile(/home/scala/work/NVT210_03_04/bsp/kernel/dtb/smpsq-tegra210-p3448-0002-p3449-0000-b00.dtb)… done.
Copying nv_boot_control.conf to rootfs
Existing tbcfile(/home/scala/work/NVT210_03_04/bsp/bootloader/nvtboot_cpu.bin) reused.
copying tbcdtbfile(/home/scala/work/NVT210_03_04/bsp/kernel/dtb/smpsq-tegra210-p3448-0002-p3449-0000-b00.dtb)… done.
copying cfgfile(/home/scala/work/NVT210_03_04/bsp/bootloader/t210ref/cfg/flash_l4t_t210_emmc_p3448.xml) to flash.xml… done.
copying flasher(/home/scala/work/NVT210_03_04/bsp/bootloader/t210ref/cboot.bin)… done.
Existing flashapp(/home/scala/work/NVT210_03_04/bsp/bootloader/tegraflash.py) reused.
*** Signing boot.img ***
./tegraflash.py --chip 0x21 --cmd “sign ./signed/boot.img.encrypt”
Welcome to Tegra Flash
version 1.0.0
Type ? or help for help and q or quit to exit
Use ! to execute system commands

[ 0.0020 ] Generating signature
Error: Not supported
Failed to flash/read t210ref.

please apply below patch to your l4t_bup_gen.func under Linux_for_Tegra/bootloader.

--- a/t186/BUP/l4t_bup_gen.func
+++ b/t186/BUP/l4t_bup_gen.func
@@ -1,4 +1,4 @@
-# Copyright (c) 2017-2020, NVIDIA CORPORATION.  All rights reserved.
+# Copyright (c) 2017-2021, NVIDIA CORPORATION.  All rights reserved.
 #
 # NVIDIA CORPORATION and its licensors retain all intellectual property
 # and proprietary rights in and to this software, related documentation
@@ -147,9 +147,6 @@
 		'part_name=RP4; part_type=xusb; part_spec=${_common_spec};    part_file=$(ls rp4.blob 2> /dev/null || echo "")'
 	)
 
-	# For Jetson TX1, must use bl_update_payload to update bootloader.
-	local partitions_jetson_tx1=()
-
 	# For Jetson Nano QSPI SD, we can use all payloads to update corresponding partitions.
 	local _nano_qspi_sd="jetson-nano-devkit-mmcblk0p1"
 	local partitions_jetson_nano_qspi_sd=(
@@ -174,15 +171,12 @@
 		'part_name=RP4; part_type=nano_qspi_bl; part_spec=${_common_spec};    part_file=$(ls rp4.blob 2> /dev/null || echo "")'
 	)
 
-	# For Jetson Nano eMMC, it's same as TX1, must use bl_update_payload to update bootloader.
-	local partitions_jetson_nano_emmc=()
+	local partitions_t210ref=("${partitions_t210ref_common[@]}")
 
-	local partitions_t210ref=(
-		"${partitions_t210ref_common[@]}"
-		"${partitions_jetson_tx1[@]}"
-		"${partitions_jetson_nano_qspi_sd[@]}"
-		"${partitions_jetson_nano_emmc[@]}"
-	)
+	# Only nano-devkit uses "partitions_jetson_nano_qspi_sd"
+	if [[ "${_sw_spec}" == *"${_nano_qspi_sd}" ]]; then
+		partitions_t210ref+=("${partitions_jetson_nano_qspi_sd[@]}")
+	fi
 
 	# for binary common for different operating mode, op_mode = 0
 	# for binary different for different operating mode:

do I need some other commands? after modify the l4t_bup_gen.func,then do
sudo ./flash.sh --no-flash -k LNX jetson-nano-emmc-smpsq mmcblk0p1 .the same error:
*** Signing boot.img ***
./tegraflash.py --chip 0x21 --cmd “sign ./signed/boot.img.encrypt”
Welcome to Tegra Flash
version 1.0.0
Type ? or help for help and q or quit to exit
Use ! to execute system commands

[ 0.0025 ] Generating signature
Error: Not supported
Failed to flash/read t210ref.

Oh… we are talking about different issue. What I am saying is the issue in

Hi WayneWWW::
Thank you, the commamd pass, BUP gernerate succse,I will try it !
Does must place the BUP file in the target system under this directory /opt/ota_package/ ?

Hi JerryChang:
what should we do?
$ sudo ./flash.sh --no-flash -k LNX jetson-nano-emmc-smpsq mmcblk0p1 cann’t compile ok.

###############################################################################
Board ID() version() sku() product_id(smpsq)
copying bctfile(/home/scala/work/NVT210_03_04/bsp/bootloader/t210ref/BCT/P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.cfg)… done.
copying bootloader(/home/scala/work/NVT210_03_04/bsp/bootloader/t210ref/cboot.bin)… done.
copying initrd(/home/scala/work/NVT210_03_04/bsp/bootloader/l4t_initrd.img)… done.
populating kernel to rootfs… done.
populating initrd to rootfs… done.
populating /home/scala/work/NVT210_03_04/bsp/kernel/dtb/smpsq-tegra210-p3448-0002-p3449-0000-b00.dtb to rootfs… done.
Making Boot image… done.
Existing sosfile(/home/scala/work/NVT210_03_04/bsp/bootloader/nvtboot_recovery.bin) reused.
copying tegraboot(/home/scala/work/NVT210_03_04/bsp/bootloader/t210ref/nvtboot.bin)… done.
copying cpu_bootloader(/home/scala/work/NVT210_03_04/bsp/bootloader/t210ref/cboot.bin)… done.
copying bpffile(/home/scala/work/NVT210_03_04/bsp/bootloader/t210ref/sc7entry-firmware.bin)… done.
Existing badpagefile(/home/scala/work/NVT210_03_04/bsp/bootloader/badpage.bin) reused.
copying wb0boot(/home/scala/work/NVT210_03_04/bsp/bootloader/t210ref/warmboot.bin)… done.
Existing tosfile(/home/scala/work/NVT210_03_04/bsp/bootloader/tos-mon-only.img) reused.
Existing eksfile(/home/scala/work/NVT210_03_04/bsp/bootloader/eks.img) reused.
copying dtbfile(/home/scala/work/NVT210_03_04/bsp/kernel/dtb/smpsq-tegra210-p3448-0002-p3449-0000-b00.dtb)… done.
Copying nv_boot_control.conf to rootfs
Existing tbcfile(/home/scala/work/NVT210_03_04/bsp/bootloader/nvtboot_cpu.bin) reused.
copying tbcdtbfile(/home/scala/work/NVT210_03_04/bsp/kernel/dtb/smpsq-tegra210-p3448-0002-p3449-0000-b00.dtb)… done.
copying cfgfile(/home/scala/work/NVT210_03_04/bsp/bootloader/t210ref/cfg/flash_l4t_t210_emmc_p3448.xml) to flash.xml… done.
copying flasher(/home/scala/work/NVT210_03_04/bsp/bootloader/t210ref/cboot.bin)… done.
Existing flashapp(/home/scala/work/NVT210_03_04/bsp/bootloader/tegraflash.py) reused.
*** Signing boot.img ***
./tegraflash.py --chip 0x21 --cmd “sign ./signed/boot.img.encrypt”
Welcome to Tegra Flash
version 1.0.0
Type ? or help for help and q or quit to exit
Use ! to execute system commands

[ 0.0020 ] Generating signature
Error: Not supported
Failed to flash/read t210ref.

hello rd1,

it turns out this is not supported according to internal flash script file, tegraflash_internal.py
for example,

def tegraflash_encrypt_sign_binary(exports, args):
...
    if int(values['--chip'], 0) == 0x21:
         raise tegraflash_exception("Not supported")

tegraflash_internal.py (138.7 KB)

It is our tegraflash_internal.py, help to check.

hello rd1,

could you please try below,
I’m able to generate boot.img.encrypt as following,
for example,

$ sudo ./tegraflash.py --bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.cfg --bl cboot.bin --cfg flash.xml --chip 0x21 --applet nvtboot_recovery.bin --cmd "sign"

this will assuming zero to filled SBK key,
it will copying signed file to $OUT/Linux_for_Tegra/bootloader/signed/
thanks

sudo ./tegraflash.py --bct P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.cfg --bl cboot.bin --cfg flash.xml --chip 0x21 --applet nvtboot_recovery.bin --cmd “sign”
this command is OK .

Hi JerryChang::
I used boot.img.encrypt ,dd to my target system ,reboot,but failed again.

hello rd1,

could you please setup serial console to share the errors for reference,

BTW,
since you’re having board customization,
you should also check you’re using correct cfg files in the python scripts to generate encrypt binaries.
you may perform a full-flash, check the flash messages for reference.
thanks