fw/altos
3 days agoaltoslib: Make AltosPreferencesBackend abstract. Add set/put Serializable master
Keith Packard [Thu, 28 Apr 2016 19:29:16 +0000 (12:29 -0700)]
altoslib: Make AltosPreferencesBackend abstract. Add set/put Serializable

This lets us add functionality to this directly, such as the new
serializable APIs.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 days agoaltosdroid: Add configurable frequency set
Keith Packard [Wed, 27 Apr 2016 05:40:47 +0000 (01:40 -0400)]
altosdroid: Add configurable frequency set

Signed-off-by: Keith Packard <keithp@keithp.com>
5 days agoFix key in AndroidManifest.xml.in
Keith Packard [Wed, 27 Apr 2016 05:39:01 +0000 (01:39 -0400)]
Fix key in AndroidManifest.xml.in

Signed-off-by: Keith Packard <keithp@keithp.com>
5 days agoaltosdroid: Split setup functions to separate dialog
Keith Packard [Wed, 27 Apr 2016 01:01:44 +0000 (21:01 -0400)]
altosdroid: Split setup functions to separate dialog

Remove them from the options menu, handle all preferences through
listeners.

Signed-off-by: Keith Packard <keithp@keithp.com>
6 days agoaltosdroid: Add idle mode monitoring, reboot. Start igniters
Keith Packard [Tue, 26 Apr 2016 03:12:34 +0000 (23:12 -0400)]
altosdroid: Add idle mode monitoring, reboot. Start igniters

This adds three idle mode operations -- monitor idle, reboot flight
computer and test igniters. The igniter test isn't quite wired up.

Signed-off-by: Keith Packard <keithp@keithp.com>
6 days agoaltos: Clear packet queue when starting packet master
Keith Packard [Mon, 25 Apr 2016 22:50:58 +0000 (18:50 -0400)]
altos: Clear packet queue when starting packet master

This avoids overfilling the packet buffer when
disconnected. Applications using packet mode shouldn't expect that
output be saved across master sessions.

Signed-off-by: Keith Packard <keithp@keithp.com>
6 days agoaltos/telebt-v3.0: Flip CTS/RTS pins for BT module
Keith Packard [Mon, 25 Apr 2016 22:49:45 +0000 (18:49 -0400)]
altos/telebt-v3.0: Flip CTS/RTS pins for BT module

These are wired backwards, so ask that the right pins be used, which
requires switching to software control of the pins.

Signed-off-by: Keith Packard <keithp@keithp.com>
6 days agoaltos/stm32l: Add support for software-driven HW flow control
Keith Packard [Mon, 25 Apr 2016 22:48:47 +0000 (18:48 -0400)]
altos/stm32l: Add support for software-driven HW flow control

This allows applications to request that the flow control bits be
driven from software rather than hardware, permitting more flexible
pin configuration.

Signed-off-by: Keith Packard <keithp@keithp.com>
6 days agoaltos: Use TXE instead of TC for serial on STM32l
Keith Packard [Wed, 20 Jan 2016 07:53:27 +0000 (23:53 -0800)]
altos: Use TXE instead of TC for serial on STM32l

Using TXE allows for full-speed communication, rather than waiting for
each byte to be transmitted before inserting the next into the queue.

Signed-off-by: Keith Packard <keithp@keithp.com>
6 days agoDebug bits for telebt
Keith Packard [Mon, 25 Apr 2016 15:47:45 +0000 (11:47 -0400)]
Debug bits for telebt

9 days agoaltoslib: Don't try to drag lines around until map is loaded
Keith Packard [Fri, 22 Apr 2016 23:15:51 +0000 (19:15 -0400)]
altoslib: Don't try to drag lines around until map is loaded

When the transform is null, it's hard to draw lines.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 days agoaltoslib: Report exceptions caught while opening launch sites URL
Keith Packard [Fri, 22 Apr 2016 23:15:05 +0000 (19:15 -0400)]
altoslib: Report exceptions caught while opening launch sites URL

This just dumps them to stdout, which helps debug on Linux at least.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 days agoaltoslib: Use feet per second for imperial speed
Keith Packard [Fri, 22 Apr 2016 23:00:46 +0000 (19:00 -0400)]
altoslib: Use feet per second for imperial speed

