HH5A won't execute bootcmd without uart adapter connected

I have two HH5As; one works perfectly, and one has very strange behaviour during boot.

I've installed LEDE/OpenWrt on both, and once booted they both work fine.

However, if the "problem" router is rebooted, it will not execute run bootcmd by itself unless there is a USB->UART adapter present and the adapter is powered by USB. I've actually found that plugging a USB cable into the router's own USB port and then into the uart adapter is enough to make it boot reliably.

Scenarios:

  1. Nothing connected to uart wires -> hang at u-boot prompt
  2. USB to UART adapter connected to uart wires but not connected via USB -> hang at u-boot prompt
  3. UART adapter connected to uart wires and powered by USB (even from the router itself) -> successful boot without manual intervention

Note that the boot_sel2 wire is not connected to anything.

When there is no USB->UART adapter plugged into the serial lines and powered, the router hangs indefinitely at the u-boot prompt and will not continue booting:
VR9 #

Plugging into the uart adapter, I can reliably boot by typing run bootcmd like so:
VR9 # run bootcmd

It doesn't matter how many times I run the post-installation u-boot commands, without a powered USB->UART adapter on the uart, it won't boot without the uart adapter powered by a USB device.

VR9 # setenv bootcmd ubi part UBI\; ubi read \$(loadaddr) kernel\; bootm \$(loadaddr)
VR9 # saveenv
Saving Environment to NAND...
Erasing Nand...
Erasing at 0xa0000 -- 100% complete.
Encrypting enviroment...
Writing to Nand... done

I can only think there is some kind of floating ground issue causing this. It's not hanging in CFG04 mode, u-boot starts, it just will not execute bootcmd unless there is a uart adapter present and powered by USB.

The second HH5A I have boots every time without a uart adapter plugged in. The installation steps I used are the same for both. Soldered with the same style of wires, to the same locations, used the same cp2102 uart adapter...

Does anyone have similar behaviour with their HH5A? :confused:

Here is the u-boot env:

VR9 # printenv

bootcmd_openrg=ubi part UBI; dualimage; bootm $(openrg_start)
bootdelay=1
baudrate=115200
preboot=echo;echo Type \"run flash_nfs\" to mount root filesystem over NFS;echo
bootfile="openrg.img"
cert=-----BEGIN CERTIFICATE-----
<snip>
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
<snip>
-----END CERTIFICATE-----

mem=127M
phym=128M
ethaddr=00:E0:92:FF:AA:DD
netdev=eth0
console=ttyS0
tftppath=
loadaddr=0x80800000
rootpath=/mnt/full_fs
rootfsmtd=/dev/mtdblock2
nfsargs= setenv bootargs root=/dev/nfs rw nfsroot=$(serverip):$(rootpath)
ramargs=setenv bootargs root=/dev/ram rw
addip=setenv bootargs $(bootargs) ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname):$(netdev):on
addmisc=setenv bootargs $(bootargs) console=$(console),$(baudrate) ethaddr=$(ethaddr) phym=$(phym) mem=$(mem) panic=1 mtdparts=$(mtdparts) vpe1_load_addr=0x81f00000 vpe1_mem=1M ethwan=$(ethwan) 
flash_nfs=run nfsargs addip addmisc;bootm $(kernel_addr)
net_nfs=tftp $(loadaddr) $(tftppath)$(bootfile);run nfsargs addip addmisc;bootm
net_flash=tftp $(loadaddr) $(tftppath)$(bootfile); run flashargs addip addmisc; bootm
net_ram=tftp $(loadaddr) $(tftppath)$(bootfile); bootm
u-boot=u-boot.lq
rootfs=rootfs.img
firmware=firmware.img
fullimage=fullimage.img
totalimage=totalimage.img
load=tftp $(loadaddr) $(u-boot)
update=protect off 1:0-2;era 1:0-2;cp.b $(loadaddr) B0000000 $(filesize)
flashargs=setenv bootargs root=$(rootfsmtd) ro rootfstype=squashfs init=/etc/preinit
flash_flash=run flashargs addip addmisc; bootm $(kernel_addr)
update_nandboot=tftp $(loadaddr) $(tftppath)u-boot-nand.bin; nand erase 0 0x100000; nand write.partial $(loadaddr) 0 $(filesize); reset
ubi_init=setenv kernel_vol kernel;setenv rootfs_vol rootfs;setenv firmware_vol firmware;setenv kernel_id 0;setenv rootfs_id 1;setenv firmware_id 2;setenv rootfsname rootfs;ubi part system_sw
update_kernel=tftpboot $(loadaddr) $(tftppath)$(bootfile);upgrade $(loadaddr) $(filesize)
update_bootloader=update_uboot;update gphyfirmware
update_rootfs=tftpboot $(loadaddr) $(tftppath)$(rootfs); upgrade $(loadaddr) $(filesize)
update_firmware=tftpboot $(loadaddr) $(tftppath)$(firmware);upgrade $(loadaddr) $(filesize)
update_fullimage=tftpboot $(loadaddr) $(tftppath)$(fullimage);upgrade $(loadaddr) $(filesize)
update_totalimage=tftpboot $(loadaddr) $(tftppath)$(totalimage);upgrade $(loadaddr) $(filesize)
reset_uboot_config=nand write.partial 80400000 $(f_ubootconfig_addr) $(f_ubootconfig_size)
reset_ddr_config=nand write.partial 80400000 $(f_ddrconfig_addr) $(f_ddrconfig_size)
mtdparts=mtdparts=nand0:0x07e80000@0x100000(UBI)
mtdids=nand0=nand0
part0_begin=0x00000000
part1_begin=0x00040000
part2_begin=0x000C0000
part3_begin=0x002C0000
part4_begin=0x06C40000
part5_begin=0x07040000
part6_begin=0x07080000
total_part=7
flash_end=0x07FFFFFF
data_block0=uboot
data_block1=firmware
data_block2=kernel
data_block3=rootfs
data_block4=sysconfig
data_block5=ubootconfig
data_block6=dectconfig
total_db=7
f_uboot_addr=0x00000000
f_uboot_size=0
f_ubootconfig_addr=0xA0000
f_ubootconfig_size=0x20000
f_ubootconfig_end=0x0704FFFF
f_gphy_firmware_addr=IFX_CFG_FLASH_GPHY_FIRMWARE_IMAGE_START_ADDR
f_gphy_firmware_size=IFX_CFG_FLASH_GPHY_FIRMWARE_IMAGE_SIZE
f_gphy_firmware_end=IFX_CFG_FLASH_GPHY_FIRMWARE_IMAGE_END_ADDR
f_kernel_addr=0x000C0000
f_kernel_size=0
f_kernel_end=IFX_CFG_FLASH_KERNEL_IMAGE_END_ADDR
f_rootfs_addr=0x002C0000
f_rootfs_size=0x6980000
f_rootfs_end=IFX_CFG_FLASH_ROOTFS_IMAGE_END_ADDR
f_firmware_addr=0x00040000
f_firmware_size=0
f_fwdiag_addr=IFX_CFG_FLASH_FIRMWARE_DIAG_START_ADDR
f_fwdiag_size=IFX_CFG_FLASH_FIRMWARE_DIAG_SIZE
f_sysconfig_addr=0x06C40000
f_sysconfig_size=0x400000
f_dectconfig_addr=0x07080000
f_dectconfig_size=0x40000
f_wlanconfig_addr= IFX_CFG_FLASH_WLAN_CFG_START_ADDR
f_wlanconfig_size=IFX_CFG_FLASH_WLAN_CFG_SIZE
f_ddrconfig_addr=0x000057E8
f_ddrconfig_size=24
f_ddrconfig_end=0x000057FF
ethact=vr9 Switch
ipaddr=192.168.1.1
serverip=192.168.1.10
stdin=serial
stdout=serial
stderr=serial
ver=U-Boot 2010.06-LANTIQ-v-2.2.46 (Jul 18 2013 - 04:28:31 on tester@clean-machine)
bootcmd=ubi part UBI; ubi read $(loadaddr) kernel; bootm $(loadaddr)

