fw/altos
2 years agomove from Debian packaged sdcc to new cc1111 package forked from 2.9.0-5 megametrum-test
Bdale Garbee [Mon, 11 Jun 2012 02:04:24 +0000 (20:04 -0600)]
move from Debian packaged sdcc to new cc1111 package forked from 2.9.0-5

2 years agoaltos: Intgrate hmc5883 sensor into adc ring
Keith Packard [Sun, 3 Jun 2012 00:09:00 +0000 (17:09 -0700)]
altos: Intgrate hmc5883 sensor into adc ring

Creates a task to poll the mag sensor and place the data into the
sensor data ring.

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

2 years agoaltos: Get HMC5883 driver limping along
Keith Packard [Sat, 2 Jun 2012 23:57:22 +0000 (16:57 -0700)]
altos: Get HMC5883 driver limping along

Not pushing data into the ring yet, but the chip appears to work now.

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

2 years agoaltos: Reset i2c controller at boot time
Keith Packard [Sat, 2 Jun 2012 23:56:41 +0000 (16:56 -0700)]
altos: Reset i2c controller at boot time

In case it's wedged.

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

2 years agoaltos: Fix broken EXTI edge mode selections. Clear pending exti on enable
Keith Packard [Sat, 2 Jun 2012 23:54:42 +0000 (16:54 -0700)]
altos: Fix broken EXTI edge mode selections. Clear pending exti on enable

Make sure the edge mode registers are set according to the requested
mode.

Clear any pending interrupt when enabling to avoid spurious isr call

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

2 years agoaltos: Route correct GPIO line to interrupt controller
Keith Packard [Sat, 2 Jun 2012 23:53:46 +0000 (16:53 -0700)]
altos: Route correct GPIO line to interrupt controller

Which GPIO a particular pin interrupt comes from is selected by the
SYSCFG EXTICR registers; set these when an exti interrupt is configured.

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

2 years agoaltos: Enable some debugging during flight mode on MM
Keith Packard [Sat, 2 Jun 2012 21:58:00 +0000 (14:58 -0700)]
altos: Enable some debugging during flight mode on MM

Until we've got the radio working, there's no way to see inside the MM
state without using USB. Add a diagnostic command to dump out the
internal flight state variables.

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

2 years agoaltos: Add support for MegaAccel daughter card.
Keith Packard [Sat, 2 Jun 2012 06:07:38 +0000 (23:07 -0700)]
altos: Add support for MegaAccel daughter card.

Switches all acceleration computation to using the MegaAccel
accelerometer to ensure support for high-g flights.

MPU6000 values continue to be logged as normal

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

2 years agoaltosui: Quick hacks to download megametrum data and convert to CSV
Keith Packard [Sat, 2 Jun 2012 02:51:25 +0000 (19:51 -0700)]
altosui: Quick hacks to download megametrum data and convert to CSV

Very little useful data crunching is done, but at least we can save
and convert files

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

2 years agoaltos: Timers clock base depends on perhipheral bus prescalers too
Keith Packard [Sat, 2 Jun 2012 02:35:33 +0000 (19:35 -0700)]
altos: Timers clock base depends on perhipheral bus prescalers too

For some weird reason, a non-unity perhipheral bus clock scaler
affects the base of the various timers; this left the 100Hz tick
running at 200Hz.

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

2 years agoaltos: megametrum has logging
Keith Packard [Sat, 2 Jun 2012 02:35:01 +0000 (19:35 -0700)]
altos: megametrum has logging

This makes sure the various other subsystems know about it, like the
'v' command.

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

2 years agoaltos: add high-z accel and mag sensor to megametrum logging
Keith Packard [Sat, 2 Jun 2012 02:34:17 +0000 (19:34 -0700)]
altos: add high-z accel and mag sensor to megametrum logging

These nicely fill the 32-byte sensor log record

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

2 years agoaltos: Mark full and mega logging correctly in 'v' command
Keith Packard [Sat, 2 Jun 2012 02:33:18 +0000 (19:33 -0700)]
altos: Mark full and mega logging correctly in 'v' command

