Close

Of big hammers and putting them down

A project log for Terrible Cluster

5 Raspberry PI Zeros. One custom USB hub. Endless disappointment.

ajlittajlitt 10/24/2017 at 19:094 Comments

In the last update, I found that the Raspberry Pi USB device boot doesn't like waiting, and with some small changes to usbboot was able to prevent any of the nodes from timing out when powered up all at the same time.

Now there's another problem: at random, usbboot fails to send the first stage "bootcode.bin" to the Pi Zero, which causes all future transfers to that Zero to fail until it's power cycled.  I spent a couple of late nights trying to figure this out.  Is it because the ROM bootloader has some other timing constraint (not sure)?  Is there a signal integrity or power problem with my board (maybe)?  Are the hub ports going into a low power mode, angering the ROM bootloader (nope)?

The only thing I'm sure of that fixes it is a power cycle.

So in the spirit of inelegance that defines this project, I modified usbboot to cycle power on any slot that fails on a transaction involving bootcode.bin. 

And it's not that inelegant either.  Because I'm using the USB standard for in-band power control of hub ports, I can traverse up the USB tree from the current Pi's USB device that failed to find the hub.  Once I have a handle for the hub, I send a message to the hub requesting that power be turned off and on to the Pi's port.  When the Pi resets, it re-enumerates on the USB bus and is detected again by usbboot.

Discussions

davedarko wrote 10/24/2017 at 19:28 point

I didn't notice before that you don't have SD cards in the "slaves". That must save some bucks :)

  Are you sure? yes | no

ajlitt wrote 10/24/2017 at 21:23 point

I do have SD cards in the nodes, but only because Raspbian is bloated and 512MB RAM doesn't go far if you try to cram it into a ramdisk.  I could roll a minimal initramfs based distro and do away with them.

  Are you sure? yes | no

davedarko wrote 10/24/2017 at 21:46 point

Thought you were able to send an image over usb on start up at first. I need to read up a bit on your logs, I was irritated by this picture :D  https://hackaday.io/project/27142/gallery#a42ff7a5c22206ad847c0654cfd00948

  Are you sure? yes | no

ajlitt wrote 10/24/2017 at 21:53 point

Yeah, I really need a diagram of the boot process, and take better photos

  Are you sure? yes | no