This is more useful during descent than miles per hour...

Signed-off-by: Keith Packard <keithp@keithp.com>
9 days agoaltosdroid: Run even without Bluetooth
Keith Packard [Fri, 22 Apr 2016 22:53:32 +0000 (18:53 -0400)]
altosdroid: Run even without Bluetooth

This lets us view old state information on USB-only devices, or when
the bluetooth device can't be enabled.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 days agoaltosdroid: Redraw offline map when my location changes
Keith Packard [Fri, 22 Apr 2016 22:52:42 +0000 (18:52 -0400)]
altosdroid: Redraw offline map when my location changes

Update the map view even if there isn't any current telemetry data.

Signed-off-by: Keith Packard <keithp@keithp.com>
9 days agoaltosdroid: Track device location in app, not telemetry service
Keith Packard [Fri, 22 Apr 2016 21:32:10 +0000 (17:32 -0400)]
altosdroid: Track device location in app, not telemetry service

This means we get location even if there isn't a telemetry device
connected, making it possible to walk to old device locations

Signed-off-by: Keith Packard <keithp@keithp.com>
9 days agoBump version to 1.6.3
Keith Packard [Fri, 22 Apr 2016 21:31:49 +0000 (17:31 -0400)]
Bump version to 1.6.3

Signed-off-by: Keith Packard <keithp@keithp.com>
10 days agoaltosdroid: Can only use message once
Keith Packard [Fri, 22 Apr 2016 02:37:35 +0000 (22:37 -0400)]
altosdroid: Can only use message once

And here I thought re-using the message was clever. That generates a
nice exception and crashes the program.

Signed-off-by: Keith Packard <keithp@keithp.com>
10 days agoAdd preliminary 1.6.3 release notes
Keith Packard [Fri, 22 Apr 2016 01:32:50 +0000 (21:32 -0400)]
Add preliminary 1.6.3 release notes

Signed-off-by: Keith Packard <keithp@keithp.com>
10 days agolibaltos: Fix for Mac OS X El Capitan
Keith Packard [Thu, 21 Apr 2016 00:27:47 +0000 (20:27 -0400)]
libaltos: Fix for Mac OS X El Capitan

USB enumeration for serial devices changed

Signed-off-by: Keith Packard <keithp@keithp.com>
10 days agoFix java class differing only by case
Justin Vreeland [Thu, 21 Apr 2016 12:30:10 +0000 (08:30 -0400)]
Fix java class differing only by case

OSX and Windows cannot handle files with names differing only by
case.  When these files are present in either there's a constant
unfixable change viewable in git status and git diff.

Since this code can be run and compiled on both platforms
names different only by case should be avoided.

Signed-off-by: Justin Vreeland <vreeland.justin@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
10 days agoPrepare for new Android release by updating version number
Keith Packard [Fri, 22 Apr 2016 01:11:29 +0000 (21:11 -0400)]
Prepare for new Android release by updating version number

10->11

Signed-off-by: Keith Packard <keithp@keithp.com>
10 days agoAltosDroid play store keys have moved, update configure.ac
Keith Packard [Fri, 22 Apr 2016 01:12:06 +0000 (21:12 -0400)]
AltosDroid play store keys have moved, update configure.ac

The actual build files were already updated, but the configure.ac bits
which detect that they are available were not.

Signed-off-by: Keith Packard <keithp@keithp.com>
10 days agoUpdate java library version numbers
Keith Packard [Fri, 22 Apr 2016 01:12:40 +0000 (21:12 -0400)]
Update java library version numbers

Prepare for 1.6.3 release.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 days agoaltos: avoid mixed declarations and code in ao_task.c
Keith Packard [Wed, 20 Apr 2016 03:19:59 +0000 (23:19 -0400)]
altos: avoid mixed declarations and code in ao_task.c

sdcc can't handle this.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 days agoaltoslib: switch from keySet() to keys() in altos map tiles
Keith Packard [Wed, 20 Apr 2016 03:18:46 +0000 (23:18 -0400)]
altoslib: switch from keySet() to keys() in altos map tiles

