This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3358: Saveenv fails

Part Number: AM3358

Hi,

The customer migrated uboot2019 to his board successfully. He has removed eeprom and initialized sdram. But Saveenv failed as below.

  • Hello Nancy,

    Please, refer to this thread to fix this issue.

    Best regards,
    Kemal

  • Hi,

    The customer can save variable successfully in BBB, but failed in his custom board. Any other suggestion?

  • Can they add #define DEBUG line in the very beginning of <Processor SDK>/board-support/u-boot-<version>/include/configs/am335x_evm.h file and attach the new log right after executing saveenv command?

  • => saveenv
    Saving Environment to FAT... EXPORT table = 9ffd0aec, htab.size = 521, htab.filled = 116, size = 131068
    Unsorted: n=116
    0: 9df3b7b4 ==> ramargs => setenv bootargs console=${console} ${optargs} root=${ramroot} rootfstype=${ramrootfstype}
    1: 9df3b7f0 ==> bootdir => /boot
    2: 9df3b804 ==> ramrootfstype => ext2
    3: 9df3b82c ==> boot_prefixes => / /boot/
    4: 9df3b840 ==> scan_dev_for_efi => setenv efi_fdtfile ${fdtfile}; if test -z "${fdtfile}" -a -n "${soc}"; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootarm.efi; then echo Found EFI removable media binary efi/boot/bootarm.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing...; fi; setenv efi_fdtfile
    5: 9df3b854 ==> bootm_size => 0x10000000
    6: 9df3b868 ==> nandboot => echo Booting from nand ...; run nandargs; nand read ${fdtaddr} NAND.u-boot-spl-os; nand read ${loadaddr} NAND.kernel; bootz ${loadaddr} - ${fdtaddr}
    7: 9df3b890 ==> boot_scripts => boot.scr.uimg boot.scr
    8: 9df3b958 ==> boot_fit => 0
    9: 9df3b9f8 ==> loadbootscript => load mmc ${mmcdev} ${loadaddr} boot.scr
    10: 9df3ba20 ==> ver => U-Boot 2019.01-g7a49b7b85e-dirty (Aug 08 2019 - 16:45:51 +0800)
    11: 9df3ba48 ==> findfdt => if test $board_name = A335BONE; then setenv fdtfile am335x-bone.dtb; fi; if test $board_name = A335BNLT; then setenv fdtfile am335x-boneblack.dtb; fi; if test $board_name = A335PBGL; then setenv fdtfile am335x-pocketbeagle.dtb; fi; if test $board_name = BBBW; then setenv fdtfile am335x-boneblack-wireless.dtb; fi; if test $board_name = BBG1; then setenv fdtfile am335x-bonegreen.dtb; fi; if test $board_name = BBGW; then setenv fdtfile am335x-bonegreen-wireless.dtb; fi; if test $board_name = BBBL; then setenv fdtfile am335x-boneblue.dtb; fi; if test $board_name = BBEN; then setenv fdtfile am335x-sancloud-bbe.dtb; fi; if test $board_name = A33515BB; then setenv fdtfile am335x-evm.dtb; fi; if test $board_name = A335X_SK; then setenv fdtfile am335x-evmsk.dtb; fi; if test $board_name = A335_ICE && test $ice_mii = rmii; then setenv fdtfile am335x-icev2.dtb; fi; if test $board_name = A335_ICE && test $ice_mii = mii; then setenv fdtfile am335x-icev2-prueth.dtb; fi; if test $fdtfile = undefined; then echo 12: 9df3ba98 ==> loadramdisk => load mmc ${mmcdev} ${rdaddr} ramdisk.gz
    13: 9df3bb4c ==> netloadimage => tftp ${loadaddr} ${bootfile}
    14: 9df3bc14 ==> arch => arm
    15: 9df3bc28 ==> run_fit => bootm ${fit_loadaddr}#${fdtfile}${overlaystring}
    16: 9df3bcc8 ==> boot_syslinux_conf => extlinux/extlinux.conf
    17: 9df3bd18 ==> mmcdev => 0
    18: 9df3be44 ==> fdtcontroladdr => 9df298d8
    19: 9df3be80 ==> serial# => FCNO.0000001
    20: 9df3bed0 ==> board_name => AM3352FC
    21: 9df3bee4 ==> pxefile_addr_r => 0x80100000
    22: 9df3bf5c ==> bootcmd_dhcp => run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; if test -z "${fdtfile}" -a -n "${soc}"; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00010:UNDI:003000;setenv bootp_arch 0xa;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci;
    23: 9df3bf70 ==> bootcmd_legacy_mmc0 => setenv mmcdev 0; setenv bootpart 0:2 ; run mmcboot
    24: 9df3bfd4 ==> eth1addr => 4c:3f:d3:3b:38:cd
    25: 9df3c038 ==> ramroot => /dev/ram0 rw
    26: 9df3c04c ==> importbootenv => echo Importing environment from mmc${mmcdev} ...; env import -t ${loadaddr} ${filesize}
    27: 9df3c074 ==> scriptaddr => 0x80000000
    28: 9df3c088 ==> envboot => mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadbootscript; then run bootscript;else if run loadbootenv; then echo Loaded env from ${bootenvfile};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;fi;fi;
    29: 9df3c100 ==> boot_a_script => load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
    30: 9df3c114 ==> dfu_alt_info_ram => kernel ram 0x80200000 0x4000000;fdt ram 0x80f80000 0x80000;ramdisk ram 0x81000000 0x4000000
    31: 9df3c18c ==> ethaddr => 4c:3f:d3:3b:38:cb
    32: 9df3c1dc ==> fdt_addr_r => 0x88000000
    33: 9df3c290 ==> finduuid => part uuid mmc ${bootpart} uuid
    34: 9df3c358 ==> bootscript => echo Running bootscript from mmc${mmcdev} ...; source ${loadaddr}
    35: 9df3c380 ==> boot_fdt => try
    36: 9df3c394 ==> nandargs => setenv bootargs console=${console} ${optargs} root=${nandroot} rootfstype=${nandrootfstype}
    37: 9df3c3f8 ==> baudrate => 115200
    38: 9df3c45c ==> boot_extlinux => sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
    39: 9df3c59c ==> nandrootfstype => ubifs rootwait=1
    40: 9df3c6c8 ==> dfu_alt_info_emmc => rawemmc raw 0 3751936;boot part 1 1;rootfs part 1 2;MLO fat 1 1;MLO.raw raw 0x100 0x200;u-boot.img.raw raw 0x300 0x1000;u-env.raw raw 0x1300 0x200;spl-os-args.raw raw 0x1500 0x200;spl-os-image.raw raw 0x1700 0x6900;spl-os-args fat 1 1;spl-os-image fat 1 1;u-boot.img fat 1 1;uEnv.txt fat 1 1
    41: 9df3c718 ==> usb_boot => usb start; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_for_boot_part; fi
    42: 9df3c790 ==> bootcmd_mmc1 => setenv devnum 1; run mmc_boot
    43: 9df3c81c ==> bootcmd => if test ${boot_fit} -eq 1; then run update_to_fit; fi; run findfdt; run init_console; run envboot; run distro_bootcmd
    44: 9df3c880 ==> kernel_addr_r => 0x82000000
    45: 9df3c8d0 ==> ramboot => echo Booting from ramdisk ...; run ramargs; bootz ${loadaddr} ${rdaddr} ${fdtaddr}
    46: 9df3ca24 ==> mmcrootfstype => ext4 rootwait
    47: 9df3cad8 ==> get_overlaystring => for overlay in $overlay_files;do;setenv overlaystring ${overlaystring}'#'${overlay};done;
    48: 9df3cb00 ==> fit_loadaddr => 0x90000000
    49: 9df3cb3c ==> bootfile => zImage
    50: 9df3cb64 ==> netloadfdt => tftp ${fdtaddr} ${fdtfile}
    51: 9df3cb8c ==> mtdids => nand0=nand.0
    52: 9df3cbc8 ==> board => am335x
    53: 9df3cbf0 ==> spiargs => setenv bootargs console=${console} ${optargs} root=${spiroot} rootfstype=${spirootfstype}
    54: 9df3cc18 ==> stderr => serial@44e09000
    55: 9df3cc2c ==> bootenvfile => uEnv.txt
    56: 9df3cc40 ==> spirootfstype => jffs2
    57: 9df3cc54 ==> distro_bootcmd => for target in ${boot_targets}; do run bootcmd_${target}; done
    58: 9df3cd1c ==> fdtfile => undefined
    59: 9df3ce48 ==> netargs => setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp
    60: 9df3cefc ==> loadaddr => 0x82000000
    61: 9df3cf24 ==> boot_efi_binary => if fdt addr ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr ${fdtcontroladdr};fi;load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootarm.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi
    62: 9df3cf4c ==> usbnet_devaddr => de:ad:be:ef:00:01
    63: 9df3cfb0 ==> bootcmd_legacy_mmc1 => setenv mmcdev 1; setenv bootpart 1:2 ; run mmcboot
    64: 9df3d064 ==> rdaddr => 0x88080000
    65: 9df3d078 ==> bootdelay => 2
    66: 9df3d08c ==> dfu_alt_info_mmc => boot part 0 1;rootfs part 0 2;MLO fat 0 1;MLO.raw raw 0x100 0x200;u-boot.img.raw raw 0x300 0x1000;u-env.raw raw 0x1300 0x200;spl-os-args.raw raw 0x1500 0x200;spl-os-image.raw raw 0x1700 0x6900;spl-os-args fat 0 1;spl-os-image fat 0 1;u-boot.img fat 0 1;uEnv.txt fat 0 1
    67: 9df3d12c ==> spiimgsize => 0x362000
    68: 9df3d154 ==> rootpath => /export/rootfs
    69: 9df3d1a4 ==> loadimage => load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
    70: 9df3d1b8 ==> nandroot => ubi0:rootfs rw ubi.mtd=NAND.file-system,2048
    71: 9df3d21c ==> fdtaddr => 0x88000000
    72: 9df3d244 ==> mtdparts => mtdparts=nand.0:128k(NAND.SPL),128k(NAND.SPL.backup1),128k(NAND.SPL.backup2),128k(NAND.SPL.backup3),256k(NAND.u-boot-spl-os),1m(NAND.u-boot),128k(NAND.u-boot-env),128k(NAND.u-boot-env.backup1),8m(NAND.kernel),-(NAND.file-system)
    73: 9df3d2d0 ==> nfsopts => nolock
    74: 9df3d2f8 ==> mmc_boot => if mmc dev ${devnum}; then setenv devtype mmc; run scan_dev_for_boot_part; fi
    75: 9df3d3fc ==> stdin => serial@44e09000
    76: 9df3d410 ==> cpu => armv7
    77: 9df3d424 ==> partitions => uuid_disk=${uuid_gpt_disk};name=bootloader,start=384K,size=1792K,uuid=${uuid_gpt_bootloader};name=rootfs,start=2688K,size=-,uuid=${uuid_gpt_rootfs}
    78: 9df3d438 ==> init_console => if test $board_name = A335_ICE; then setenv console ttyO3,115200n8;else setenv console ttyO0,115200n8;fi;
    79: 9df3d474 ==> spiroot => /dev/mtdblock4 rw
    80: 9df3d488 ==> stdout => serial@44e09000
    81: 9df3d49c ==> vendor => ti
    82: 9df3d4d8 ==> efi_dtb_prefixes => / /dtb/ /dtb/current/
    83: 9df3d53c ==> loadfdt => load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}
    84: 9df3d578 ==> board_serial => FCNO.0000001
    85: 9df3d5a0 ==> ramdisk_addr_r => 0x88080000
    86: 9df3d5f0 ==> boot_targets => mmc0 legacy_mmc0 mmc1 legacy_mmc1 nand0 pxe dhcp 
    87: 9df3d6e0 ==> boot_net_usb_start => usb start
    88: 9df3d71c ==> update_to_fit => setenv loadaddr ${fit_loadaddr}; setenv bootfile ${fit_bootfile}
    89: 9df3d780 ==> board_rev => FCV1
    90: 9df3d7d0 ==> bootcmd_nand => run nandboot
    91: 9df3d7e4 ==> bootcmd_mmc0 => setenv devnum 0; run mmc_boot
    92: 9df3d7f8 ==> ice_mii => mii
    93: 9df3d8e8 ==> spisrcaddr => 0xe0000
    94: 9df3d94c ==> spibusno => 0
    95: 9df3d9b0 ==> loadfit => run args_mmc; run run_fit;
    96: 9df3da28 ==> console => ttyO0,115200n8
    97: 9df3da50 ==> dfu_alt_info_nand => SPL part 0 1;SPL.backup1 part 0 2;SPL.backup2 part 0 3;SPL.backup3 part 0 4;u-boot part 0 5;u-boot-spl-os part 0 6;kernel part 0 8;rootfs part 0 9
    98: 9df3da64 ==> soc => am33xx
    99: 9df3daf0 ==> mmcboot => mmc dev ${mmcdev}; setenv devnum ${mmcdev}; setenv devtype mmc; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadimage; then if test ${boot_fit} -eq 1; then run loadfit; else run mmcloados;fi;fi;fi;
    100: 9df3db68 ==> static_ip => ${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
    101: 9df3dbcc ==> fit_bootfile => fitImage
    102: 9df3dc08 ==> bootpart => 0:2
    103: 9df3dc44 ==> scan_dev_for_boot_part => part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done
    104: 9df3dd0c ==> spiboot => echo Booting from spi ...; run spiargs; sf probe ${spibusno}:0; sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; bootz ${loadaddr}
    105: 9df3dd34 ==> scan_dev_for_boot => echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
    106: 9df3dd5c ==> loadbootenv => fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}
    107: 9df3dd70 ==> load_efi_dtb => load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
    108: 9df3de24 ==> scan_dev_for_scripts => for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
    109: 9df3dec4 ==> boot_script_dhcp => boot.scr.uimg
    110: 9df3deec ==> mmcloados => run args_mmc; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdtaddr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;
    111: 9df3df14 ==> scan_dev_for_extlinux => if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
    112: 9df3df64 ==> netboot => echo Booting from network ...; setenv autoload no; dhcp; run netloadimage; run netloadfdt; run netargs; bootz ${loadaddr} - ${fdtaddr}
    113: 9df3dfc8 ==> bootcount => 1
    114: 9df3dff0 ==> bootcmd_pxe => run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi
    115: 9df3e004 ==> args_mmc => run finduuid;setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype}
    blk_get_devnum_by_typename: if_type=6, devnum=0: mmc@48060000.blk, 6, 0
    uclass_find_device_by_seq: 0 -1
    uclass_find_device_by_seq: 0 0
    - -1 -1 'mmc@48060000.blk'
    - not found
    mmc_blk_probe: mmc_init() failed (err=-123)
    get_dev_hwpart: No device for iface 'mmc', dev 0
    ** Bad device mmc 0 **
    Failed (1)
    Command failed, result=1

  • Can you also attach the output of these commands?

    => mmc list
    => mmc dev 0
    => mmc part
    => mmc info
    => mmc dev 1
    => mmc part
    => mmc info
    => mmc rescan
    => mmc list
    => mmc dev 0
    => mmc dev 1

  • Hi,

    Thanks for following the case.

    The customer has already solved the problem. Because the cd pin in his board is different from evm, it can be saved now. But after rebooting, uboot prompts to successfully read the saved environment variables, but the environment variables are default values instead of being saved in uEnv. He used text to view the environment variable and it seems has been successfully saved. 

  • From which device or partition the environments gets loaded are saved back to the same place. Once the environment content is saved, the same content should be read back, unless you see the *** Warning - bad CRC, using default environment message. This message indicates that the uboot.env had a bad CRC and the default U-Boot environment will be used. Please, see this thread for more details.

  • Hello Nancy,

    Please, close this thread by clicking on "This resolved my issue" button if you are done with it.

    Best regards,
    Kemal