On 2019-02-26, Rick Thomas wrote: > On my Cubox-i4Pro when I run fw_printenv (from the u-boot-tools > package) it says “Warning: Bad CRC, using default environment”. If when booting, it also gives you this message, that would suggest you have no saved environment for fw_printenv to read from, as it's using the default environment. I recommend not using "saveenv" or "fw_saveenv" for reasons described below... > The “default environment” is clearly *not* the environment that u-boot > is using to boot the box. At least the “ethaddr” variable in that > environment is clearly a fake one as show here: > >> root@cube:~# fw_printenv ethaddr >> Warning: Bad CRC, using default environment >> ethaddr=00:00:11:22:33:44 > > This is definitely not the ethernet address that the box is using for dhcp. fw_printenv will only work if there's an environment saved; it doesn't read from u-boot's built-in defaults. I generally recommend to avoid using "saveenv" and "fw_saveenv", since most modern boards work with distro_bootcmd and there are various options to configure the system at boot, such as boot scripts. Having a saved environment means you're stuck with whatever environment variables were present when you last ran "saveenv", which means any bugs fixed in newer versions of u-boot will still be present, and worst case, they might even be incompatible with the version of u-boot you're running. It will also happily save auto-detected variables. Additionally, "fw_saveenv" may require you to specify the entire environment to save, rather than just values you want to change. > A couple of more data points that may shed light on this: > >> root@cube:~# cat /etc/fw_env.config >> # Configuration file for fw_(printenv/saveenv) utility. >> # Up to two entries are valid, in this case the redundant >> # environment sector is assumed present. >> # >> # XXX this configuration might miss a fifth parameter for the "Number of >> # sectors" >> >> # MTD device name Device offset Env. size Flash sector size >> /dev/mmcblk1p1 0x80000 0x2000 This looks like a bug in your configuration; it should specify the raw device rather than a partition. >> root@cube:~# cat /usr/share/doc/u-boot-tools/examples/mx6cuboxi.config >> # Configuration file for fw_(printenv/saveenv) utility. >> # Up to two entries are valid, in this case the redundant >> # environment sector is assumed present. >> # >> # XXX this configuration might miss a fifth parameter for the "Number of >> # sectors" >> >> # MTD device name Device offset Env. size Flash sector size >> /dev/mmcblk0 0x80000 0x2000 > > FWIW the micro-SD card on this box is identified as /dev/mmcblk1 — not > as either /dev/mmcblk0 or /dev/mmcblk1p1. Between versions of linux and u-boot the numbering of the devices may vary. In general, the numbering of such devices has gotten more stable over time, but it's totally plausible that device numbers may vary. > Does this represent a bug in u-boot-tools, or am I mis-interpreting > something? My guess is just your misconfiguration above, and hopefully that you have no saved environment for the tools to read from. live well, vagrant
Attachment:
signature.asc
Description: PGP signature