Android appears to not have the keySet() API in the same way that
regular java does, so use the alternate older keys() api instead.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 days agoaltoslib: Make AltosGPSSat implement Serializable
Keith Packard [Wed, 20 Apr 2016 03:17:50 +0000 (23:17 -0400)]
altoslib: Make AltosGPSSat implement Serializable

This is required to save state values in AltosDroid.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 days agoaltoslib: Add debugging to AltosPreferences.state() etc
Keith Packard [Wed, 20 Apr 2016 03:17:01 +0000 (23:17 -0400)]
altoslib: Add debugging to AltosPreferences.state() etc

This let me find why AltosDroid was losing the last state information
for each target.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 days agoaltosdroid: Don't set target location if lat/lon is MISSING
Keith Packard [Wed, 20 Apr 2016 03:15:26 +0000 (23:15 -0400)]
altosdroid: Don't set target location if lat/lon is MISSING

Otherwise, we get a nice pointer to some random location on the planet.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 days agoaltos/telefiretwo-v0.2: Change alarm names in comment
Keith Packard [Wed, 13 Apr 2016 13:14:33 +0000 (06:14 -0700)]
altos/telefiretwo-v0.2: Change alarm names in comment

The PCB is labeled 'A' and 'B'.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 days agoaltos/stmf0: Fix external interrupts
Keith Packard [Wed, 13 Apr 2016 13:11:44 +0000 (06:11 -0700)]
altos/stmf0: Fix external interrupts

Missing a reserved address in the registers broke everything nicely,
but the priority values were also wrong - stm32f0 exposes 8 bits per
priority, like the stm32l, but it uses only the top two bits.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 days agoAdd TeleFireTwo v0.2 project
Keith Packard [Thu, 7 Apr 2016 05:32:36 +0000 (22:32 -0700)]
Add TeleFireTwo v0.2 project

This is much like TeleFireTwo v0.1, with only one pyro channel and
added siren and strobe

Signed-off-by: Keith Packard <keithp@keithp.com>
12 days agoaltos/telelcotwo: Add idle timeout
Keith Packard [Wed, 6 Apr 2016 06:45:52 +0000 (23:45 -0700)]
altos/telelcotwo: Add idle timeout

Puts TeleLCOTwo in a low power state (drawing about 80µA) after a
timeout (default two minutes) to keep from killing the battery if the
device is left turned on.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 days agoaltos: Use simpler debounce logic for buttons
Keith Packard [Sat, 26 Dec 2015 04:46:40 +0000 (20:46 -0800)]
altos: Use simpler debounce logic for buttons

Instead of waiting for a while after the transition to decide if it
has stuck, signal the event right away and then ignore other
transitions for the debounce interval.

This seems to work just as reliably, but has the benefit of
eliminating button latency at press time.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 days agoaltos: Add ao_lco_two.c; alternate LCO interface code
Keith Packard [Fri, 25 Dec 2015 19:26:34 +0000 (11:26 -0800)]
altos: Add ao_lco_two.c; alternate LCO interface code

The LCO interface is likely to end up very device specific as the
interactions depends on the input devices. Here's a version for
TeleLCOTwo, which has two arming switches and a firing button.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 days agoaltos: Fix telefiretwo .gitignore
Keith Packard [Tue, 22 Dec 2015 05:52:31 +0000 (21:52 -0800)]
altos: Fix telefiretwo .gitignore

Was ignoring the wrong built files

Signed-off-by: Keith Packard <keithp@keithp.com>
12 days agoaltos: Add TeleLCOTwo firmware
Keith Packard [Tue, 22 Dec 2015 05:50:43 +0000 (21:50 -0800)]
altos: Add TeleLCOTwo firmware

The LCO side of a two-channel launch controller setup.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 days agoaltos: Support pad/lco boxes with fixed box numbers
Keith Packard [Tue, 22 Dec 2015 05:48:37 +0000 (21:48 -0800)]
altos: Support pad/lco boxes with fixed box numbers