Make sure megametrum reports 'log format 5'.

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

2 years agoBump to 1.0.9.5 1.0.9.5
Keith Packard [Mon, 28 May 2012 17:48:04 +0000 (11:48 -0600)]
Bump to 1.0.9.5

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

2 years agoaltos: Clear stm i2c transfer timeout alarm
Keith Packard [Mon, 28 May 2012 17:47:28 +0000 (11:47 -0600)]
altos: Clear stm i2c transfer timeout alarm

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

2 years agoaltos: Remove debug printf from accel auto-cal
Keith Packard [Mon, 28 May 2012 17:46:51 +0000 (11:46 -0600)]
altos: Remove debug printf from accel auto-cal

Otherwise, this goes way too slow

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

2 years agoaltos: Clean up ADC selection for cc1111
Keith Packard [Mon, 28 May 2012 17:45:53 +0000 (11:45 -0600)]
altos: Clean up ADC selection for cc1111

Depend directly on product defines instead of trying to guess

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

2 years agoaltos: All cc1111 products have a radio
Keith Packard [Mon, 28 May 2012 17:45:30 +0000 (11:45 -0600)]
altos: All cc1111 products have a radio

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

2 years agoaltos: Shrink telemetry generation code
Keith Packard [Mon, 28 May 2012 17:44:45 +0000 (11:44 -0600)]
altos: Shrink telemetry generation code

otherwise TM doesn't build anymore

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

2 years agoaltos: Try to get hmc5883 working
Keith Packard [Mon, 28 May 2012 17:44:07 +0000 (11:44 -0600)]
altos: Try to get hmc5883 working

No joy yet

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

2 years agoaltos: Make teleterra v0.2 compile with new ao_data struct
Keith Packard [Mon, 28 May 2012 00:23:39 +0000 (18:23 -0600)]
altos: Make teleterra v0.2 compile with new ao_data struct

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

2 years agoaltos: Make telepyro-v0.1 build with new ao_data struct
Keith Packard [Sun, 27 May 2012 23:45:09 +0000 (17:45 -0600)]
altos: Make telepyro-v0.1 build with new ao_data struct

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

2 years agoaltos: Make telescience-v0.1 build with new ao_data struct
Keith Packard [Sun, 27 May 2012 23:44:01 +0000 (17:44 -0600)]
altos: Make telescience-v0.1 build with new ao_data struct

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

2 years agoaltos: Make telenano build with new ao_data structure
Keith Packard [Sun, 27 May 2012 23:31:12 +0000 (17:31 -0600)]
altos: Make telenano build with new ao_data structure

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

2 years agoaltos: Make stm-demo compile with new ao_data structure
Keith Packard [Sun, 27 May 2012 23:29:27 +0000 (17:29 -0600)]
altos: Make stm-demo compile with new ao_data structure

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

2 years agoaltos: Make telemini-v1.0 compile with new ao_data structure
Keith Packard [Sun, 27 May 2012 23:26:43 +0000 (17:26 -0600)]
altos: Make telemini-v1.0 compile with new ao_data structure

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

2 years agoaltos: Make telemetrum-v1.0 build with new ao_data structure
Keith Packard [Sun, 27 May 2012 23:25:17 +0000 (17:25 -0600)]
altos: Make telemetrum-v1.0 build with new ao_data structure

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

2 years agoaltos: Make telemetrum-v1.1 compile with new ao_data structure
Keith Packard [Sun, 27 May 2012 23:24:09 +0000 (17:24 -0600)]
altos: Make telemetrum-v1.1 compile with new ao_data structure

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

2 years agoignore pa to altitude conversion file
Keith Packard [Sun, 27 May 2012 22:52:45 +0000 (16:52 -0600)]
ignore pa to altitude conversion file

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

2 years agoaltos: Split out mm-specific versions of sampling code
Keith Packard [Sun, 27 May 2012 22:47:30 +0000 (16:47 -0600)]
altos: Split out mm-specific versions of sampling code

Avoid breaking telemetrum (too much) by splitting this stuff apart.

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

