DIY Production Programming

Conor Patrick edited this page Jan 28, 2017 · 4 revisions

This section details how to program U2F Zeros in quick succession. If you're first making a U2F Zero, you should check out the detailed steps first so you know what's going on (and it's cross platform). This "production programming" process is currently only supported on windows for two reasons:

  • The command line tools for flashing are built for Windows. The source code is provided, however, if someone wants to patch it.
  • Building using the Keil compiler from command line has licensing issues on Linux.

Prerequisites

  • Windows
  • Install everything noted from basic instructions. Use Cygwin.
  • Install extra tools from Silabs. Install the Flash Programming Utilities and the USB Reset Utility. For the Flash Programming Utilities, edit PATH environment variable to include "FlashUtilCL.exe". For me, this meant adding "C:\SiLabs\MCU\Utilities\FLASH Programming\Static Programmers\Command-Line" to my PATH.
  • You should have simplicity studio installed which comes with the Keil Compiler. Add the compiler binary "C51.exe" to be on your PATH as well. For me, I had to add "C:\SiliconLabs\SimplicityStudio\v3\developer\toolchains\keil_8051\9.53\BIN".

Usage

Check to make sure your correct attestation key pair is being used by looking at the variables defined at the top of tools/monitor.sh.

Plug in your debugger/programmer(s). Open a Cygwin terminal and navigate to ./tools and run monitor.sh [serial-number-start]. It should list the serial numbers of each programmer that is plugged in:

./monitor 0x00000000
1 - AAAAAAAAA
2 - BBBBBBBBB
3 - CCCCCCCCC

If you enter a 1, it will begin programming on the AAAAAAAAA programmer. It will take about 10-20 seconds. The U2F token will blink green/blue when it's finished via the U2F HID Wink command (or pulsate green after a disconnect).

You can enter a 1, 2, 3, etc. at any time and in parallel while the other programmers are programming to achieve parallelism. I think throughput should be maxed around 4-5 programmers assuming it takes a human 2-5 seconds on average to plug in a U2F token. Entering a 1 while programmer 1 is running will be ignored unless it's entered three times in a row.

Each consecutive programming will increment the serial number used each time so it will be unique.

Every once in a while, one of the programmers can go into a bad state and hang or even hang other programmers. If this happens, just stop the process, unplug/plug back in the programmers, and restart. Be sure to update the serial number to be different if it's important for all the serial numbers to be different.

Bad debugger/programmer

If your programmer seems like it is persistently bad, try using the Silabs USB Reset Utility on it.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.