This allows for a configuration without adjustable box numbers on
either end of the link, simplifying the UI.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 days agoaltos: Allow for pad boxes with different sensor configurations
Keith Packard [Tue, 22 Dec 2015 05:47:10 +0000 (21:47 -0800)]
altos: Allow for pad boxes with different sensor configurations

This allows for a pad box without a resistor from power to each
FET. That resistor is needed to detect welded relays, but in a
solid-state system, that's not a possibility.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 days agoaltos: telefiretwo-v0.1 bits
Keith Packard [Fri, 18 Dec 2015 03:54:23 +0000 (19:54 -0800)]
altos: telefiretwo-v0.1 bits

Get this board running.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 days agoaltos: Add pad support for new telefire versions
Keith Packard [Fri, 18 Dec 2015 03:30:35 +0000 (19:30 -0800)]
altos: Add pad support for new telefire versions

Makes the voltage divider values configurable, and allows for pyro
channels that don't have the resistors necessary to check for a stuck
relay.

Also supports STM32L processors with wider GPIO registers, and uses
the new ao_gpio_set/clr_bits functions to fire igniters rather than
cc1111-specific code.

Signed-off-by: Keith Packard <keithp@keithp.com>
12 days agoaltos: Support telefire products in cc1200 driver
Keith Packard [Fri, 18 Dec 2015 03:29:36 +0000 (19:29 -0800)]
altos: Support telefire products in cc1200 driver

Need to disable the pad code while testing the radio.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 weeks agoaltos/detherm: Add servo driver
Keith Packard [Wed, 13 Apr 2016 13:16:01 +0000 (06:16 -0700)]
altos/detherm: Add servo driver

This just provides commands to test the servo with.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 weeks agoaltos/detherm: Add ms5607 to detherm
Keith Packard [Wed, 6 Apr 2016 05:03:37 +0000 (22:03 -0700)]
altos/detherm: Add ms5607 to detherm

Signed-off-by: Keith Packard <keithp@keithp.com>
2 weeks agoaltos: Add easy mini plotting helper in test code
Keith Packard [Thu, 24 Dec 2015 07:15:16 +0000 (23:15 -0800)]
altos: Add easy mini plotting helper in test code

Signed-off-by: Keith Packard <keithp@keithp.com>
2 weeks agoaltos: Add ao_gpi_set/clr_bits functions
Keith Packard [Fri, 18 Dec 2015 03:27:42 +0000 (19:27 -0800)]
altos: Add ao_gpi_set/clr_bits functions

These set or clear a group of bits in a single GPIO register all together.

Signed-off-by: Keith Packard <keithp@keithp.com>
4 weeks agoaltos/stmf0: Add pwm and exti drivers
Keith Packard [Sun, 3 Apr 2016 05:41:06 +0000 (22:41 -0700)]
altos/stmf0: Add pwm and exti drivers

Signed-off-by: Keith Packard <keithp@keithp.com>
4 weeks agoaltos: Add detherm product
Keith Packard [Sun, 3 Apr 2016 05:40:23 +0000 (22:40 -0700)]
altos: Add detherm product

Signed-off-by: Keith Packard <keithp@keithp.com>
4 weeks agodoc: Note that EasyMega and TeleMega report A-D continuity
Keith Packard [Sun, 3 Apr 2016 02:44:06 +0000 (19:44 -0700)]
doc: Note that EasyMega and TeleMega report A-D continuity

Signed-off-by: Keith Packard <keithp@keithp.com>
4 weeks agoaltos/stmf0: Support HPE clock source
Keith Packard [Sun, 3 Apr 2016 02:43:32 +0000 (19:43 -0700)]
altos/stmf0: Support HPE clock source

Allows the use of crystals instead of requiring USB.

Signed-off-by: Keith Packard <keithp@keithp.com>
4 weeks agoaltos/stmf0: Add SPI driver.
Keith Packard [Sun, 3 Apr 2016 02:42:44 +0000 (19:42 -0700)]
altos/stmf0: Add SPI driver.

This also changes the DMA interface a bit so we can select for
interrupts on only the interesting channels.

Signed-off-by: Keith Packard <keithp@keithp.com>
4 weeks agoaltos: Use mini logging for detherm, just without ADC
Keith Packard [Sun, 3 Apr 2016 02:41:21 +0000 (19:41 -0700)]
altos: Use mini logging for detherm, just without ADC

