fw/altos
3 days agoaltosui/telegps: Change from variable-units snuck into master master
Keith Packard [Tue, 3 Mar 2015 06:23:22 +0000 (22:23 -0800)]
altosui/telegps: Change from variable-units snuck into master

show_units_name(double) only exists on the variable-units branch...

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

3 days agoaltos: Missing pad field in TMv2 data packet
Keith Packard [Tue, 3 Mar 2015 05:16:06 +0000 (21:16 -0800)]
altos: Missing pad field in TMv2 data packet

The normal ARM padding would have filled this in correctly, but it's
best to be explicit about the structure.

This also adds a test to make sure the resulting telemetry declaration
is exactly 32 bytes,

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

3 days agoaltos: Wait for BT disconnect before sending command
Keith Packard [Tue, 3 Mar 2015 05:11:33 +0000 (21:11 -0800)]
altos: Wait for BT disconnect before sending command

If AltosDroid manages to connect to the BT module before we've
configured it, we won't be able to talk to it as we can't force the
module to ignore connection attempts. Wait for AltosDroid to give up
and let us configure the device. Eventually, we'll manage, if
AltosDroid's delay interval is longer than the time it takes to
configure the unit.

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

3 days agoao-tools: Add ao-flash-stm32f0x
Keith Packard [Tue, 3 Mar 2015 05:08:44 +0000 (21:08 -0800)]
ao-tools: Add ao-flash-stm32f0x

This new script uses openocd to flash stm32f0x parts

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

3 days agoaltoslib: Round frequency when configuring radio
Keith Packard [Tue, 3 Mar 2015 05:06:51 +0000 (21:06 -0800)]
altoslib: Round frequency when configuring radio

This makes sure we set the right frequency, instead of being off by
1kHz on a regular basis...

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

3 days agoaltosui/telegps: Add config option for APRS format
Keith Packard [Tue, 3 Mar 2015 05:06:02 +0000 (21:06 -0800)]
altosui/telegps: Add config option for APRS format

Allow configuration of APRS compressed/uncompressed

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

3 days agoaltos: Make APRS format (compressed/uncompressed) configurable
Keith Packard [Tue, 3 Mar 2015 05:02:31 +0000 (21:02 -0800)]
altos: Make APRS format (compressed/uncompressed) configurable

This provides a choice of compressed vs uncompressed when sending APRS
packets to deal with receivers that still do not have support for the
more useful compressed format.

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

6 days agoaltos/usbtrng: Split out random number generating code to separate driver
Keith Packard [Sun, 1 Mar 2015 00:06:23 +0000 (16:06 -0800)]
altos/usbtrng: Split out random number generating code to separate driver

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

6 days agoaltos: Add chaoskey flash loader
Keith Packard [Sun, 1 Mar 2015 00:04:00 +0000 (16:04 -0800)]
altos: Add chaoskey flash loader

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

6 days agoaltos: Create chaoskey product
Keith Packard [Sun, 1 Mar 2015 00:02:17 +0000 (16:02 -0800)]
altos: Create chaoskey product

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

6 days agoaltos/stmf0: Allocate USB buffers at startup
Keith Packard [Sun, 1 Mar 2015 00:00:45 +0000 (16:00 -0800)]
altos/stmf0: Allocate USB buffers at startup

This lets the extra allocations used from ao_usb_alloc_buffers be
allocated before the first USB connection happens.

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

6 days agoaltos/stmf0: Typo in ao_crc_stm.c
Keith Packard [Sun, 1 Mar 2015 00:00:17 +0000 (16:00 -0800)]
altos/stmf0: Typo in ao_crc_stm.c

Extra semicolon

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

6 days agoaltos/stmf0: Fix fast ADC interface
Keith Packard [Sat, 28 Feb 2015 23:59:30 +0000 (15:59 -0800)]
altos/stmf0: Fix fast ADC interface

This was configuring the hardware wrong, and wasn't keeping the output
ring full.

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

6 days agoaltos: Allow software to offer other USB interface classes than CDC
Keith Packard [Sat, 28 Feb 2015 23:07:16 +0000 (15:07 -0800)]
altos: Allow software to offer other USB interface classes than CDC

This lets some boards offer non-CDC class USB interfaces so that the
modem driver doesn't pick them up.

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

12 days agoMerge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
Bdale Garbee [Sun, 22 Feb 2015 21:55:40 +0000 (14:55 -0700)]
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos

12 days agoswap names so v3.0 is the default TeleDongle version to turn on
Bdale Garbee [Sun, 8 Feb 2015 16:29:01 +0000 (09:29 -0700)]
swap names so v3.0 is the default TeleDongle version to turn on

2 weeks agoaltosdroid: Ignore automatic tab changing while activity is saved
Keith Packard [Tue, 17 Feb 2015 06:22:37 +0000 (22:22 -0800)]
altosdroid: Ignore automatic tab changing while activity is saved

When the activity state is saved (after onSaveInstanceState()), we
can't update the UI until the activity is restarted or restored; that
means any UI changes we make, like switching tabs, must deal with this
by allowing those changes to be ignored, using commitAllowingStateLoss
instead of commit.

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

2 weeks agoaltosdroid: Missing file: DeviceAddress.java
Keith Packard [Tue, 17 Feb 2015 05:35:34 +0000 (21:35 -0800)]
altosdroid: Missing file: DeviceAddress.java

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

2 weeks agoaltosdroid: Only speak when GUI is running
Keith Packard [Tue, 17 Feb 2015 05:32:54 +0000 (21:32 -0800)]
altosdroid: Only speak when GUI is running

Create voice in onStart, stop it in onStop. This way, if some other
application is in use, the voice won't be annoying you.

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

2 weeks agoaltosdroid: Explicitly disconnect BT on termination or 'disconnect'
Keith Packard [Tue, 17 Feb 2015 05:19:09 +0000 (21:19 -0800)]
altosdroid: Explicitly disconnect BT on termination or 'disconnect'

This adds an explicit message to the telemetry service telling it when
to stop trying to talk to the bluetooth device. Until this message is
received, the service will reconnect to the specified BT device.

That message is sent when you 'quit' the application, or when you 'disconnect'.

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

2 weeks agoaltosdroid: Lots of bluetooth connection changes
Keith Packard [Tue, 17 Feb 2015 04:57:11 +0000 (20:57 -0800)]
altosdroid: Lots of bluetooth connection changes

Appears to more reliably abort in-progress connection attempts so you
can switch TBT devices without having the previous device in
operation.

Shows which device the connection is being attempted for.

Eliminate the 10-second timer and just disable the service when the GUI
shuts down while no BT connection is running.

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

2 weeks agoao-bringup: Changes for telebt for keith's hacking
Keith Packard [Tue, 17 Feb 2015 04:49:39 +0000 (20:49 -0800)]
ao-bringup: Changes for telebt for keith's hacking

Make the programming device auto-detect by username.
Load binary from ~/altusmetrumllc

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

2 weeks agoaltos: Remove some accidental debug printfs from ao_packet.c
Keith Packard [Sun, 15 Feb 2015 16:57:55 +0000 (08:57 -0800)]
altos: Remove some accidental debug printfs from ao_packet.c

While fixing the cc1200 configuration, I added some debug printfs to
this code. They were accidentally committed with the fix...

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

2 weeks agoaltos/cc1200: Adjust bit-sync configuration
Keith Packard [Sun, 15 Feb 2015 07:18:38 +0000 (23:18 -0800)]
altos/cc1200: Adjust bit-sync configuration

The default bit timing adjustment mechanism allows for only a 0.2%
deviation from the programmed bit timing. I found one TeleMini device
which is beyond that tolerance as it was built with an older crystal
with more error.

Switch to the more expensive synchronization mechanism which allows up
to 2% timing error, but requires a multi-byte preamble (which we
have). This fixes packet mode nicely.

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

2 weeks agoaltos: embed ao_alarm and ao_clear_alarm in ao_sleep_for
Keith Packard [Sat, 14 Feb 2015 16:35:47 +0000 (08:35 -0800)]
altos: embed ao_alarm and ao_clear_alarm in ao_sleep_for

sdcc won't embed these itself, and thus consumes too much flash for
telemetrum-v1.0

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

2 weeks agoao-bringup/turnon_telemini: Detect which programmer to use by $USER
Keith Packard [Sat, 14 Feb 2015 09:16:42 +0000 (01:16 -0800)]
ao-bringup/turnon_telemini: Detect which programmer to use by $USER

Bdale uses TD 100, keithp uses TD 186.

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

2 weeks agoaltosuilib: Detect pair programming by product name, not USB id
Keith Packard [Sat, 14 Feb 2015 09:13:21 +0000 (01:13 -0800)]
altosuilib: Detect pair programming by product name, not USB id