2 years agoaltos: Don't start ADC ring until the other sensors have a valid value
Keith Packard [Sun, 27 May 2012 22:46:00 +0000 (16:46 -0600)]
altos: Don't start ADC ring until the other sensors have a valid value

Yes, this is still an ugly kludge, but it's easy.

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

2 years agoaltos: Data packet tick count does not live in adc structure
Keith Packard [Sun, 27 May 2012 22:44:38 +0000 (16:44 -0600)]
altos: Data packet tick count does not live in adc structure

It was moved to the global structure. Having two is confusing.

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

2 years agoGet megametrum ready to at least log flight data
Keith Packard [Sat, 26 May 2012 05:18:06 +0000 (23:18 -0600)]
Get megametrum ready to at least log flight data

Doesn't track flight state changes correctly.

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

2 years agoaltos: Poll mpu6000 values every tick and stash them locally.
Keith Packard [Sat, 19 May 2012 04:23:47 +0000 (21:23 -0700)]
altos: Poll mpu6000 values every tick and stash them locally.

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

2 years agoaltos: Finish ms5607 support
Keith Packard [Sat, 19 May 2012 03:16:35 +0000 (20:16 -0700)]
altos: Finish ms5607 support

This has the MS5607 polling once each tick for pressure and
temperature and then saving that in a global variable. The command UI
provides for dumping the prom data so that an eeprom file can have
raw sensor data along with the conversion factors necessary to compute
useful values.

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

2 years agoaltos: Add conversion between Pa and meters
Keith Packard [Sat, 19 May 2012 03:04:57 +0000 (20:04 -0700)]
altos: Add conversion between Pa and meters

To be used with the MS5607 which generates data in calibrated units.

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

2 years agoaltos: Check MS5607 CRC. Clean up MS5607 API
Keith Packard [Tue, 8 May 2012 06:14:57 +0000 (23:14 -0700)]
altos: Check MS5607 CRC. Clean up MS5607 API

It's not ready for flight yet, but at least it's sensible now.

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

2 years agoaltos: Conditional byte swapping in mpu6000 driver
Keith Packard [Tue, 8 May 2012 06:14:14 +0000 (23:14 -0700)]
altos: Conditional byte swapping in mpu6000 driver

Only needed on LSB machines.

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

2 years agoMerge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
Bdale Garbee [Wed, 16 May 2012 15:13:53 +0000 (09:13 -0600)]
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos

2 years agobuild-dep on default-jdk instead of openjdk-6-jdk, closes: #655580
Bdale Garbee [Wed, 16 May 2012 15:09:44 +0000 (09:09 -0600)]
build-dep on default-jdk instead of openjdk-6-jdk, closes: #655580

2 years agoaltosui: Try to make telem tick counts match eeprom
Keith Packard [Tue, 8 May 2012 04:53:53 +0000 (21:53 -0700)]
altosui: Try to make telem tick counts match eeprom

telem files can have an extra wrap or two of tick count if they start
recording a long time before the flight. Account for this so that the
CSV file output from each have matching tick values.

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

2 years agoaltosui: Output recorded clock tick in CSV files
Keith Packard [Tue, 8 May 2012 04:53:11 +0000 (21:53 -0700)]
altosui: Output recorded clock tick in CSV files

This allows eeprom and telem files to be correlated accurately

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

2 years agoaltos: Hacking at cc1120 driver
Keith Packard [Tue, 8 May 2012 04:52:12 +0000 (21:52 -0700)]
altos: Hacking at cc1120 driver

Still doesn't work, but this adds a ton more register definitions

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

2 years agoaltos: Get mpu6000 working
Keith Packard [Tue, 8 May 2012 04:51:25 +0000 (21:51 -0700)]
altos: Get mpu6000 working

This initializes the device appropraitely, and provides a command to
dump the current values in converted form.

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

2 years agoaltos: stm: pass DMA buffer index to DMA completion callback
Keith Packard [Tue, 8 May 2012 04:50:26 +0000 (21:50 -0700)]
altos: stm: pass DMA buffer index to DMA completion callback

This lets the user know which DMA has finished.

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

