Skip to content

Environment variables of u-boot can't be accessed

Outline

  • Environment variables of u-boot can't be accessed both SWUpdate and fw_setenv/fw_printenv.
  • The update is failed because the environment variable of u-boot named "ustate" can't be modified.

Log

  • SWUpdate
    [  149.224848] swupdate.sh[188]: [TRACE] : EVENT [0] :  {"percent": 89, "msg":"Received 272359424B of 306017280B"}
    [  149.586302] swupdate.sh[188]: [TRACE] : EVENT [0] :  {"percent": 90, "msg":"Received 275423232B of 306017280B"}
    [  149.952442] swupdate.sh[188]: [TRACE] : EVENT [0] :  {"percent": 91, "msg":"Received 278487040B of 306017280B"}
    [  150.323668] swupdate.sh[188]: [TRACE] : EVENT [0] :  {"percent": 92, "msg":"Received 281550848B of 306017280B"}
    [  150.685916] swupdate.sh[188]: [TRACE] : EVENT [0] :  {"percent": 93, "msg":"Received 284598272B of 306017280B"}
    [  151.051569] swupdate.sh[188]: [TRACE] : EVENT [0] :  {"percent": 94, "msg":"Received 287662080B of 306017280B"}
    [  151.423196] swupdate.sh[188]: [TRACE] : EVENT [0] :  {"percent": 95, "msg":"Received 290725888B of 306017280B"}
    [  151.790666] swupdate.sh[188]: [TRACE] : EVENT [0] :  {"percent": 96, "msg":"Received 293789696B of 306017280B"}
    [  152.154247] swupdate.sh[188]: [TRACE] : EVENT [0] :  {"percent": 97, "msg":"Received 296837120B of 306017280B"}
    [  152.519352] swupdate.sh[188]: [TRACE] : EVENT [0] :  {"percent": 98, "msg":"Received 299900928B of 306017280B"}
    [  152.888926] swupdate.sh[188]: [TRACE] : EVENT [0] :  {"percent": 99, "msg":"Received 302964736B of 306017280B"}
    [  153.237844] swupdate.sh[188]: [ERROR] : SWUPDATE failed [0] ERROR bootloader/uboot.c : lock_uboot_env : 38 : Error opening U-Boot lock file /var/lock/fw_printenv.lock, No such file or directory
    [  153.240720] swupdate.sh[188]: [INFO ] : SWUPDATE running :  Installation in progress
    [  153.246001] swupdate.sh[188]: [TRACE] : EVENT [0] :  {"percent": 100, "msg":"Received 306017280B of 306017280B"}
    [  153.253320] swupdate.sh[188]: [DEBUG] : SWUPDATE running :  [channel_get_file] : Channel downloaded 306017280 bytes ~ 291 MiB.
    [  153.261742] swupdate.sh[188]: [INFO ] : SWUPDATE running :  [notify_helper] : Current root device is: mmcblk0p2
    [  153.273950] swupdate.sh[188]: [INFO ] : SWUPDATE running :  [notify_helper] : Using '/dev/mmcblk0p3' as 'roundrobin' target via 'raw' handler.
    [  190.408358] swupdate.sh[188]: [INFO ] : SWUPDATE running :  [notify_helper] : Setting U-Boot environment: ustate=1
    [  190.417974] swupdate.sh[188]: [ERROR] : SWUPDATE failed [0] ERROR bootloader/uboot.c : lock_uboot_env : 38 : Error opening U-Boot lock file /var/lock/fw_printenv.lock, No such file or directory
    [  190.423094] swupdate.sh[188]: [ERROR] : SWUPDATE failed [0] ERROR bootloader/uboot.c : bootloader_apply_list : 117 : Error opening U-Boot lock file /var/lock/fw_printenv.lock, No such file or directory
    [  190.427590] swupdate.sh[188]: [ERROR] : SWUPDATE failed [0] ERROR corelib/installer.c : update_bootloader_env : 186 : Bootloader-specific error -19 updating its environment
    [  190.430841] swupdate.sh[188]: [ERROR] : SWUPDATE failed [0] ERROR bootloader/uboot.c : lock_uboot_env : 38 : Error opening U-Boot lock file /var/lock/fw_printenv.lock, No such file or directory
    [  190.433812] swupdate.sh[188]: [ERROR] : SWUPDATE failed [1] Installation failed !
    [  190.436636] swupdate.sh[188]: [INFO ] : No SWUPDATE running :  Waiting for requests...
    [  191.422105] swupdate.sh[188]: [ERROR] : SWUPDATE failed [0] ERROR suricatta/server_hawkbit.c : server_hawkbit_error : 174 : No suitable .swu image found
    [  191.427949] swupdate.sh[188]: [ERROR] : SWUPDATE failed [0] ERROR suricatta/server_hawkbit.c : server_install_update : 1241 : Error processing update chunk named '[1] v1-v2.raw', version 2, part os
    [  191.431425] swupdate.sh[188]: [DEBUG] : SWUPDATE running :  [channel_set_options] : cURL's low download speed timeout is disabled, this is most probably not what you want. Adapted it to 300s instead.
    [  191.464962] swupdate.sh[188]: [DEBUG] : SWUPDATE running :  [suricatta_wait] : Sleeping for 30 seconds.
  • fw_setenv/fw_printenv
    # fw_setenv ustate 1
    Error opening lock file /var/lock/fw_printenv.lock
    # fw_printenv ustate
    Error opening lock file /var/lock/fw_printenv.lock

Reproduce

  • Use suzuki/fix-rebase-related-err branch in cip-sw-update-demo repository

Additional information

  • When I remounted "/" as RW and created /var/lock directory, the error which was occurred by fw_setenv/fw_printenv changed as below:
    # fw_setenv ustate 1
    Cannot parse config file '/etc/fw_env.config': No such file or directory
    Error: environment not initialized
    # fw_printenv ustate
    Cannot parse config file '/etc/fw_env.config': No such file or directory
  • In addition to the above, when I added /etc/fw_env.config, fw_setenv/fw_printenv were executed successfully.
    # fw_printenv ustate
    ustate=0
    # fw_setenv ustate 1
    # fw_printenv ustate
    ustate=1
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information