Home | Projects | Notes > Embedded Linux > Introduction to uEnv.txt File
uEnv.txt file is nothing but a collection of various environment variables which are initialized to a number of U-boot commands that automates the command execution.
Minicom window
help
will display all the U-boot commands supported by the current version of U-boot.
Specify the command if you need to see only a specific command: help <command>
xxxxxxxxxx
871=> help
2? - alias for 'help'
3askenv - get environment variables from stdin
4base - print or set address offset
5bdinfo - print Board Info structure
6boot - boot default, i.e., run 'bootcmd'
7bootd - boot default, i.e., run 'bootcmd'
8bootefi - Boots an EFI payload from memory
9bootelf - Boot from an ELF image in memory
10bootm - boot application image from memory
11bootp - boot image via network using BOOTP/TFTP protocol
12bootvx - Boot vxWorks from an ELF image
13bootz - boot Linux zImage image from memory
14cmp - memory compare
15coninfo - print console devices and information
16cp - memory copy
17crc32 - checksum calculation
18dfu - Device Firmware Upgrade
19dhcp - boot image via network using DHCP/TFTP protocol
20dm - Driver model low level access
21echo - echo args to console
22editenv - edit environment variable
23eeprom - EEPROM sub-system
24env - environment handling commands
25exit - exit script
26ext2load- load binary file from a Ext2 filesystem
27ext2ls - list files in a directory (default /)
28ext4load- load binary file from a Ext4 filesystem
29ext4ls - list files in a directory (default /)
30ext4size- determine a file's size
31ext4write- create a file in the root directory
32false - do nothing, unsuccessfully
33fastboot- use USB Fastboot protocol
34fatinfo - print information about filesystem
35fatload - load binary file from a dos filesystem
36fatls - list files in a directory (default /)
37fatsize - determine a file's size
38fatwrite- write file into a dos filesystem
39fdt - flattened device tree utility commands
40fstype - Look up a filesystem type
41go - start application at address 'addr'
42gpio - query and control gpio pins
43gpt - GUID Partition Table
44help - print command description/usage
45i2c - I2C sub-system
46iminfo - print header information for application image
47imxtract- extract a part of a multi-image
48itest - return true/false on integer compare
49load - load binary file from a filesystem
50loadb - load binary file over serial line (kermit mode)
51loads - load S-Record file over serial line
52loadx - load binary file over serial line (xmodem mode)
53loady - load binary file over serial line (ymodem mode)
54loop - infinite loop on address range
55ls - list files in a directory (default /)
56md - memory display
57mdio - MDIO utility commands
58mii - MII utility commands
59mm - memory modify (auto-incrementing address)
60mmc - MMC sub system
61mmcinfo - display MMC info
62mw - memory write (fill)
63nfs - boot image via network using NFS protocol
64nm - memory modify (constant address)
65part - disk partition related commands
66ping - send ICMP ECHO_REQUEST to network host
67printenv- print environment variables
68pxe - commands to get and boot from pxe files
69reset - Perform RESET of the CPU
70run - run commands in an environment variable
71save - save file to a filesystem
72setenv - set environment variables
73sf - SPI flash sub-system
74showvar - print local hushshell variables
75size - determine a file's size
76sleep - delay execution for some time
77source - run script from memory
78spl - SPL configuration
79sspi - SPI utility command
80sysboot - command to get and boot from syslinux files
81test - minimal test like /bin/sh
82tftpboot- boot image via network using TFTP protocol
83true - do nothing, successfully
84ums - Use the UMS [USB Mass Storage]
85usb - USB sub-system
86usbboot - boot from USB device
87version - print monitor, compiler and linker version
Similar to Linux environment variables, U-boot also has a set of standard as well as user defined environmental variables which determine the behavior of the U-boot. This behavior can be altered by overriding or changing the environmental variable values.
Use printenv
to display all environment variables.
xxxxxxxxxx
21=> printenv soc
2soc=am33xx
Use setenv
to set the value of a specified environment. (Creates on if the environment variable is not present.)
xxxxxxxxxx
31=> setenv serverip 192.168.27.1
2=> printenv serverip
3serverip=192.168.27.1
You can also combine multiple U-boot commands delimited by ;
in one envinronment variable. (They all will run in one go!)
xxxxxxxxxx
21=> printenv bootcmd
2bootcmd=if test ${boot_fit} -eq 1; then run update_to_fit;fi;run findfdt; run init_console; run envboot; run disd
Use run
to run a command.
Create a user-defined environment variable.
xxxxxxxxxx
61=> setenv my_mmc_list 'mmc list'
2=> printenv my_mmc_list
3my_mmc_list=mmc list
4=> run my_mmc_list
5OMAP SD/MMC: 0
6OMAP SD/MMC: 1
mmc list
is a predefined U-boot command.MMC0 is the interface to
SD card. MMC1 is the interface to eMMC.
Nayak, K. (2022). Embedded Linux Step by Step Using Beaglebone Black [Video file]. Retrieved from https://www.udemy.com/course/embedded-linux-step-by-step-using-beaglebone/