With TeleDongle, TeleBT and TeleMetrum coming in both pair- and self-
programmable versions, we can't use the USB id to tell them
apart. Instead, fetch the device name and use that instead.

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

2 weeks agoaltosui: Run all igniter status requests from non-GUI thread
Keith Packard [Sat, 14 Feb 2015 09:11:30 +0000 (01:11 -0800)]
altosui: Run all igniter status requests from non-GUI thread

Anything run from the UI thread blocks the UI entirely; the Fire
Igniters startup code to collect the number of pyro channels when
building the UI was doing that from the UI thread. Switch that around
so that the UI doesn't get built until that reply comes back, allowing
the user to see the 'connecting' dialog, and cancel it if required.

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

2 weeks agoaltos: Replace ao_alarm/ao_clear_alarm with ao_sleep_for
Keith Packard [Sat, 14 Feb 2015 07:51:10 +0000 (23:51 -0800)]
altos: Replace ao_alarm/ao_clear_alarm with ao_sleep_for

Having arbitrary alarms firing in the middle of complicated device
logic makes no sense at all. Therefore only correct use of ao_alarm
and ao_clear_alarm was around a specific ao_sleep call, with correct
recovery in case the alarm fires.

This patch replaces all uses of ao_alarm/ao_sleep/ao_clear_alarm with
ao_sleep_for, a new function which takes the alarm timeout directly.

A few cases which weren't simply calling ao_sleep have been reworked
to pass the timeout value down to the place where sleep *is* being
called, and having that code deal with the return correctly.

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

3 weeks agoAdded continuous output option to ao-usbtrng
Tom Marble [Wed, 11 Feb 2015 14:21:27 +0000 (08:21 -0600)]
Added continuous output option to ao-usbtrng

3 weeks agoaltos/stmf0: Add ao_crc_stm.c
Keith Packard [Mon, 9 Feb 2015 15:28:18 +0000 (07:28 -0800)]
altos/stmf0: Add ao_crc_stm.c

Tom discovered that this was missing

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

3 weeks agoMinor typo in man page
Tom Marble [Mon, 9 Feb 2015 14:35:24 +0000 (08:35 -0600)]
Minor typo in man page

3 weeks agodocument addition of TeleDongle to the set of ARM targets to save binaries for
Bdale Garbee [Sun, 8 Feb 2015 05:23:38 +0000 (22:23 -0700)]
document addition of TeleDongle to the set of ARM targets to save binaries for

3 weeks agoBump java library versions
Keith Packard [Sun, 8 Feb 2015 04:42:15 +0000 (20:42 -0800)]
Bump java library versions

Lots of minor API/ABI changes; make sure people can install both 1.5
and 1.6 at the same time.

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

3 weeks agoaltosuilib: Don't offer to graph some GPS details that TM doesn't log
Keith Packard [Sun, 8 Feb 2015 04:36:10 +0000 (20:36 -0800)]
altosuilib: Don't offer to graph some GPS details that TM doesn't log

When using a TM eeprom file, various minor GPS details are logged
(course, ground speed, climb rate, etc). Make sure these aren't
offered up for graphing.

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

3 weeks agoaltosuilib: Get the Eeprom download progress bar working again
Keith Packard [Sun, 8 Feb 2015 04:22:19 +0000 (20:22 -0800)]
altosuilib: Get the Eeprom download progress bar working again

The eeprom download code wasn't computing the start of each state
transition correctly, so the progress bar was snapping to the end of
the chunk for each state.

Invalid state values would snap the bar to the right side.

Landed state wasn't ever seen, so the bar would not ever fill.

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

3 weeks agodoc: update 1.6 release notes with recent bug fixes
Keith Packard [Sun, 8 Feb 2015 02:10:34 +0000 (18:10 -0800)]
doc: update 1.6 release notes with recent bug fixes

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

3 weeks agoaltosuilib: Set the icon and title of the telemetry scanning dialog
Keith Packard [Sun, 8 Feb 2015 01:49:39 +0000 (17:49 -0800)]
altosuilib: Set the icon and title of the telemetry scanning dialog

Just need to call 'super' to get the window configured correctly.

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

3 weeks agoaltoslib: Clear saved TelemetryReader state instead of resetting in ScanUI
Keith Packard [Sun, 8 Feb 2015 01:35:15 +0000 (17:35 -0800)]
altoslib: Clear saved TelemetryReader state instead of resetting in ScanUI