Signed-off-by: Keith Packard <keithp@keithp.com>
4 weeks agoaltos: Add Detherm log format (easymini without ADC)
Keith Packard [Sun, 3 Apr 2016 02:40:19 +0000 (19:40 -0700)]
altos: Add Detherm log format (easymini without ADC)

Signed-off-by: Keith Packard <keithp@keithp.com>
4 weeks agoaltos: Allow for flight hardware without any ADC values
Keith Packard [Sun, 3 Apr 2016 02:39:07 +0000 (19:39 -0700)]
altos: Allow for flight hardware without any ADC values

Detherm has no ADC connections, so we don't need to disable the ADC
when going to landed state.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 weeks agoaltos: Add one-byte SPI output routine for LPC and STM cores
Keith Packard [Fri, 25 Mar 2016 01:25:33 +0000 (19:25 -0600)]
altos: Add one-byte SPI output routine for LPC and STM cores

This allows for SPI output at interrupt time, one byte at a time.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 weeks agoaltos/lpc: Add fast timer
Keith Packard [Fri, 25 Mar 2016 01:28:16 +0000 (19:28 -0600)]
altos/lpc: Add fast timer

This offers a faster timer callback for higher-precision operation

Signed-off-by: Keith Packard <keithp@keithp.com>
5 weeks agoaltos/stm: Allow apps to define different stack size
Keith Packard [Sat, 26 Mar 2016 22:59:26 +0000 (15:59 -0700)]
altos/stm: Allow apps to define different stack size

While 512 bytes is a reasonable size, sometimes apps don't have that
much stack space.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 weeks agoaltos/stm: Validate current task SP in interrupt by looking at PSP
Keith Packard [Sat, 26 Mar 2016 22:54:24 +0000 (15:54 -0700)]
altos/stm: Validate current task SP in interrupt by looking at PSP

