Hi Stefano,
Thanks for the guidance. I made the modifications as advised and confirmed that both U-Boot and Linux share environment variables, including the 'ustate' updated by swupdate.
Following a successful swupdate where ustate is updated in Linux and upon reboot, U-Boot recognizes ustate set to 1. However, U-Boot persists in booting to the old partition instead of the updated one.
What modifications are necessary within U-Boot to switch the partition?
Below, I've provided the relevant logs for your reference:
swupdate logs:
[TRACE] : SWUPDATE running : [network_thread] : Incoming network request: processing...
[INFO ] : SWUPDATE started : Software Update started !
[TRACE] : SWUPDATE running : [network_initializer] : Software update started
[TRACE] : SWUPDATE running : [extract_file_to_tmp] : Found file
[TRACE] : SWUPDATE running : [extract_file_to_tmp] : filename sw-description
[TRACE] : SWUPDATE running : [extract_file_to_tmp] : size 1154
[DEBUG] : SWUPDATE running : [parse_cfg] : Parsing config file /tmp/sw-description
[TRACE] : SWUPDATE running : [get_common_fields] : Version 0.1.0
[TRACE] : SWUPDATE running : [get_common_fields] : reboot_required 1
[TRACE] : SWUPDATE running : [parse_hw_compatibility] : Accepted Hw Revision : 1.0
[TRACE] : SWUPDATE running : [_parse_images] : Found compressed Image: core-image-full-cmdline-beaglebone-yocto.ext4.gz in device : /dew
[TRACE] : SWUPDATE running : [_parse_scripts] : Found Script: emmcsetup.lua
[TRACE] : SWUPDATE running : [_parse_bootloader] : Bootloader var: bootcmd_legacy_mmc1 = setenv mmcdev 1;setenv bootpart 1:3; run mmcbot
[TRACE] : SWUPDATE running : [_parse_bootloader] : Bootloader var: boot_targets = legacy_mmc1 mmc1 nand0 pxe dhcp
[TRACE] : SWUPDATE running : [parse] : Number of found artifacts: 1
[TRACE] : SWUPDATE running : [parse] : Number of scripts: 1
[TRACE] : SWUPDATE running : [parse] : Number of steps to be run: 3
[TRACE] : SWUPDATE running : [check_hw_compatibility] : Hardware beaglebone Revision: 1.0
[TRACE] : SWUPDATE running : [check_hw_compatibility] : Hardware compatibility verified
[DEBUG] : SWUPDATE running : [preupdatecmd] : Running Pre-update command
[TRACE] : SWUPDATE running : [extract_files] : Found file
[TRACE] : SWUPDATE running : [extract_files] : filename emmcsetup.lua
[TRACE] : SWUPDATE running : [extract_files] : size 1691 required
[TRACE] : SWUPDATE running : [extract_files] : Found file
[TRACE] : SWUPDATE running : [extract_files] : filename core-image-full-cmdline-beaglebone-yocto.ext4.gz
[TRACE] : SWUPDATE running : [extract_files] : size 38306905 required
[TRACE] : SWUPDATE running : [server_handle_initial_state] : Got state=2 from command line.
[DEBUG] : SWUPDATE running : [server_get_device_info] : Getting information for device 'bbb'
[DEBUG] : SWUPDATE running : [channel_set_options] : cURL's low download speed timeout is disabled, this is most probably not what you .
[DEBUG] : SWUPDATE running : [channel_get] : Trying to GET http://papero:8080/default/controller/v1/bbb
[TRACE] : SWUPDATE running : [extract_padding] : Expecting up to 512 padding bytes at end-of-file
[TRACE] : SWUPDATE running : [network_initializer] : Valid image found: copying to FLASH
[INFO ] : SWUPDATE running : Installation in progress
[TRACE] : SWUPDATE running : [start_lua_script] : Calling Lua /tmp/scripts/emmcsetup.lua
[TRACE] : SWUPDATE running : [run_lua_script] : LUA Exit: is boolean 1
[TRACE] : SWUPDATE running : [install_single_image] : Found installer for stream core-image-full-cmdline-beaglebone-yocto.ext4.gz raw
* Could not resolve host: papero
* Closing connection 9
[ERROR] : SWUPDATE failed [0] ERROR channel_curl.c : channel_get : 1549 : Channel get operation failed (6): 'Couldn't resolve host name'
[ERROR] : SWUPDATE failed [0] ERROR swupdate_vars.c : swupdate_vars_get : 89 : Failed to get variable action_id
[INFO ] : SWUPDATE running : [server_start] : Sleeping for 10s until retrying...
[TRACE] : SWUPDATE running : [start_lua_script] : Calling Lua /tmp/scripts/emmcsetup.lua
[TRACE] : SWUPDATE running : [run_lua_script] : LUA Exit: is boolean 1
[TRACE] : SWUPDATE running : [run_lua_script] : Script output: Post installed script called script end
[INFO ] : SWUPDATE successful ! SWUPDATE successful !
[DEBUG] : SWUPDATE running : [postupdate] : Running Post-update command
The system is going down for reboot NOW!
INIT: Sending processes configured via /etc/inittab the TERM signal
[TRACE] : SWUPDATE running : [__run_cmd] : /sbin/reboot command returned 0
[TRACE] : SWUPDATE running : [network_initializer] : Main thread sleep again !
[INFO ] : No SWUPDATE running : Waiting for requests...
Stopping OpenBSD Secure Shell server: sshdstopped /usr/sbin/sshd (pid 268)
fw_printenv output (Linux):beaglebone-yocto:~# fw_printenv
arch=arm
baudrate=115200
ustate=1
vendor=ti
ver=U-Boot 2022.01 (Jan 10 2022 - 18:46:34 +0000)
printenv output (U-Boot):
=>
=> printenv
arch=arm
baudrate=115200
ustate=1
vendor=ti
ver=U-Boot 2022.01 (Jan 10 2022 - 18:46:34 +0000)
Thanks,
Thomas