2 years agoaltos: stm: delay during USB config with pull-up off
Keith Packard [Tue, 8 May 2012 04:49:24 +0000 (21:49 -0700)]
altos: stm: delay during USB config with pull-up off

This makes sure that a reboot will reliably cause the device to
disconnect from the USB bus.

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

2 years agoaltos: stm: share i2c_stop code between send and recv
Keith Packard [Tue, 8 May 2012 04:47:17 +0000 (21:47 -0700)]
altos: stm: share i2c_stop code between send and recv

This waits for the stop signal to appear on the bus, necessary before
starting another transaction.

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

2 years agoaltos: stm i2c DMA for large recv appears to work
Keith Packard [Mon, 7 May 2012 06:54:13 +0000 (23:54 -0700)]
altos: stm i2c DMA for large recv appears to work

Transaction appears to be clean on the i2c bus now; correct number of
bytes received, and the nack and stop at the right time. This tests >
2 length reads; should try that too.

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

2 years agoaltos: megametrum needs ao_mpu6000.h
Keith Packard [Mon, 7 May 2012 05:53:25 +0000 (22:53 -0700)]
altos: megametrum needs ao_mpu6000.h

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

2 years agoaltos: Switch megametrum compile to -Os
Keith Packard [Mon, 7 May 2012 05:52:56 +0000 (22:52 -0700)]
altos: Switch megametrum compile to -Os

Looks like gcc has compiler bugs with -O0

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

2 years agoaltos: STM i2c work.
Keith Packard [Mon, 7 May 2012 05:47:33 +0000 (22:47 -0700)]
altos: STM i2c work.

Start now driven by interrupts
Send now done with DMA and interrupts

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

2 years agoao-tools: Add GPS and rssi printing to ao-telem
Keith Packard [Wed, 2 May 2012 01:12:41 +0000 (18:12 -0700)]
ao-tools: Add GPS and rssi printing to ao-telem

This prints all of the basic telemetrum messages now.

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

2 years agoaltos: Report latest telemetry data, rather than using the oldest
Keith Packard [Tue, 1 May 2012 18:08:49 +0000 (11:08 -0700)]
altos: Report latest telemetry data, rather than using the oldest

ao_sample_adc points to the *next* ADC entry, rather than the most
recent one. Step back one entry to get the latest valid data.

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

2 years agoaltos: Add hmc5883 and mpu6000 drivers to megametrum build
Keith Packard [Thu, 26 Apr 2012 06:29:20 +0000 (23:29 -0700)]
altos: Add hmc5883 and mpu6000 drivers to megametrum build

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

2 years agoaltos: Add mpu6000 and hmc5883 stubs
Keith Packard [Thu, 26 Apr 2012 06:27:58 +0000 (23:27 -0700)]
altos: Add mpu6000 and hmc5883 stubs

No real drivers here yet, just some testing stubs

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

2 years agoaltos: Add STM I2C recv and stop funcs
Keith Packard [Thu, 26 Apr 2012 06:26:57 +0000 (23:26 -0700)]
altos: Add STM I2C recv and stop funcs

Recv doesn't appear to work with more than one byte

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

2 years agoaltos: Oopsed the STM DMA channels for I2C1
Keith Packard [Thu, 26 Apr 2012 06:25:43 +0000 (23:25 -0700)]
altos: Oopsed the STM DMA channels for I2C1

TX is 6, RX is 7

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