Instead of attempting to mash the saved state from AltosScanUI, just
throw it away in AltosTelemetryReader.reset. Much cleaner, and more reliable.

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

3 weeks agoaltosuilib: Reset telemetry state after processing it
Keith Packard [Sun, 8 Feb 2015 01:09:40 +0000 (17:09 -0800)]
altosuilib: Reset telemetry state after processing it

This avoids re-using stale state after switching telemetry reception
parameters around, which otherwise generates spurious entries for the
wrong frequencies in the scan results list.

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

3 weeks agoaltoslib: Drop telemetry packets processed while monitoring is disabled
Keith Packard [Sun, 8 Feb 2015 01:08:03 +0000 (17:08 -0800)]
altoslib: Drop telemetry packets processed while monitoring is disabled

A lag between the thread queuing telemetry packets and one pulling
them out can result in stale telemetry data being returned to the
reader. Fix this by dropping telemetry read while monitoring is disabled.

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

3 weeks agoaltosuilib: Wait for product data while scanning
Keith Packard [Sat, 7 Feb 2015 23:09:57 +0000 (15:09 -0800)]
altosuilib: Wait for product data while scanning

Now that Altos only sends config information once every 5 seconds, we
want to keep waiting for that if we're receiving packets successfully.

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

3 weeks agoaltoslib: Mark listener as 'not running' on EOF.
Keith Packard [Sat, 7 Feb 2015 22:43:11 +0000 (14:43 -0800)]
altoslib: Mark listener as 'not running' on EOF.

This adds a 'running' member to the AltosListenerState class, and when
the replay reader reaches EOF, marks the listener as no longer
running.

AltosUI and TeleGPS now display 'done' in the 'Age' field when this
occurs, to let the user know that the replay is over.

Also make sure that the display timers are stopped when this happens,
or when the window is closed.

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

3 weeks agoaltosui: Remove the dregs of AltosDroid load-old-telem code
Keith Packard [Sat, 7 Feb 2015 22:40:17 +0000 (14:40 -0800)]
altosui: Remove the dregs of AltosDroid load-old-telem code

AltosDroid used to scan the old .telem file to return to the previous
flight state on restart. Now it just loads the old state object
instead, a vast improvement in performance.

To do that, there were some changes in the altoslib code
required. This patch just removes those, fixing replay bugs in TeleGPS
along the way.

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

3 weeks agoaltos: ao_packet_getchar needs to return 'int' so AO_READ_AGAIN works
Keith Packard [Sat, 7 Feb 2015 21:09:18 +0000 (13:09 -0800)]
altos: ao_packet_getchar needs to return 'int' so AO_READ_AGAIN works

With ao_packet_getchar returning 'char', AO_READ_AGAIN would get
converted to 0xff instead of -1 on return, making ao_packet_echo
either produce a bogus character on output, breaking command
responses, or wedge and never exit when the link was dropped.

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

3 weeks agoUpdate version 1.6 release notes with more bug fixes
Keith Packard [Sat, 7 Feb 2015 10:37:36 +0000 (02:37 -0800)]
Update version 1.6 release notes with more bug fixes

A few bugs found during release testing are notable enough to be
included in the release notes.

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

3 weeks agoaltos: Separate out ao_tracker force from dbg
Keith Packard [Sat, 7 Feb 2015 09:30:21 +0000 (01:30 -0800)]
altos: Separate out ao_tracker force from dbg

Allow enabling telemetry when USB is connected without also enabling
the motion debugging output.

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

3 weeks agoaltos/lpc: Give up on interrupt-driven SPI driver
Keith Packard [Sat, 7 Feb 2015 09:05:57 +0000 (01:05 -0800)]
altos/lpc: Give up on interrupt-driven SPI driver

There are just too many limitations in when interrupts are delivered
to make them useful. Instead, just drive the SPI directly with the
CPU. At higher spi speeds (6Mhz or more), it's probably faster to do
it this way anyways.

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

3 weeks agoaltos/drivers: Increase SPI speed of CC115L to 6MHz
Keith Packard [Sat, 7 Feb 2015 09:05:03 +0000 (01:05 -0800)]
altos/drivers: Increase SPI speed of CC115L to 6MHz

The datasheet says that the maximum for back-to-back data is 6.5MHz.

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

3 weeks agoaltoslib: Initialize GPS data to MISSING for Monitor Idle mode
Keith Packard [Sat, 7 Feb 2015 07:50:49 +0000 (23:50 -0800)]
altoslib: Initialize GPS data to MISSING for Monitor Idle mode

