Anelok: meanwhile, making development a little easier

Werner Almesberger werner at almesberger.net
Tue Jan 27 13:33:57 UTC 2015


1) The setup menu as a developer's playground

I put a number of development-related functions into the setup
menu, and I think it's a good place for such things in general.
Here is a screenshot:

http://downloads.qi-hardware.com/people/werner/anelok/tmp/sim-setup-20150127.png


On top, barely visible, is the right/left hand configuration. Then
there are:

- Identify: show the KL26's unique 80 bit ID, see below

- RF: show the CC2543 chip revision. This is a way to confirm that
  the chip is really here. It also checks whether rfkill is set.

- LED on/off and blink: for LED testing, mainly for simulator
  debugging, see below

- Reboot: perform a software-triggered system reset, see below

I also grew tired of always having to enter the unblocking code
and made the setup menu accessible from the login screen.


2) Simulator has LED and rfkill switch

The red dot in the screenshot is the simulated LED. It tracks LED
changes immediately, without having to go through the event loop.

The rfkill switch is toggled with "R". There is no visual feedback
for its state.


3) Per-device configuration database (for prototypes)

Since prototypes are expected to differ from each other, e.g., by
having different case properties or component variations, I added
a database for device properties. It is keyed by the KL26's unique
ID and currently contains the board's name and the threshold for
the capacitive sensor:

https://gitorious.org/anelok/anelok/source/fw/DEVCFG

The threshold can have some remarkably large differences. E.g., in
board #2 a value of 190 works well, while board #1, in a case with
a very thin roof (due to machining variations) is far too
trigger-happy at 190 and I had to go all the way to 500 to make it
behave.

The default choice of fw/DEVCFG can be overridden with the
environment variable ANELOK_DEVCFG, so one can use a local and
private version of it.


4) Use usbwait for DFU

The firmware update process so far was like this:

- type "make dfu" but don't press Enter yet
- unplug USB from Anelok and then plug it in again
- when the LED turns on, quickly hit Enter. You have about two
  seconds to do this.

The first improvement is that, instead of torturing the USB
receptacle, one can now reboot from the setup menu.

The second change is something I originally did for atusb, but
it's also very useful with Anelok: "make update" is like "make
dfu" but first waits for the device to enumerate. So there's no
rush to hit Enter anymore. Updating the firmware has never been
so relaxing :-)

The program that waits for enumeration is usbwait from the
ben-wpan project and has to be compiled (with make -C tools) to
make all this work.

- Werner



More information about the discussion mailing list


interactive