Cable modem SPI Flash memory have the following structure:

7 cmdlinepart partitions found on MTD device spansion
partitions[0] = {.name = U-Boot, .offset = 0x00000000,.size = 0x00020000 (128K) }
partitions[1] = {.name = env1, .offset = 0x00020000,.size = 0x00010000 (64K) }
partitions[2] = {.name = env2, .offset = 0x00030000,.size = 0x00010000 (64K) }
partitions[3] = {.name = firmware_101222c, .offset = 0x004a0000,.size = 0x002d0000 (2880K) }
partitions[4] = {.name = nvram, .offset = 0x007b0000,.size = 0x00050000 (320K) }
partitions[5] = {.name = UBFI1, .offset = 0x00040000,.size = 0x003b0000 (3776K) }
partitions[6] = {.name = UBFI2, .offset = 0x003f0000,.size = 0x003b0000 (3776K) }
Creating 7 MTD partitions on "spansion":
0x00000000-0x00020000 : "U-Boot"
0x00020000-0x00030000 : "env1"
0x00030000-0x00040000 : "env2"
0x004a0000-0x00770000 : "firmware_101222c"
0x007b0000-0x00800000 : "nvram"
0x00040000-0x003f0000 : "UBFI1"
0x003f0000-0x007a0000 : "UBFI2"

Bootloader is working, I can connect to modem via serial interface, control boot process and upload firmware. I can't connect admin interface via ip, possibly due to wrong configuration stored in nvram. Can I erase Nvram only, without touching other partitions?

?       - alias for 'help'
autoscr - run script from memory
base    - print or set address offset
bdinfo  - print Board Info structure
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootm   - boot application image from memory
bootp   - boot image via network using BootP/TFTP protocol
cmp     - memory compare
coninfo - print console devices and information
cp      - memory copy
crc32   - checksum calculation
echo    - echo args to console
erase   - erase FLASH memory
eval    - return addition/subraction
exit    - exit script
flinfo  - print FLASH memory information
go      - start application at address 'addr'
help    - print online help
iminfo  - print header information for application image
imls    - list all images found in flash
itest   - return true/false on integer compare
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loady   - load binary file over serial line (ymodem mode)
loop    - infinite loop on address range
md      - memory display
mm      - memory modify (auto-incrementing)
mtest   - simple RAM test
mw      - memory write (fill)
nm      - memory modify (constant address)
printenv- print environment variables
protect - enable or disable FLASH write protection
rarpboot- boot image via network using RARP/TFTP protocol
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv  - set environment variables
sleep   - delay execution for some time
test    - minimal test like /bin/sh
tftpboot- boot image via network using TFTP protocol
version - print monitor version

1 Answer 1


You could probably use erase with some arguments to erase only the nvram partition, but I'm not sure if U-Boot can then reinitialize nvram storage. And since nvram usually contains the boot commands, erasing everything could make your unit unbootable. Therefore I would recommend erasing only specific variables.

You can use setenv for that:

To modify the U-Boot environment you have to use the setenv command. When called wih exactly one argument, it will delete any variable of that name from U-Boot's environment, if such a variable exists. Any storage occupied for such a variable will be automatically reclaimed:

INCA-IP # printenv foo
foo=This is an example value.
INCA-IP # setenv foo
INCA-IP # printenv foo
## Error: "foo" not defined

Make sure to save the modifications with saveenv.

  • But how I can find a specific variables in nvram which are wrong and cause the web daemon to crash or not start? I don't know which from configuration settings stored in nvram cause problem.
    – Lexx Luxx
    Commented Jul 24, 2014 at 20:40
  • How do you even know nvram vars are the problem? U-Boot nvram is mostly used for boot-time config, not OS-level settings.
    – Igor Skochinsky
    Commented Jul 24, 2014 at 21:01
  • Firmware boots ok, but I can't connect to modem admin interface via, can't SSH to it either. Pinging an IP says it unreachable. This happened after I make a change to some settings and rebooted. I just guess this might be due some wrong settings stored in nvram. Since a network connection is not available - can I use U-Boot load files via the serial port? How to do this? I am on Windows. Which protocols to use, kermit or y-modem? Should I rename backup to 'nvram' first? loadb [load address] [baud rate]
    – Lexx Luxx
    Commented Jul 24, 2014 at 22:38
  • It's highly unlikely the modem settings are stored in U-Boot's nvram. Try printenv to see the variables you have.
    – Igor Skochinsky
    Commented Jul 25, 2014 at 14:26
  • Printenv here. There is few superfluous entries (bold text), that were left when I configured firmware upgrade via console port. I'm not sure if this can cause a problem. How to remove them? Normally, the variables should be like this sample.
    – Lexx Luxx
    Commented Jul 25, 2014 at 20:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.