world leader in high performance signal processing
Trace: » netconsole

Using Network Console

If you are deploying a system, which has no UART connected to it, or is not practical to connect, you can use the network console.

In U-Boot, the network console is implemented via the standard “devices” mechanism, which means that you can switch between the serial and network input/output devices by adjusting the 'stdin' and 'stdout' environment variables. To switch to the networked console, set either of these variables to nc. Input and output can be switched independently.

The environment variable ncip controls the IP address and the port of the destination host. The format is <ip_addr>:<port>. If <port> is omitted, port 6666 is used. If the environment variable does not exist, the broadcast address and port 6666 are used. If it is set to an IP address of 0 (or 0.0.0.0) then no messages are sent to the network.

Enabling NetConsole

To add NetConsole support to U-Boot, just add the following like to the board config.h file:

#define CONFIG_NETCONSOLE 1

If you want to have it used when booting a system, then you probably want to use the setting:

#define CONFIG_SYS_CONSOLE_IS_IN_ENV 1

See also the CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE setting. These are documented in the toplevel README file for more information.

Using NetConsole

U-Boot Devices

First you need to tell U-Boot who to talk to:

bfin> set ncip 192.168.0.2

Then you have to tell U-Boot to actually use the network:

bfin> set stdin nc; set stdout nc; set stderr nc

Host Machine

On the machine U-Boot is now configured to talk to, you need to setup a program to listen and transmit. Netcat tends to be a pretty common program on Linux machines and is perfect for the task. Make sure you have it installed in your host distribution first.

There is a helper script in the U-Boot source tree called netconsole. Assuming you're using the default netconsole settings, you can do:

$ ./tools/netconsole 192.168.0.15
NOTE: the interrupt signal (normally ^C) has been remapped to ^T
bfin> bdinfo
bdinfo
U-Boot      = U-Boot 1.1.6-svn1026 (ADI-2007R2-pre) (Nov 15 2007 - 13:08:49)
CPU         = bf537-0.2
Board       = bf537-stamp
VCO         = 500 MHz
CCLK        = 500 MHz
SCLK        = 100 MHz
boot_params = 0x00000000
memstart    = 0x00000000
memsize     = 0x04000000
flashstart  = 0x20000000
flashsize   = 0x00400000
flashoffset = 0x00000000
ethaddr     = 00:E0:22:FE:44:EC
ip_addr     = 192.168.0.15
baudrate    = 57600 bps
bfin> print ncip
print ncip
ncip=192.168.0.17