Make sure any un-set values are flagged correctly for the Monitor Idle
UI by using the init() method.

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

3 weeks agoaltoslib: Use 'stateless' for Monitor Idle
Keith Packard [Sat, 7 Feb 2015 05:50:47 +0000 (21:50 -0800)]
altoslib: Use 'stateless' for Monitor Idle

This reflects the lack of flight state progression during Monitor Idle
and ensures that the GPS 'ready' indicator will light after 10 solid
GPS fixes.

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

3 weeks agoaltoslib: Support TeleGPS for Monitor Idle
Keith Packard [Sat, 7 Feb 2015 04:45:28 +0000 (20:45 -0800)]
altoslib: Support TeleGPS for Monitor Idle

TeleGPS has ADC and GPS values, so build the necessary ADC parser and
then hook up GPS parsing.

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

3 weeks agoaltosuilib: Don't show 'Sats in view' for TeleGPS eeprom graphing
Keith Packard [Sat, 7 Feb 2015 04:40:05 +0000 (20:40 -0800)]
altosuilib: Don't show 'Sats in view' for TeleGPS eeprom graphing

We don't log the visible sats from TeleGPS, only the basic GPS
info. Have AltosFlightStats track whether sat info is present, then
use that to elide the Sats In View graph entry as needed.

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

3 weeks agoaltosuilib: EEProm download from TeleGPS doesn't have states
Keith Packard [Sat, 7 Feb 2015 04:36:44 +0000 (20:36 -0800)]
altosuilib: EEProm download from TeleGPS doesn't have states

As TeleGPS doesn't have flight states, the EEProm download progress
bar shouldn't show 'state invalid', and it should use a different
scale for each block.

Fix this by having AltosConfigData know which devices have state based
on their log format, then mark the progress bar state limits as
'invalid/invalid' instead of 'boost/landed'. Then have the progress
bar use that to set a more reasonable scale for each block.

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

4 weeks agoaltoslib: Store MS5607 data in AltosConfigData for use by AltosMs5607
Keith Packard [Fri, 6 Feb 2015 12:45:17 +0000 (04:45 -0800)]
altoslib: Store MS5607 data in AltosConfigData for use by AltosMs5607

When doing 'Monitor Idle', we fetch new config data each iteration and
pass that to each of the readers, including ms5607. Instead of
re-fetching the config data there, just store the ms5607 parameters
when we fetch it the first time and copy it over.

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

4 weeks agoPackage TeleDongle-v3.0 firmware with TeleGPS and AltosUI apps
Keith Packard [Fri, 6 Feb 2015 11:36:10 +0000 (03:36 -0800)]
Package TeleDongle-v3.0 firmware with TeleGPS and AltosUI apps

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

4 weeks agoaltosuilib: New teledongle and telebt devices are not pair-programmed
Keith Packard [Fri, 6 Feb 2015 11:34:30 +0000 (03:34 -0800)]
altosuilib: New teledongle and telebt devices are not pair-programmed

Only list telebt-v1 and teledongle-v0 as pair-programmed devices so
that newer versions go through the self-programming process

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

4 weeks agomicropeak: Install Windows AltusMetrum driver bits
Keith Packard [Fri, 6 Feb 2015 11:33:28 +0000 (03:33 -0800)]
micropeak: Install Windows AltusMetrum driver bits

Make AltOS-based ĀµPUSB devices work with MicroPeak

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

4 weeks agomicropeak: Support both FTDI and Altus Metrum USB IDs
Keith Packard [Fri, 6 Feb 2015 11:32:27 +0000 (03:32 -0800)]
micropeak: Support both FTDI and Altus Metrum USB IDs

The windows driver only returns FTDI devices when
altos_ftdi_list_start is invoked, so we need to call both that and the
regular altos_list_start to get all of the devices.

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

4 weeks agomicropeak: Fix file association registry install on Windows
Keith Packard [Fri, 6 Feb 2015 11:31:07 +0000 (03:31 -0800)]
micropeak: Fix file association registry install on Windows

Need to invoke DisableX64FSRedirection before setting file association
registry entries or Windows won't find our application.

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

4 weeks agowindows: Look for current Java version in \SOFTWARE\Wow6432Node
Keith Packard [Fri, 6 Feb 2015 11:03:58 +0000 (03:03 -0800)]
windows: Look for current Java version in \SOFTWARE\Wow6432Node

