| Both sides previous revision Previous revision Next revision | Previous revision |
| docs:techref:bootloader:uboot.config [2018/03/03 20:17] – ↷ Links adapted because of a move operation | docs:techref:bootloader:uboot.config [2024/01/01 13:03] (current) – Added content of archive.org web page yemtex |
|---|
| Das U-Boot uses a small amount of space on the flash storage usually on the same partition it is stored on to store some important configuration parameters. This can hardly be compared to NVRAM/TFFS-approach of other bootloaders. It is called the //u-boot environment//. It stores some values like the IP address of the TFTP server (on your PC) to which the the TFTP client (part of U-Boot) will try to connect, etc. | Das U-Boot uses a small amount of space on the flash storage usually on the same partition it is stored on to store some important configuration parameters. This can hardly be compared to NVRAM/TFFS-approach of other bootloaders. It is called the //u-boot environment//. It stores some values like the IP address of the TFTP server (on your PC) to which the the TFTP client (part of U-Boot) will try to connect, etc. |
| |
| You can read and write these values when you are connected to the //U-Boot console// via [[docs:hardware:port.serial|Serial Port]] and also from the CLI once you booted OpenWrt. | You can read and write these values when you are connected to the //U-Boot console// via [[docs:techref:hardware:port.serial|Serial Port]] and also from the CLI once you booted OpenWrt. |
| |
| |
| One of the huge advantages of [[docs:techref:bootloader:uboot|Das U-Boot]] is it's ability for run time configuration. This flexibility is based on being able to easily change environment variables. The environment is usually at the end of the uboot [[docs:techref:flash.layout|partition]]. The //environment variables// are set up in a board specific file, e.g. ''[[https://dev.openwrt.org/browser/trunk/package/uboot-ar71xx/files/include/configs/nbg460n.h|package/uboot-ar71xx/files/include/configs/nbg460n.h]]'' for the [[toh/zyxel/nbg460n|Zyxel NBG 460N/550N/550NH]]. | One of the huge advantages of [[docs:techref:bootloader:uboot|Das U-Boot]] is its ability for run time configuration. This flexibility is based on being able to easily change environment variables. The environment is usually at the end of the uboot [[docs:techref:flash.layout|partition]]. The //environment variables// are set up in a board specific file, e.g. ''[[https://dev.openwrt.org/browser/trunk/package/uboot-ar71xx/files/include/configs/nbg460n.h|package/uboot-ar71xx/files/include/configs/nbg460n.h]]'' for the [[toh/zyxel/nbg460n|Zyxel NBG 460N/550N/550NH]]. |
| |
| The location on the flash partition is predefined: | The location on the flash partition is predefined: |
| and copied to RAM when U-Boot starts. | and copied to RAM when U-Boot starts. |
| |
| | {{:meta:icons:tango:dialog-information.png?nolink}} | The U-Boot Environment is protected by a [[wp>Cyclic redundancy check|CRC32]] checksum. \\ See [[http://www.denx.de/wiki/view/DULG/WarningBadCRCUsingDefaultEnvironment|** Warning - bad CRC, using default environment]] | | | {{:meta:icons:tango:dialog-information.png?nolink}} | The U-Boot Environment is protected by a [[wp>Cyclic redundancy check|CRC32]] checksum. \\ See [[https://web.archive.org/web/20211024121026/http://www.denx.de/wiki/view/DULG/WarningBadCRCUsingDefaultEnvironment|Warning - bad CRC, using default environment]] \\ | |
| |
| | ++++Content of linked page 'Warning - bad CRC, using default environment'| **Question:** \\ |
| | \\ |
| | I have ported U-Boot to a custom board. It seems to boot OK, but it prints: \\ |
| | ''Warning - bad CRC, using default environment'' \\ |
| | Why? \\ |
| | \\ |
| | **Answer:** \\ |
| | \\ |
| | Most probably everything is OK. The message is printed because the flash sector or ERPROM containing the environment variables has never been initialized yet. The message will go away as soon as you save the envrionment variables using the ''saveenv'' command. ++++ |
| |
| ===== Common variables ===== | ===== Common variables ===== |
| |
| ===== Accessing U-Boot environment variables in Serial Console ===== | ===== Accessing U-Boot environment variables in Serial Console ===== |
| * [[docs:hardware:port.serial|Serial Console]] | * [[docs:techref:hardware:port.serial|Serial Console]] |
| * -> [[http://www.denx.de/wiki/view/DULG/UBoot]]\\ | * -> [[http://www.denx.de/wiki/view/DULG/UBoot]]\\ |
| * -> [[http://www.denx.de/wiki/view/DULG/UBootCommandLineInterface|5.9. U-Boot Command Line Interface]] | * -> [[http://www.denx.de/wiki/view/DULG/UBootCommandLineInterface|5.9. U-Boot Command Line Interface]] |
| |
| ===== Accessing U-Boot environment variables in OpenWrt ===== | ===== Accessing U-Boot environment variables in OpenWrt ===== |
| The relevant tools to manipulate the U-Boot environment are contained in the ''[[docs:guide-user:additional-software:opkg]]''-package ''uboot-envtools''. | The relevant tools to manipulate the U-Boot environment are contained in the ''[[docs:guide-user:additional-software:opkg]]''-package ''[[packages:pkgdata_lede17_1:uboot-envtools|uboot-envtools]]''. |
| ^ Package ^ Version ^ Depends ^ Size ^ Description ^ | ^ Package ^ Version ^ Depends ^ Size ^ Description ^ |
| | uboot-envtools | 20081215-2 | zlib | 7843 | This package includes tools to read (''fw_printenv'') and modify (''fw_setenv'') U-Boot bootloader environment. | | | uboot-envtools | 20081215-2 | zlib | 7843 | This package includes tools to read (''fw_printenv'') and modify (''fw_setenv'') U-Boot bootloader environment. | |