summaryrefslogtreecommitdiff
path: root/src/stmf0
Commit message (Collapse)AuthorAge
* altos/stmf0: Allow SPI to be powered down when idle if desiredKeith Packard2019-07-16
| | | | | | | Set SPI_1_POWER_MANAGE and/or SPI_2_POWER_MANAGE to have the spi blocks powered down when not in use. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Add 'ao_serial_shutdown'Keith Packard2019-07-16
| | | | | | This powers down the UART logic on request. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Leave power interface disabled until neededKeith Packard2019-07-16
| | | | | | | | We only need the power interface when placing the chip in the lowest power state, so don't power up the power interface clock at startup, instead wait until later. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/micropeak-v2: Erase log space at end of BOOST_DELAYKeith Packard2019-06-18
| | | | | | | We have to erase the log before the flight starts, so this seems like the latest possible moment. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/micropeak-v2.0: Go into standby mode after landingKeith Packard2019-06-18
| | | | | | | This is the lowest power state we can reach, and consumes about 15µA or less. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: add ao_time_ns APIKeith Packard2019-02-25
| | | | | | | This provides nano-second resolution times by reading the systick value (which runs at 250ns ticks on stm). Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Fix several mis-specified time typesKeith Packard2019-02-25
| | | | | | Make sure AO_TICK_TYPE is used "everywhere", instead of uint16_t or other. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Fix ISR declarations to make them non-weakKeith Packard2019-02-21
| | | | | | | | | | In my zeal to eliminate warnings, I added declarations of all ISR functions to a shared header file. However, I managed to include the 'weak' declaration, which meant that the intended ISR functions were as weak as the 'default' ISR functions. This left all interrupts non-functional, which doesn't make for a happy program. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Move common build definitions to src/Makefile.defsKeith Packard2019-02-18
| | | | | | | | This cleans up the build process for all architectures, providing a common place to specify vpath, cflags and build rules for various common files. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add -Wshadow to CFLAGSKeith Packard2019-02-18
| | | | | | And fix up the related messages. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add a pile more compiler warningsKeith Packard2019-02-18
| | | | | | | | | | | Adds: -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Declare task stack as union of uint8_t and uint32_tKeith Packard2019-02-18
| | | | | | | Support -Wcast-align and -Wpointer-arith while still allowing architectures to pick whether they want an 8-bit or 32-bit stack. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add 'void' to function declarations with no params.Keith Packard2019-02-18
| | | | | | Support -Wstrict-prototypes Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Declare all public functions in header filesKeith Packard2019-02-18
| | | | | | | Including interrupt vectors to catch mis-spellings. Working toward supporting -Wmissing-prototypes Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Mark local functions 'static'Keith Packard2019-02-18
| | | | | | Working towards supporting -Wmissing-prototypes Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Fix spelling of stm_dma_ch4_5_6_isrKeith Packard2019-02-18
| | | | | | This spellingn error would have caused all DMA to these channels to fail. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Create ao_data_fill shared functionKeith Packard2018-10-19
| | | | | | | This fills a data ring entry with all of the current sensor values other than the ADC. It is used in all of the adc completion functions. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Clean up AO_ROMCONFIG bitsKeith Packard2018-10-13
| | | | | | | Remove address parameter (doesn't work with gcc), create shared ao_romconfig in kernel. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add generic LED driver.Keith Packard2018-10-13
| | | | | | | | | | | This driver uses the generic GPIO functions and allows per-LED port and pin configuration. It supports up to 32 LEDs. Rename SoC-specific LED drivers. Remove enabled parameter to ao_led_init Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Eliminate 'pin' field from GPIO functionsKeith Packard2018-10-13
| | | | | | | This was used with the 8051 bit-addressing mode to provide single-instruction access to GPIO pins. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make cmd number parsing functions return valueKeith Packard2018-10-13
| | | | | | Don't use a global variable to hold the result. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Remove 8051 address space specifiersKeith Packard2018-10-13
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Switch to newlib-nano for libc on armKeith Packard2018-10-13
| | | | | | Stop using pdclib Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Stop using 'stdin' name as local variableKeith Packard2018-08-15
| | | | | | stdio kinda wants to own this name Signed-off-by: Keith Packard <keithp@keithp.com>
* Merge branch 'mpusb'Keith Packard2018-05-07
|\
| * altos/stmf0: leave ao_power_gpio names undefined without power managementKeith Packard2018-05-07
| | | | | | | | | | | | Should make it more obvious at compile time that you've done something wrong. Signed-off-by: Keith Packard <keithp@keithp.com>
* | altos/stmf0: Fix up USB debug codeKeith Packard2018-05-07
| | | | | | | | | | | | | | At least make it compile. In this configuration, it's dumping out IN3 endpoint register values. Signed-off-by: Keith Packard <keithp@keithp.com>
* | altos/stmf0: Add IN3 alternate endpoint supportKeith Packard2018-05-07
| | | | | | | | | | | | This adds the code necessary to drive another IN endpoint. Signed-off-by: Keith Packard <keithp@keithp.com>
* | altos/stmf0: Toggle IN2 SW_BUF bit when sending dataKeith Packard2018-05-07
|/ | | | | | | This tells the hardware we're done writing data to the second input buffer and allows it to be switched from NAK to VALID. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Set 0x0 mapping to Main Flash for boot loaderKeith Packard2018-05-01
| | | | | | | | | When DFU finishes loading firmware and jumps to the application, it leaves the mapping of addresses starting at 0x0 set to System flash, which prevents the boot loader from receiving interrupts and requires a power cycle during flash & cal. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: whitespace fixKeith Packard2018-05-01
| | | | | | Trailing whitespace. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Change tests for AO_BOOT_CHAIN and AO_BOOT_PIN to #ifKeith Packard2018-05-01
| | | | | | Were #ifdef, which meant that #define AO_BOOT_PIN 0 didn't work right. Signed-off-by: Keith Packard <keithp@keithp.com>
* add a warning about Google limiting per-day access until/unless we payBdale Garbee2018-04-22
|
* altos/stmf0: Add some common definitions for flash loadersKeith Packard2018-03-16
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/scheme: Move ao-scheme to a separate repositoryKeith Packard2018-01-10
| | | | | | This way it can be incorporated into multiple operating systems more easily. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Use double buffering for ChaosKeyKeith Packard2018-01-07
| | | | | | | This improves the USB performance of ChaosKey so that it doesn't NAK during data transfers at all. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: use double buffering for USB rx dataKeith Packard2018-01-07
| | | | | | This also allows us to stop shadowing USB rx buffers in system ram Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Use double buffering for USB tx dataKeith Packard2018-01-07
| | | | | | | This shouldn't have much of an effect, but shows how double buffering works. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Stop shadowing USB tx buffers in system RAMKeith Packard2018-01-07
| | | | | | Use the 16-bit USB memory directly, avoiding the buffer space and the copy Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Remove packet counters from non-debug buildKeith Packard2018-01-07
| | | | | | These counters are only useful for helping debug the USB driver. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Align 'data' to 8 bytes, just like textramKeith Packard2017-12-12
| | | | | | | | | | | | | | The textram section must be aligned to 8 bytes to keep the linker happy. However, if that section contains no data, the declaration will set the __data_start__ value to that alignment, but the data section itself would start on a 4-byte alignment, potentially 4 bytes lower than the value indicated by __data_start__. This completely scrambles initialized memory as the startup code will copy the data segment to __data_start__, 4 bytes off of the actual data segment start. Fix this by forcing the data segment to also be aligned to 8 bytes. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Allow building with newlib + avr stdio on ARMKeith Packard2017-12-11
| | | | | | | Redefines some stdio bits so that we can build with either pdclib or newlib + avr stdio. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Initialize UART RTS/CTS before turning it onKeith Packard2017-06-27
| | | | | | If you try this after the UART is running, it won't work. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf: Fix up serial port flow control configuration bitsKeith Packard2017-05-15
| | | | | | | | | Compute whether any sw/hw flow control is in use. Compute whether hw flow control is in use as a separate value. These make the code a bit easier to follow. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make CDC ACM 'line coding' publicKeith Packard2017-05-04
| | | | | | This allows other systems to see what baud rate the host has requested. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Add code to use SoC flash as storageKeith Packard2017-05-02
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Add support for HSI clocked applicationsKeith Packard2017-04-28
| | | | | | And allow application space to be limited to less than available flash. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Fix HSI clock rate.Keith Packard2017-04-28
| | | | | | It's 8MHz, not 16MHz Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Make sure systick is off before programmingKeith Packard2017-04-28
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Compute serial baud rate registers at runtimeKeith Packard2017-04-28
| | | | | | | This allows the system clock to vary at runtime, instead of requiring a fixed value. Signed-off-by: Keith Packard <keithp@keithp.com>