I have no idea what this is, but I found the Java version down in
there...

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

4 weeks agoAdd 'keithp-fat' target for uploading temporary builds to keithp's machine
Keith Packard [Fri, 6 Feb 2015 11:03:00 +0000 (03:03 -0800)]
Add 'keithp-fat' target for uploading temporary builds to keithp's machine

This lets me quickly prepare a new test version for Windows/Mac in a
single command.

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

4 weeks agolibaltos: Use more SetupDi API to get Windows 7 listing devices
Keith Packard [Fri, 6 Feb 2015 09:29:56 +0000 (01:29 -0800)]
libaltos: Use more SetupDi API to get Windows 7 listing devices

My Windows 7 box doesn't include 'SymbolicName' in the registry, but
SetupDiGetDeviceInstanceId *does* return something that includes
vid/pid/serial, so use that in preference.

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

4 weeks agoUpdate docs for 1.6
Keith Packard [Fri, 6 Feb 2015 06:25:35 +0000 (22:25 -0800)]
Update docs for 1.6

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

4 weeks agoaltos/lpc: Double buffer USB data transfers
Keith Packard [Fri, 16 Jan 2015 09:09:26 +0000 (22:09 +1300)]
altos/lpc: Double buffer USB data transfers

This allocates twice the space in the USB memory so that transactions
can be double buffered without using separate CPU memory.

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

Conflicts:
src/lpc/ao_usb_lpc.c

4 weeks agoaltos/lpc: Clean up USB endpoint access functions
Keith Packard [Fri, 6 Feb 2015 00:08:44 +0000 (16:08 -0800)]
altos/lpc: Clean up USB endpoint access functions

The USB device endpoints can have two pointers in them, but we use
only the first. Fix the access functions to take an index as to which
we want so that we can disable the other address registers with them
instead of requiring open-coded access.

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

4 weeks agoaltos/easymini-v1.0: Shrink stack to deal with USB changes
Keith Packard [Thu, 5 Feb 2015 23:34:05 +0000 (15:34 -0800)]
altos/easymini-v1.0: Shrink stack to deal with USB changes

Reverting the USB double buffering means using more RAM, need to
shrink the EasyMini stack to accomodate that.

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

4 weeks agoaltos/teledongle-v3.0: Shrink stacks to 320 bytes to fit in ram
Keith Packard [Thu, 5 Feb 2015 23:01:03 +0000 (15:01 -0800)]
altos/teledongle-v3.0: Shrink stacks to 320 bytes to fit in ram

The old USB code had static in/out buffers in ram

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

4 weeks agoRevert LPC usb performance improvements
Keith Packard [Thu, 5 Feb 2015 22:56:13 +0000 (14:56 -0800)]
Revert LPC usb performance improvements

There's something screwy going on, sticking garbage in the input
buffer at boot time

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

4 weeks agoRevert "altos/lpc: Fix double-buffered USB changes"
Keith Packard [Thu, 5 Feb 2015 22:54:27 +0000 (14:54 -0800)]
Revert "altos/lpc: Fix double-buffered USB changes"

This reverts commit 41a0604ad1ea1a03e2db7d41731dbadf466b45db.

4 weeks agoao-bringup: Add turnon_teledonglev3
Keith Packard [Thu, 5 Feb 2015 06:55:24 +0000 (22:55 -0800)]
ao-bringup: Add turnon_teledonglev3

TeleDongle v3 uses the LPC11U14 processor which has no on-chip eeprom,
so we must reflash the device to set the default radio calibration value.

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

4 weeks agoaltos: Rename teledongle-v1.9 as teledongle-v3.0
Keith Packard [Thu, 5 Feb 2015 04:33:04 +0000 (20:33 -0800)]
altos: Rename teledongle-v1.9 as teledongle-v3.0

No hardware changes from the 1.9 prototypes to the 3.0 final version.

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

4 weeks agoaltos/telebt-v3.0: Set initial radio cal to a sensible value
Keith Packard [Thu, 5 Feb 2015 04:30:15 +0000 (20:30 -0800)]
altos/telebt-v3.0: Set initial radio cal to a sensible value

CC1200 uses a different xtal than CC1120, so the default calibration
needs to change. This value hit 434.550 on SN 2407, so it seems like a
reasonable place to start.

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

4 weeks agoaltos/telebt-v3.0: Add monitor bits
Keith Packard [Sun, 1 Feb 2015 15:57:14 +0000 (16:57 +0100)]
altos/telebt-v3.0: Add monitor bits