2 years agoaltosui: Mac OS Lion Java default heap space is too small (Trac #37)
Keith Packard [Sat, 21 Apr 2012 03:26:16 +0000 (22:26 -0500)]
altosui: Mac OS Lion Java default heap space is too small (Trac #37)

Increase it to 512M in the Info.plist file.

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

2 years agoaltos: Starting to write cc1120 driver
Keith Packard [Tue, 17 Apr 2012 18:01:18 +0000 (11:01 -0700)]
altos: Starting to write cc1120 driver

This does "something" in radio test mode, appearing to generate a
730MHz signal.

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

2 years agoaltosui: Add apogee lockout configuration
Keith Packard [Sat, 14 Apr 2012 20:53:36 +0000 (13:53 -0700)]
altosui: Add apogee lockout configuration

Provide suggested values of 5/10/15/20 seconds.

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

2 years agoaltosui: Read frequency from device while configuring ground station
Keith Packard [Sat, 14 Apr 2012 20:52:37 +0000 (13:52 -0700)]
altosui: Read frequency from device while configuring ground station

Missed this when adding the TD config UI.

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

2 years agoaltos: Remove debug printf from cc1111 check-stack script
Keith Packard [Sat, 14 Apr 2012 19:05:28 +0000 (12:05 -0700)]
altos: Remove debug printf from cc1111 check-stack script

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

2 years agoaltos: Respect apogee lockout time in flight algorithm
Keith Packard [Sat, 14 Apr 2012 19:02:14 +0000 (12:02 -0700)]
altos: Respect apogee lockout time in flight algorithm

This prevents any apogee detection from occurring until the specified
number of seconds after boost. This also prevents the switch from
accel+baro to baro only mode in the Kalman filter.

The test frame work is also changed to look for Apogee lockout: in the
eeprom input file.

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

2 years agoaltos: Clean up test scripts
Keith Packard [Sat, 14 Apr 2012 19:00:32 +0000 (12:00 -0700)]
altos: Clean up test scripts

The flight test scripts were using invalid bash syntax. Clean that up
and also switch the default flight directory to my new
~/misc/rockets/flights directory.

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

2 years agoaltos: Correct STM USB driver
Keith Packard [Sat, 14 Apr 2012 01:38:29 +0000 (18:38 -0700)]
altos: Correct STM USB driver

Configure endpoint registers correctly now.
Restructure code to make sure we send the right IN packets.

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

2 years agoaltos: Check all USE_SERIAL_*_STDIO when computing AO_NUM_STDIOS
Keith Packard [Sat, 14 Apr 2012 01:35:46 +0000 (18:35 -0700)]
altos: Check all USE_SERIAL_*_STDIO when computing AO_NUM_STDIOS

AO_NUM_STDIOS is allocated based on the total number of possible stdio
values. Now that multiple serial stdio are possible, make sure to
check all of them.

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

2 years agoaltos: Set USB Interrupt endpoint interval to maximum allowed
Keith Packard [Sat, 14 Apr 2012 01:34:52 +0000 (18:34 -0700)]
altos: Set USB Interrupt endpoint interval to maximum allowed

We don't ever send anything over this channel, so there's no sense
asking the host to poll it very often.

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

2 years agoaltos: Pull more interfaces out of ao.h and move to separate files
Keith Packard [Fri, 13 Apr 2012 16:39:20 +0000 (09:39 -0700)]
altos: Pull more interfaces out of ao.h and move to separate files

This moves the aes, btm, companion, lcd and packet interfaces out of ao.h

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

2 years agoaltos: ao_telelaunch.c got left in src directory
Keith Packard [Fri, 13 Apr 2012 16:36:00 +0000 (09:36 -0700)]
altos: ao_telelaunch.c got left in src directory

Should live in product/ao_telelaunch.c

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

2 years agoaltos: Massive product config cleanup
Keith Packard [Thu, 12 Apr 2012 21:51:07 +0000 (14:51 -0700)]
altos: Massive product config cleanup

Support multiple serial ports more cleanly

Split out parts of ao.h into separate feature header files

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

2 years agoaltos: Start adding apogee lockout support
Keith Packard [Thu, 12 Apr 2012 21:50:12 +0000 (14:50 -0700)]
altos: Start adding apogee lockout support

Remove radio channel support too.

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

2 years agoaltos: Switch stm-demo to HSE clock, add USB
Keith Packard [Thu, 12 Apr 2012 06:31:28 +0000 (23:31 -0700)]
altos: Switch stm-demo to HSE clock, add USB

Requires that SB17 be soldered shut so that the MCO from the STlink
CPU is available the target for HSE input.

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

2 years agoaltos: Rework how STM clocks are initialized.
Keith Packard [Thu, 12 Apr 2012 06:30:13 +0000 (23:30 -0700)]
altos: Rework how STM clocks are initialized.

Clean all of the RCC configuration up after turning on the clocks.
Use the MSI clock during initialization to avoid messing around with
the HSI clock temporarily.

Allow for an external clock on the HSE line.

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

2 years agoaltos: Use new USB driver in megametrum-v0.1 product
Keith Packard [Thu, 12 Apr 2012 06:29:38 +0000 (23:29 -0700)]
altos: Use new USB driver in megametrum-v0.1 product

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

2 years agoaltos: Add STM USB driver
Keith Packard [Thu, 12 Apr 2012 06:28:45 +0000 (23:28 -0700)]
altos: Add STM USB driver

Emulates the usual CDC-ACM device

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

2 years agoaltos: Add STM ao_arch_reboot implementation
Keith Packard [Thu, 12 Apr 2012 06:26:30 +0000 (23:26 -0700)]
altos: Add STM ao_arch_reboot implementation

Uses the AIRCR register to force a reset

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

2 years agoaltos: Add register definitions for STM syscfg and usb
Keith Packard [Thu, 12 Apr 2012 06:25:36 +0000 (23:25 -0700)]
altos: Add register definitions for STM syscfg and usb

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

2 years agoaltos: Add support for multiple SPI busses and sharing device drivers
Keith Packard [Tue, 10 Apr 2012 06:27:43 +0000 (23:27 -0700)]
altos: Add support for multiple SPI busses and sharing device drivers

The STM32L151 has several SPI busses, and we want to use more than
one, so add a 'bus' parameter to the SPI interfaces. To avoid wasting
time on AVR and CC1111 processors which only use one SPI bus, elide
those parameters from the actual functions by wrapping them with
macros.

Configuring chip select is now all macroized so that each chip can
have its own version, allowing the STM to share the various SPI device
drivers with the cc1111 and avr processors. Note that only the M25
driver has been ported; porting the others is 'trivial', but not
necessary at this point.

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

2 years agoaltos: make megametrum beeper test keep beeping
Keith Packard [Tue, 10 Apr 2012 05:25:59 +0000 (22:25 -0700)]
altos: make megametrum beeper test keep beeping

Used to measure the beep frequency.

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

2 years agoaltos: Check for cc1111 flash overflow
Keith Packard [Tue, 10 Apr 2012 05:25:13 +0000 (22:25 -0700)]
altos: Check for cc1111 flash overflow

The linker is supposed to do this, but it ignores the static
initializer data added after the code.

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

2 years agoaltos: Increase STM SPI speed to PCLK/4
Keith Packard [Tue, 10 Apr 2012 05:24:36 +0000 (22:24 -0700)]
altos: Increase STM SPI speed to PCLK/4

The pressure sensor seems happy at this speed.

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

2 years agoaltos: Move MS5607 configuration to ao_pins.h
Keith Packard [Tue, 10 Apr 2012 05:23:52 +0000 (22:23 -0700)]
altos: Move MS5607 configuration to ao_pins.h

Which SPI port and where chip select is to be found are product specific.

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

2 years agoaltos: Add missing parens in ao_ms5607.h
Keith Packard [Tue, 10 Apr 2012 05:22:58 +0000 (22:22 -0700)]
altos: Add missing parens in ao_ms5607.h

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

2 years agoaltos: Reduce MS5607 reset delay, increase conversion delay
Keith Packard [Tue, 10 Apr 2012 05:21:46 +0000 (22:21 -0700)]
altos: Reduce MS5607 reset delay, increase conversion delay

Reset doesn't take very long, while doing a conversion seems to take
more than 10ms.

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

2 years agoaltos: Make STM clock configuration per-product. Fix 32MHz CPU speed
Keith Packard [Tue, 10 Apr 2012 05:17:33 +0000 (22:17 -0700)]
altos: Make STM clock configuration per-product. Fix 32MHz CPU speed

This moves all of the STM clock configuration into ao_pins.h so that
each product can configure it separately. While doing this, I
discovered that the flash memory mode (64-bit, prefetch, latency 1)
wasn't actually getting set, which is why the CPU refused to work at
32MHz.

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

2 years agoaltos: Add beeper driver to STM arch
Keith Packard [Tue, 10 Apr 2012 03:28:19 +0000 (20:28 -0700)]
altos: Add beeper driver to STM arch

Drives the MegaMetrum beeper

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

2 years agoaltos: Test I2C code on discovery board.
Keith Packard [Mon, 9 Apr 2012 07:10:43 +0000 (00:10 -0700)]
altos: Test I2C code on discovery board.

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

2 years agoaltos: ARM -O0 flag appears to generate buggy code
Keith Packard [Mon, 9 Apr 2012 07:10:01 +0000 (00:10 -0700)]
altos: ARM -O0 flag appears to generate buggy code

Use -Os always, which is annoying...

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

2 years agoaltos: Make ms5607 driver do something
Keith Packard [Mon, 9 Apr 2012 07:09:18 +0000 (00:09 -0700)]
altos: Make ms5607 driver do something

It's loading prom values and converting sensor data, but it's getting
the wrong answer at present.

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

2 years agoaltos: add STM I2C driver.
Keith Packard [Mon, 9 Apr 2012 07:08:20 +0000 (00:08 -0700)]
altos: add STM I2C driver.

Not well tested yet...

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

2 years agoaltos: Slow STM SPI down a bit so the MS5607 returns values
Keith Packard [Mon, 9 Apr 2012 07:06:35 +0000 (00:06 -0700)]
altos: Slow STM SPI down a bit so the MS5607 returns values

It's still not working right, but at least it returns something other
than all zeros...

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

2 years agoaltos: Allow STM DMA channels to be reserved for one use
Keith Packard [Mon, 9 Apr 2012 07:05:18 +0000 (00:05 -0700)]
altos: Allow STM DMA channels to be reserved for one use

This allows a single user of a DMA channel to reserve it for use
without needing to lock the mutex; this is required for DMA from the
ADC to work on megametrum as it wants to start DMA from an interrupt
handler, which cannot block on a mutex.

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

2 years agoaltos: Show temperature in stm-demo
Keith Packard [Sun, 8 Apr 2012 03:35:17 +0000 (20:35 -0700)]
altos: Show temperature in stm-demo

Use the ADC to show current temperature

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

2 years agoaltos: Use 384 cycle ADC sample time
Keith Packard [Sun, 8 Apr 2012 03:33:27 +0000 (20:33 -0700)]
altos: Use 384 cycle ADC sample time

This is plenty fast, and provides nice stable readings.

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

2 years agoaltos: Add STM temperature sensor calibration data
Keith Packard [Sun, 8 Apr 2012 03:31:58 +0000 (20:31 -0700)]
altos: Add STM temperature sensor calibration data

Each stm32l has two-point factory temperature calibration data.
Provide access to that for displaying temperature data.

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

2 years agoaltos: Add ADC support to megametrum firmware
Keith Packard [Sun, 8 Apr 2012 01:55:53 +0000 (18:55 -0700)]
altos: Add ADC support to megametrum firmware

Measures all MM igniter and battery voltages.

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

2 years agoaltos: Add ADC tests to stm-demo
Keith Packard [Sun, 8 Apr 2012 01:55:20 +0000 (18:55 -0700)]
altos: Add ADC tests to stm-demo

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

2 years agoaltos: STM SPI is not using interrupts itself
Keith Packard [Sun, 8 Apr 2012 01:54:32 +0000 (18:54 -0700)]
altos: STM SPI is not using interrupts itself

All SPI transfers are done via DMA, so the DMA interrupts suffice.

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

2 years agoaltos: Add support for STM ADC
Keith Packard [Sun, 8 Apr 2012 01:53:12 +0000 (18:53 -0700)]
altos: Add support for STM ADC

DMA-based driver for the STM analog to digital converter.

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

2 years agoaltosui: remove debug printf from AltosFlightStats
Keith Packard [Sun, 8 Apr 2012 01:44:11 +0000 (18:44 -0700)]
altosui: remove debug printf from AltosFlightStats

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