All posts by Dave

Zyxel NSA310 U-Boot variables to boot Linux from a USB stick

Here’s my USB stick layout:

Partition 1 is /boot and must be ext2
Partition 2 is swap
Partition 3 is root

bootcmd=usb start; ext2load usb 0:1 0x800000 /uImage-3.5.7; bootm 0x800000; reset

This was for the rear USB port. You will need to change usb 0:1 to something else for the front port. Not sure if it’s 1:1 or 0:2.

The reset at the end is because sometimes the USB detection fails after a long timeout, and this ensures your system will keep rebooting until it successfully boots.

bootargs=root=/dev/sda3 console=ttyS0,115200 rootdelay=9 panic=4

Adjust /dev/sda3 to whatever your root partition is.

I found that rootdelay at 9 seconds is a safe time window to allow the root partition to mount. If you have a particularly slow USB stick try increasing it. No rootdelay is a bad idea. If 9 seconds isn’t enough rootdelay, it will reboot after another 4 seconds, set by the panic parameter.

To set these from a serial console, the commands are:
setenv bootcmd 'usb start; ext2load usb 0:1 0x800000 /uImage-3.5.7; bootm 0x800000; reset'
setenv bootargs 'root=/dev/sda3 console=ttyS0,115200 rootdelay=9 panic=4'

Then try booting:
boot

If booting works, great! You can type the setenv commands again and then run this command to save them to EEPROM:
saveenv

If for any reason your system environment variables get all screwed up, you can go back to defaults with:
resetenv
reset

Zyxel NSA310 stock U-Boot environment variables


__ __ _ _
| \/ | __ _ _ ____ _____| | |
| |\/| |/ _` | '__\ \ / / _ \ | |
| | | | (_| | | \ V / __/ | |
|_| |_|\__,_|_| \_/ \___|_|_|
_ _ ____ _
| | | | | __ ) ___ ___ | |_
| | | |___| _ \ / _ \ / _ \| __|
| |_| |___| |_) | (_) | (_) | |_
\___/ |____/ \___/ \___/ \__|
** MARVELL BOARD: RD-88F6281A LE

U-Boot 1.1.4 (Feb 22 2011 - 10:31:35) Marvell version: 3.4.19

U-Boot code: 00600000 -> 0067FFF0 BSS: -> 006CFEE0

Soc: 88F6281 A1 (DDR2)
CPU running @ 1200Mhz L2 running @ 400Mhz
SysClock = 400Mhz , TClock = 200Mhz

DRAM CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6
DRAM CS[0] base 0x00000000 size 256MB
DRAM Total size 256MB 16bit width
Addresses 10M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (10M - 7M): Done
NAND:128 MB
Flash: 0 kB

CPU : Marvell Feroceon (Rev 1)
Kernel address is 0xc80000.

Streaming disabled
Write allocate disabled

Module 0 is RGMII
Module 1 is TDM

USB 0: host mode
PEX 0: PCI Express Root Complex Interface
PEX interface detected Link X1
Net: egiga0, egiga1 [PRIME]
Hit any key to stop autoboot: 0
NSA310>> printenv
bootargs=console=ttyS0,115200 mtdparts=nand_mtd:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2) root=/dev/nfs rw init=/init
bootcmd=nand read.e 0x2000000 $(kernel_addr) 0xA00000; bootm 0x2000000
bootdelay=2
baudrate=115200
loads_echo=0
ethaddr=00:19:CB:00:00:00
eth1addr=00:19:CB:00:00:00
ipaddr=10.4.50.165
serverip=10.4.50.5
rootpath=/mnt/ARM_FS/
netmask=255.255.255.0
nandEcc=1bit
PRODUCT_NAME=NSA-310
FEATURE_BIT=00
CONTRY_TYPE=FF
VENDOR_NAME=ZyXEL Communications Corp.
run_diag=yes
MODEL_ID=A203
stdin=serial
stdout=serial
stderr=serial
console=console=ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x7f00000@0x100000(root)
mainlineLinux=no
CASset=min
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
ethprime=egiga1
netbsd_en=no
vxworks_en=no
bootargs_root=root=/dev/nfs rw
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;
disaMvPnp=no
ethmtu=1500
eth1mtu=1500
mvPhoneConfig=mv_phone_config=dev0:fxs,dev1:fxs
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
yuk_ethaddr=00:00:00:EE:51:81
hddPowerCtrl=no
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
enaAutoRecovery=yes
kernel_addr=0xc80000
pcieTune=no
ethact=egiga1

Environment size: 1557/131068 bytes

San Francisco Panoramas

Here’s what getting really high in San Francisco is like

View from Mount Davidson
View from Mount Davidson
View Northeast from Grand View Park
View Northeast from Grand View Park
Mount Sutro from Grand View Park
Mount Sutro from Grand View Park
Sunset District from Grand View Park
Sunset District from Grand View Park
Sunset District from Hawk Hill
Sunset District from Hawk Hill

Lezyne Mini Drive XL Charging and Battery Gauge Quirks

The Lezyne Mini Drive XL is a bright, 200 lumen, USB-rechargeable bike light that is small enough to throw in my pocket. I heard about it from a bike mechanic that I met while backpacking in Marin County. He was using it inside a clear nalgene-type bottle as a camp lantern and it was like a street lamp. I bought one as soon as I got back to civilization and it was great. Then one day I noticed that the battery indicator (constantly on; green/yellow/red/flashing red) was turning yellow minutes after a fresh charge. Weird, I thought; that’s supposed to indicate 50% or lower charge levels. I timed it from fully charged to dead and it lasted 2 hours and 40 minutes, which is 10 minutes past the manufacturer’s estimate. I carried on about my business for months, until one night I found myself far from home with a blinking-red, critical battery level. In this mode it reduces the power to save energy and ekes out half an hour of dim light. I plugged it into life support with my Anker Power Bank portable USB charger and gave it a full charge when I got back home. The next day the green battery indicator stopped coming on, instead replaced with a clear white light that I’ve never seen before because it doesn’t indicate any mode in the user manual. Although it still blinks green for charging, the ‘single button press while turned off’ action that quickly flashes the battery level no longer works unless it’s yellow or red. I’ve tried taking the battery out and pressing the power button a few times to try and reset the circuit. That didn’t change anything. I’ll post an update after I hear back from Lezyne.