Will be useful to actually be able to receive telemetry

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

4 weeks agoaltos/usbtrng-v2.0: Select PA11/PA12 mapping config value
Keith Packard [Sun, 1 Feb 2015 15:46:40 +0000 (16:46 +0100)]
altos/usbtrng-v2.0: Select PA11/PA12 mapping config value

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

4 weeks agoaltos/stmf0: Support PA11/PA12 remapping
Keith Packard [Sun, 1 Feb 2015 15:44:52 +0000 (16:44 +0100)]
altos/stmf0: Support PA11/PA12 remapping

Small pin-count versions of the STMF0 can remap PA11/PA12 on the same
pins as PA9/PA10. These are used by USB, so have the USB driver deal
with remapping them.

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

4 weeks agoaltos/telebt-v3.0: Turn red LED off after initialization
Keith Packard [Sun, 1 Feb 2015 15:44:07 +0000 (16:44 +0100)]
altos/telebt-v3.0: Turn red LED off after initialization

This lets the user know the device successfully initialized.

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

4 weeks agoaltos/telebt-v3.0: Fix stdio setup for BTM
Keith Packard [Sun, 1 Feb 2015 15:43:06 +0000 (16:43 +0100)]
altos/telebt-v3.0: Fix stdio setup for BTM

Make sure the BTM module is allowed to be included in stdio, but delay
adding that until the BT link is running.

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

4 weeks agoaltos: Always include a check for stdio overflow
Keith Packard [Sun, 1 Feb 2015 15:42:01 +0000 (16:42 +0100)]
altos: Always include a check for stdio overflow

For some reason, the check for running out of space to record stdio
devices was disabled when only one device was expected.

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

4 weeks agoaltos/btm: Add fancier debug. Pull serial reset port low.
Keith Packard [Sun, 1 Feb 2015 15:39:17 +0000 (16:39 +0100)]
altos/btm: Add fancier debug. Pull serial reset port low.

Adds an interactive debugging mode to help diagnose BTM issues.

Discovered that the serial reset pin on the BTM needs to be pulled low
for the device to work correctly.

Leave the bt link interrupt disabled until things are initialized.

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

4 weeks agoaltos/stm: Add ability to delay STDIO usage for serial ports
Keith Packard [Sun, 1 Feb 2015 15:36:51 +0000 (16:36 +0100)]
altos/stm: Add ability to delay STDIO usage for serial ports

Bluetooth needs to delay adding the serial port to stdio until the
link is up and running. The cc1111 serial driver had
DELAY_SERIAL_*_STDIN bits which have been added to the STM serial driver.

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

5 weeks agoAnd, also add the TeleBT v3.0 flash loader Makefile
Keith Packard [Fri, 30 Jan 2015 13:04:50 +0000 (14:04 +0100)]
And, also add the TeleBT v3.0 flash loader Makefile

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

5 weeks agoOops, forgot the TeleBT-v3.0 Makefile
Keith Packard [Fri, 30 Jan 2015 13:03:55 +0000 (14:03 +0100)]
Oops, forgot the TeleBT-v3.0 Makefile

git doesn't warn about files named 'Makefile' because they're supposed
to be generated...

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

5 weeks agoaltos/stmf0: Re-implement fast ADC code for stmf0
Keith Packard [Wed, 28 Jan 2015 04:41:15 +0000 (20:41 -0800)]
altos/stmf0: Re-implement fast ADC code for stmf0

This creates a ring buffer for ADC data so that ADC fetching can run
in parallel with other activities.

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

5 weeks agoaltos/usbtrng-v2.0: Use stmf042 hardware CRC unit
Keith Packard [Wed, 28 Jan 2015 01:18:42 +0000 (17:18 -0800)]
altos/usbtrng-v2.0: Use stmf042 hardware CRC unit

Switch from software to hardware for CRC computation. I think this
must be faster, right?

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

5 weeks agoaltos/stmf0: Add CRC driver
Keith Packard [Wed, 28 Jan 2015 00:55:27 +0000 (16:55 -0800)]
altos/stmf0: Add CRC driver

Sets up the stm32f0 CRC hardware, exposing inline functions to access
it. DMA access is possible, but usbtrng can't use that.

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

5 weeks agoaltos/stmf0: Remove remaining stm32l bits from stm32f0 code
Keith Packard [Tue, 27 Jan 2015 17:36:19 +0000 (09:36 -0800)]
altos/stmf0: Remove remaining stm32l bits from stm32f0 code