Environment size: 6786/131068 bytes

Assuming this contains no useful information:
https://openwrt.org/toh/bt/homehub_v5a

Perhaps it is a hardware problem.

LP,
Jure

We would hope that users have seen their hardware page...

Perhaps, you have to (edit, then) commit the environment variables on the booatloader, or you must flash the permanent firmware, otherwise the bootloader will halt (awaiting commands).

I'll be honest, from what I understand of UBoot, that seems OK....except for perhaps a line...

setenv bootcmd run lede_boot
saveenv

It's booting, no issue with the hardware.

Perhaps, you have to (edit, then) commit the environment variables on the booatloader

I've already tried editing the u-boot env from within u-boot and running saveenv which unfortunately has not resolved the problem.

or you must flash the permanent firmware, otherwise the bootloader will halt (awaiting commands).

What do you mean by "permanent firmware" ? I have LEDE flashed to the NAND.

I followed the same steps to install LEDE on two HH5A units, and only this one has issues with u-boot.

OK, I understand.

I'm starting to agree...are you using the Ground pin as well while connecting to serial?

First impression err are you sure that the ac to dc 3pin brick is working pushing out 5V? I'm more hardware than software. Ian.

Yes, I am using uart Tx, Rx, and GND.

I'm thinking it might be some noise on the UART Tx line, causing u-boot to think I have interrupted boot.

Might be a damaged pull up or pull down resistor on the Rx. What if you connect it to ground?

1 Like

If it boots normally with the serial adaptor just hooked up and powered, but idle (no input), then maybe pulling the RX on the router (the TX line from the serial adaptor) high (3.3 volts) using a high value resistor would achieve the same thing? As I believe the serial adaptors TX pin would be 3.3v when idle.

My electronics knowledge is negligible to say the least, but I'd presume you'd either need to find a 3.3v power line on the pcb or wire up a potential divider to create 3.3v using a couple more resistors (maybe from the 5v usb) and connect to RX via a high value resistor to limit current?

I'd guess some damage was done during soldering, possibly static discharge or a damaged pull up resistor (if there is one).

My advice with this fine line PCB stuff is to do as little as possible. Adding a couple of pins to UART tx and rx looks easy, through hole level stuff. Any pull ups needed are normally integrated into the big multi pin integrated circuit. May be it is trying to boot from flash because the BIOS is configured to try flash, then floppy then hard disk. Well on a Linux pc it can be configured like that. I guess that there is a built in lump of flash ROM/RAM used as a hard disk. Like PCs there are a number of different BIOS's out there.