We use a separate stack pointer for task code, which means we can
verify that it is in range in any interrupt handler. This adds checks
for the task stack (under #ifdef DEBUG) that run in ao_wakeup as well
as at every timer interrupt.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 weeks agoaltos/stm: Run scheduler code on interrupt stack
Keith Packard [Sat, 26 Mar 2016 22:49:59 +0000 (15:49 -0700)]
altos/stm: Run scheduler code on interrupt stack

This provides a bit more room for tasks on their stack

Signed-off-by: Keith Packard <keithp@keithp.com>
5 weeks agoaltosui,telegps: Do not allow radio calibration to be edited
Keith Packard [Tue, 22 Mar 2016 04:28:39 +0000 (22:28 -0600)]
altosui,telegps: Do not allow radio calibration to be edited

This leads to sorrow for almost everyone. If you want to edit this,
use a terminal program.

Signed-off-by: Keith Packard <keithp@keithp.com>
5 weeks agoaltosuilib: Control map debugging output with Serial.debug
Keith Packard [Sat, 26 Mar 2016 22:57:59 +0000 (15:57 -0700)]
altosuilib: Control map debugging output with Serial.debug

This uses the same debug control as the serial output to monitor map downloading

Signed-off-by: Keith Packard <keithp@keithp.com>
5 weeks agoaltoslib: use env var LAUNCH_SITES to override default URL
Keith Packard [Sat, 26 Mar 2016 22:57:21 +0000 (15:57 -0700)]
altoslib: use env var LAUNCH_SITES to override default URL

This makes it easier to debug new launch site data before uploading.

Signed-off-by: Keith Packard <keithp@keithp.com>
6 weeks agolibaltos: Fix warning in linux libaltos code
Keith Packard [Mon, 21 Mar 2016 06:11:49 +0000 (23:11 -0700)]
libaltos: Fix warning in linux libaltos code

Just returned the wrong name of the value

Signed-off-by: Keith Packard <keithp@keithp.com>
6 weeks agoaltosuilib: Note that Windows now supports Bluetooth
Keith Packard [Mon, 21 Mar 2016 05:01:07 +0000 (22:01 -0700)]
altosuilib: Note that Windows now supports Bluetooth

Signed-off-by: Keith Packard <keithp@keithp.com>
6 weeks agoaltosui: Delay between polling for igniter status in Fire Igniters
Keith Packard [Mon, 21 Mar 2016 04:54:08 +0000 (21:54 -0700)]
altosui: Delay between polling for igniter status in Fire Igniters

This gives a remote like time to report the full status instead of
sending another request before the reply has been processed.

Signed-off-by: Keith Packard <keithp@keithp.com>
6 weeks agolibaltos: Add Windows BT support. Split into separate source files.
Keith Packard [Mon, 21 Mar 2016 04:52:53 +0000 (21:52 -0700)]
libaltos: Add Windows BT support. Split into separate source files.

Add Bluetooth support to Windows. Split libaltos into separate files.

Signed-off-by: Keith Packard <keithp@keithp.com>
6 weeks agoao-bringup: Use dfu-util to install flash loader on chaoskey
Keith Packard [Fri, 18 Mar 2016 18:17:46 +0000 (11:17 -0700)]
ao-bringup: Use dfu-util to install flash loader on chaoskey

Signed-off-by: Keith Packard <keithp@keithp.com>
6 weeks agoaltos/stmf0: Construct .bin files for flash loaders
Keith Packard [Fri, 18 Mar 2016 18:16:59 +0000 (11:16 -0700)]
altos/stmf0: Construct .bin files for flash loaders

This builds a .bin file which can be used with dfu-util instead of
using openocd to load the initial flash loader.

Signed-off-by: Keith Packard <keithp@keithp.com>
6 weeks agoao-tools: Add ao-makebin
Keith Packard [Fri, 18 Mar 2016 18:15:57 +0000 (11:15 -0700)]
ao-tools: Add ao-makebin

This constructs a raw binary or DFU format file for use with dfu-util,
which can be used with a bare STM processor to load code before the
boot loader is available.

Signed-off-by: Keith Packard <keithp@keithp.com>
6 weeks agoao-tools/lib: Add ao_hex_image_cat function
Keith Packard [Fri, 18 Mar 2016 17:52:03 +0000 (10:52 -0700)]
ao-tools/lib: Add ao_hex_image_cat function

This takes two images and constructs a third containing the union of
the contents along with 0xff bytes for any area between them.

Signed-off-by: Keith Packard <keithp@keithp.com>
6 weeks agoao-tools/lib: Remove trailing whitespace from ao-elf.c
Keith Packard [Fri, 18 Mar 2016 17:51:20 +0000 (10:51 -0700)]
ao-tools/lib: Remove trailing whitespace from ao-elf.c

Signed-off-by: Keith Packard <keithp@keithp.com>
6 weeks agoao-tools/ao-dump-up: Remove spurious flight state strings
Keith Packard [Fri, 18 Mar 2016 17:50:32 +0000 (10:50 -0700)]
ao-tools/ao-dump-up: Remove spurious flight state strings

MicroPeak doesn't have flight states like this...

Signed-off-by: Keith Packard <keithp@keithp.com>
6 weeks agoChange how we detect and install java
Keith Packard [Fri, 18 Mar 2016 17:48:49 +0000 (10:48 -0700)]
Change how we detect and install java

Detect by finding 'javaw.exe' in the current path and extracting the
version from the program itself.

Install by simply opening the web browser to java.com and letting the
user install it themselves.

Signed-off-by: Keith Packard <keithp@keithp.com>
6 weeks agoaltos: Expose fast timer API from kernel/
Keith Packard [Fri, 18 Mar 2016 17:17:24 +0000 (10:17 -0700)]
altos: Expose fast timer API from kernel/

This allows multiple SoCs to provide the same driver interface

Signed-off-by: Keith Packard <keithp@keithp.com>
7 weeks agoaltos: Fixed timing of panic display LED to be readable
Bart Massey [Sun, 6 Mar 2016 01:38:19 +0000 (17:38 -0800)]
altos: Fixed timing of panic display LED to be readable

When we don't have a beeper, there's no way to signal a 'warble' for
panic. So, elide that bit.

Second, panic can't use the scheduler and timer because those may not
be running (or may have failed), and so it uses a delay loop. Add a
configurable scale value to the panic loop so that the LED blinks can
be read. For stm32f0 devices, scale that by the sysclk value to
automatically make them of reasonable length.

8 weeks agolibaltos: Add unistd.h to get defines for various syscalls
Keith Packard [Sun, 6 Mar 2016 23:05:51 +0000 (15:05 -0800)]
libaltos: Add unistd.h to get defines for various syscalls

Signed-off-by: Keith Packard <keithp@keithp.com>
8 weeks agolibaltos: jni_md.h moved to linux subdir in Java install
Keith Packard [Sun, 6 Mar 2016 23:04:23 +0000 (15:04 -0800)]
libaltos: jni_md.h moved to linux subdir in Java install

Add the linux subdir to CFLAGS to find it.

Signed-off-by: Keith Packard <keithp@keithp.com>
8 weeks agoaltos/stmf0: Fix build without second USB IN endpoint
Keith Packard [Sat, 5 Mar 2016 22:37:40 +0000 (14:37 -0800)]
altos/stmf0: Fix build without second USB IN endpoint

The code for the second IN endpoint was using the wrong ifdef.

Signed-off-by: Keith Packard <keithp@keithp.com>
8 weeks agoao-tools: Add ao-chaosread
Keith Packard [Wed, 2 Mar 2016 22:36:31 +0000 (14:36 -0800)]
ao-tools: Add ao-chaosread

This reads from the raw descriptor to help validate the hardware.

Signed-off-by: Keith Packard <keithp@keithp.com>
8 weeks agoao-bringup: Switch to v1.0 for chaoskey
Keith Packard [Wed, 2 Mar 2016 22:01:00 +0000 (14:01 -0800)]
ao-bringup: Switch to v1.0 for chaoskey

Not going to build any more v0.1 boards. Also, chaoskey now uses the
unique ID for a serial, so we don't need to provide a serial number.

Signed-off-by: Keith Packard <keithp@keithp.com>
8 weeks agoaltos: Add ChaosKey v1.0 product
Keith Packard [Wed, 2 Mar 2016 22:00:06 +0000 (14:00 -0800)]
altos: Add ChaosKey v1.0 product

Much like ChaosKey v0.1, just different SoC package and a few wiring changes.

Signed-off-by: Keith Packard <keithp@keithp.com>
8 weeks agoaltos/chaoskey: Add another USB endpoint to read raw data
Keith Packard [Wed, 2 Mar 2016 21:54:58 +0000 (13:54 -0800)]
altos/chaoskey: Add another USB endpoint to read raw data

This replaces having the single output switch based on a pin value and
allows us to box the device and still fetch raw data.

For now, this will use a special libusb2 program, ao-chaosread, to
pull bits as I haven't figure out how to make linux provide two
/dev entries for one USB device.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/chaoskey: Use SoC device ID as serial number
Keith Packard [Mon, 15 Feb 2016 23:26:00 +0000 (15:26 -0800)]
altos/chaoskey: Use SoC device ID as serial number

To make manufacturing these devices tractable, we don't want to
require a custom firmware load for each device, but we still want a
unique serial number. Fortunately, the SoC provides a 96-bit ID which
we can use.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/stmf0: Use device ID as usb serial number if requested
Keith Packard [Mon, 15 Feb 2016 23:24:35 +0000 (15:24 -0800)]
altos/stmf0: Use device ID as usb serial number if requested

This exposes the hardware device ID (which is unique per-chip) as the
USB serial number, avoiding the need to create a custom ROM image for
each device.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/chaoskey: Encode both hardware and software versions in product ID
Keith Packard [Mon, 15 Feb 2016 23:23:15 +0000 (15:23 -0800)]
altos/chaoskey: Encode both hardware and software versions in product ID

We have no other way of reporting the software version, so just encode
it in the product ID.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/stmf0: Fix location of device_id register
Keith Packard [Mon, 15 Feb 2016 22:04:04 +0000 (14:04 -0800)]
altos/stmf0: Fix location of device_id register

Copied from stm32l and never fixed.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos: Another fix for non CDC-ACM devices
Keith Packard [Tue, 9 Feb 2016 03:15:31 +0000 (19:15 -0800)]
altos: Another fix for non CDC-ACM devices

Need to set the bInterfaceNumber for the actual interface to zero when
there isn't an INT interface before it.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoClean up stmf0 adc init.
Bart Massey [Tue, 9 Feb 2016 02:55:28 +0000 (18:55 -0800)]
Clean up stmf0 adc init.

This better matches the documented cal sequence.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/stmf0: Add missing ao_gpio.c
Keith Packard [Mon, 8 Feb 2016 06:30:27 +0000 (22:30 -0800)]
altos/stmf0: Add missing ao_gpio.c

This contains the code for power managing the GPIO pins

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos: Add simple stats test to TRNG code
Keith Packard [Mon, 8 Feb 2016 06:28:34 +0000 (22:28 -0800)]
altos: Add simple stats test to TRNG code

This detects broken hardware by making sure the standard deviation in
the raw values used to compute each buffer is at least 128.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos: Delay TRNG ADC long enough for HV supply to stabilize
Keith Packard [Sun, 7 Feb 2016 23:33:42 +0000 (15:33 -0800)]
altos: Delay TRNG ADC long enough for HV supply to stabilize

Looks like it takes about 70ms for the supply to start running right,
so delay after powering it up for that long.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/chaoskey-v0.1: Add power management and change USB classes
Keith Packard [Sat, 6 Feb 2016 13:15:47 +0000 (00:15 +1100)]
altos/chaoskey-v0.1: Add power management and change USB classes

Enable power management.
Expose only a single IN endpoint.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos: Add power management to TRNG driver
Keith Packard [Sat, 6 Feb 2016 13:14:22 +0000 (00:14 +1100)]
altos: Add power management to TRNG driver

Support suspend/resume of the TRNG power supply, delaying after resume
to wait for it to stabilize.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos: Allow USB drivers to skip CDC-ACM -specific descriptors
Keith Packard [Sat, 6 Feb 2016 13:10:57 +0000 (00:10 +1100)]
altos: Allow USB drivers to skip CDC-ACM -specific descriptors

For devices not providing the standard CDC-ACM interface, let them
skip the various descriptors and interfaces to provide a more limited
set of capabilities.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/stmf0: Add suspend/resume support
Keith Packard [Sat, 6 Feb 2016 11:51:32 +0000 (22:51 +1100)]
altos/stmf0: Add suspend/resume support

Allow USB suspend to suspend USB, GPIOs and master clock.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos: Add power management APIs
Keith Packard [Sat, 6 Feb 2016 11:47:23 +0000 (22:47 +1100)]
altos: Add power management APIs

This provides sequenced suspend/resume functionality, allowing modules
to register for power management at configuration time.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos/stmf0: Allow projects to specify non-default stack size
Keith Packard [Wed, 20 Jan 2016 07:55:52 +0000 (23:55 -0800)]
altos/stmf0: Allow projects to specify non-default stack size

512 may not be suitable for everyone.

Signed-off-by: Keith Packard <keithp@keithp.com>
2 months agoaltos: remove blank line in stmf0/ao_timer.c
Keith Packard [Wed, 20 Jan 2016 07:55:32 +0000 (23:55 -0800)]
altos: remove blank line in stmf0/ao_timer.c

Signed-off-by: Keith Packard <keithp@keithp.com>
3 months agoaltos/chaoskey: Delay ADC reading for 250ms at startup
Keith Packard [Thu, 28 Jan 2016 21:58:43 +0000 (13:58 -0800)]
altos/chaoskey: Delay ADC reading for 250ms at startup

This lets the HV supply stabilize before we start sampling values.

Signed-off-by: Keith Packard <keithp@keithp.com>
3 months agoaltos/chaoskey: Add support for flipping between raw and cooked bits
Keith Packard [Thu, 28 Jan 2016 08:14:36 +0000 (00:14 -0800)]
altos/chaoskey: Add support for flipping between raw and cooked bits

Plug the 'force bootloader' thing onto the board while it's running
and it will generate raw bits instead of running them through the CRC
to whiten. Useful for validating the raw hardware.

Signed-off-by: Keith Packard <keithp@keithp.com>