How to List the Environment Variables of U-Boot in Minicom in Ubuntu Linux

Beaglebone black board

In this article, we go over how to list the environment variables of U-Boot.

We can do this in the minicom software in the Ubuntu linux operating system.

U-Boot is a boot loader used in embedded devices to package the instructions, as well as environment variables, necessary to boot the device's operating system kernel.

U-Boot is a program that enables a programmer to build his/her own custom boot loader, from which any of various operating systems can be booted.

In order to do this, environment variables must be defined.

Environment variables define many things, including the baud rate that is used (e.g. 115200), the bootdir (/boot), the bootenvfile (uEnv.txt), the bootfile (zImage), and many other types of information.

Thus, environment variables are very important and it is very important to become familiar with environment variables.

The bootenvfile (uEnv.txt) is a special file that houses various environment variables that defines the booting process for the device.

We can list all of the environment variables supplied by U-Boot by opening up minicom and typing in the following.

Running this produces a list of all the environment variables supplied by U-Boot, which is shown below.

Listing U-Boot environment variables in minicom in ubuntu linux

If you ever want to look up a specific environment variable, you use 'printenv' followed by the name of the environment variable.

This is shown below.

Getting the value of an environment variable in U-Boot in minicom in ubuntu linux

Besides using the environment variables supplied by U-Boot, you can also create your own custom environment variables. And these environment variables do not only hold values, as in the key-value pairs that you see above.

Environment variables can hold a series of commands that can perform tasks as well. It's not only about defining values.

Below is an example of code in an uEnv.txt file, which is used for booting a debian operating system on a beaglebone black board.

uEnv.txt file

So you can see that there are environment variables defined that are supplied from U-Boot, as well as custom environment variables that are composed of a series of commands.

So this is how we can learn about any of the various U-Boot environment variables using minicom in ubuntu linux.

Related Resources

HTML Comment Box is loading comments...