These were left over from the stm32f0 initial implementation work; now
it's more useful to list only the bits which are valid.

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

5 weeks agoao-tools: Add ao-usbtrng to dump RNG data for testing
Keith Packard [Tue, 27 Jan 2015 06:23:19 +0000 (22:23 -0800)]
ao-tools: Add ao-usbtrng to dump RNG data for testing

ao-usbtrng reads a specified number of kilobytes of random data from
a random number generator.

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

5 weeks agoaltos/stm: Fix typo in stm32l.h
Keith Packard [Tue, 27 Jan 2015 06:22:00 +0000 (22:22 -0800)]
altos/stm: Fix typo in stm32l.h

This crept in while working on the stmf0 bits. oops.

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

5 weeks agoaltos/usbtrng-v2.0: Add random output command
Keith Packard [Tue, 27 Jan 2015 06:16:18 +0000 (22:16 -0800)]
altos/usbtrng-v2.0: Add random output command

Read chunks of random ADC data, do some CRC16 computations to de-bias
and merge 4 bytes of input data into 2 bytes of output data, then dump
that out over USB.

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

5 weeks agoaltos/stmf0: Add ADC and DMA APIs
Keith Packard [Tue, 27 Jan 2015 06:14:57 +0000 (22:14 -0800)]
altos/stmf0: Add ADC and DMA APIs

The ADC api is what USBtrng wants; a way to repeatedly read a single
ADC input as fast as possible.

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

5 weeks agoaltos/stmf0: Add faster USB path
Keith Packard [Tue, 27 Jan 2015 06:12:40 +0000 (22:12 -0800)]
altos/stmf0: Add faster USB path

This adds a way to allocate private USB buffers for sending data
without needing to copy it again. It requires ensuring that all
accesses are 16 bits aligned to 16 bit boundaries.

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

5 weeks agoaltos/stmf0: Fix linker scripts to make ao_boot work
Keith Packard [Tue, 27 Jan 2015 06:10:47 +0000 (22:10 -0800)]
altos/stmf0: Fix linker scripts to make ao_boot work

The flash loader ended up assuming ao_boot was at the start of ram,
while the application stuck it after the interrupt table (where it
needs to go).

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

5 weeks agoao-tools: Add --wait option to ao-usbload
Keith Packard [Mon, 26 Jan 2015 03:58:38 +0000 (19:58 -0800)]
ao-tools: Add --wait option to ao-usbload

This waits forever for USB writes to complete, instead of timing out
after five seconds. Useful when debugging the device.

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

5 weeks agoaltos: Add flash-loader to usbtrng-v2.0
Keith Packard [Mon, 26 Jan 2015 03:37:05 +0000 (19:37 -0800)]
altos: Add flash-loader to usbtrng-v2.0

Uses the new STM32F042 flash loading bits.

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

5 weeks agoaltos: Add self-flash support for STM32F042 processor
Keith Packard [Mon, 26 Jan 2015 03:35:19 +0000 (19:35 -0800)]
altos: Add self-flash support for STM32F042 processor

Also moves the usual address for applications out of the way of the
flash loader.

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

5 weeks agoaltos: USBtrng v2.0 hardware bringup
Keith Packard [Mon, 26 Jan 2015 00:43:48 +0000 (16:43 -0800)]
altos: USBtrng v2.0 hardware bringup

Gets the USB connection running and blinks the LEDs.

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

5 weeks agoaltos: Initial STMF04x support
Keith Packard [Mon, 26 Jan 2015 00:42:39 +0000 (16:42 -0800)]
altos: Initial STMF04x support

Basic clock configuration, OS support, LED and USB drivers.

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

5 weeks agoaltos: Add support for TeleBT v3.0
Keith Packard [Sat, 24 Jan 2015 19:18:59 +0000 (11:18 -0800)]
altos: Add support for TeleBT v3.0

Add support to the BTM driver for non-CC1111 interrupts
Add HW flow control to STM serial driver

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

6 weeks agoaltos/lpc: Fix double-buffered USB changes
Keith Packard [Fri, 23 Jan 2015 05:31:45 +0000 (21:31 -0800)]
altos/lpc: Fix double-buffered USB changes

These got merged when we were down in Auckland, but before they'd been
finished. Transmitting worked fine, but receiving was mis-configuring
the OUT buffer size in the hardware.

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