summaryrefslogtreecommitdiff
path: root/src/stm/ao_arch.h
Commit message (Collapse)AuthorAge
* 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: 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: 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: 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/stm: Let products override AO_LED_TYPE for stm processorsKeith Packard2018-06-17
| | | | | | No need requiring it to be uint16_t Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Add per-LED port/pin mode in LED codeKeith Packard2018-05-16
| | | | | | | | | If you've got a complicated LED pin arrangement, you can ask for each one to be configured separately, instead of using groups in a couple of GPIO registers. The code isn't as efficient this way, but at least it's easy to read. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Allow use basepri instead of primask for masking interruptsKeith Packard2017-02-20
| | | | | | | | | | | | This allows for high priority interrupts (priority 0) to run, even when other interrupts are blocked. Code executing in such interrupt handlers must not attempt to control task execution as that will race with the scheduler. Select this by defining AO_NONMASK_INTERRUPT in ao_pins.h. non-maskable interrupt priority is AO_STM_NVIC_NONMASK_PRIORITY Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Interrupt priority is in the upper bits of the priority maskKeith Packard2017-02-20
| | | | | | | | | | Because the STM32L only offers 16 priority levels, the bottom four bits of each priority mask are not used. All of the interrupt priority settings in the system were using values < 16, making them all effectively the same. Fix that by moving them into the upper 4 bits and using symbolic constants everywhere. Signed-off-by: Keith Packard <keithp@keithp.com>
* Switch from GPLv2 to GPLv2+Keith Packard2016-07-12
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Allow apps to define different stack sizeKeith Packard2016-03-26
| | | | | | | While 512 bytes is a reasonable size, sometimes apps don't have that much stack space. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Use flash address of boot loader instead of 0x0Keith Packard2014-05-12
| | | | | | | Flash is at 0x08000000, but when the chip boots, it can be at 0x0 as well. Use the 0x08000000 address when rebooting to flash Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Report battery, apogee and main voltages over APRSKeith Packard2014-01-15
| | | | | | This makes APRS more usable when you mute the RF audio on the HT. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Initial TeleMetrum v2.0 bitsKeith Packard2013-08-27
| | | | | | | Adds new telemetry and logging formats along with code for TeleMetrum v2.0 design. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm: Create per-product flash loadersKeith Packard2013-05-07
| | | | | | | Split the flash loader prototype into pieces so that each product can build a custom flash loader with very little code. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stm-flash: Check target flash address against AO_BOOT_APPLICATION_BASEKeith Packard2013-05-07
| | | | | | Allows that value to change Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Use flash loader on all STM productsKeith Packard2013-05-07
| | | | | | Includes the boot chain stuff Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Use SYSTICK on STM32LKeith Packard2013-05-07
| | | | | | | It's probably more power efficient than using one of the timers, and it's certainly easier to configure. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make stdio 8-bit clean by making pollchar return intKeith Packard2012-11-30
| | | | | | | | | | We were stealing one value (0xff) in the return value from pollchar to indicate 'not ready yet'. Instead of doing that, use the integer value -1 and have pollchar return an int instead of a char. That necessitated cleaning a few other bits to make sure that 0xff wouldn't get promoted to -1 on accident. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Clean up stm arch macros a bit.Keith Packard2012-10-25
| | | | | | | Turn a bunch of the macros into inline functions. Clean up the reboot method to use the stm_scb structure. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Replace __critical usage with ao_arch_critical as neededKeith Packard2012-10-25
| | | | | | | | | | | | | sdcc offers __critical as a machine-independent way to block interrupts, but as gcc doesn't, we need to use a compiler-independent construct instead. ao_arch_critical has been around since the AVR port, but some old __critical usages remained. This fixes a bunch of random hangs when communicating with MM over USB or the radio as the various stdio loops were running without interrupts blocked between the test and the sleep. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: profiling on STM32LKeith Packard2012-10-25
| | | | | | Add sample-based profiling, using a 1kHz timer Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Expose a signed version of the tick countKeith Packard2012-08-27
| | | | | | Useful when doing time comparisons. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Shrink STM stack sizeKeith Packard2012-08-26
| | | | | | 512 bytes should be enough for anybody. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Place STM config values at fixed addresses for re-useKeith Packard2012-07-17
| | | | | | | | Just like cc1111, stick the serial number and radio calibration values at known fixed addresses so that when re-flashing the board, we can go find the existing values. Signed-off-by: Keith Packard <keithp@keithp.com>
* stm: running out of memory in MM -- reduce stack to 668 bytesKeith Packard2012-07-14
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Increase default STM stack to 648 bytesKeith Packard2012-06-27
| | | | | | | 512 seems cozy given the printf implementation we're using and the extensive interrupts. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Optimize FEC encode and decodeKeith Packard2012-06-26
| | | | | | | | | | | | | Integrate interleaving, CRC and padding within the decode/encode functions. Provide for ISR priorities so that the 1120 RX interrupt takes precedence over the other interrupts or we risk losing bits. Optimize the viterbi decoder a bit (goes from 10ms per packet to 7ms per packet). Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Be more careful about register save/restore in ao_yieldKeith Packard2012-06-17
| | | | | | | Make sure the general registers are all saved before messing with any of them. Then, explicitly use r0 to save/restore apsr and primask. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Massive product config cleanupKeith Packard2012-04-14
| | | | | | | | 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>
* altos: Add STM ao_arch_reboot implementationKeith Packard2012-04-14
| | | | | | Uses the AIRCR register to force a reset Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Make STM clock configuration per-product. Fix 32MHz CPU speedKeith Packard2012-04-09
| | | | | | | | | | 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>
* altos: Add support for STM ADCKeith Packard2012-04-07
| | | | | | DMA-based driver for the STM analog to digital converter. Signed-off-by: Keith Packard <keithp@keithp.com>
* Get config stuff hooked up for MegaMetrumKeith Packard2012-03-28
| | | | | | This stubs out enough stuff to let ao_config link and work Signed-off-by: Keith Packard <keithp@keithp.com>
* Use 16-bits for STM32 LED mask. Export serial I/O functionsKeith Packard2012-03-28
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* Allow any STM usart to be used for stdioKeith Packard2012-03-28
| | | | | | | This also adds the alternate pin configurations for the other two usarts Signed-off-by: Keith Packard <keithp@keithp.com>
* Move LCD string output code to ao_lcd_font.cKeith Packard2012-03-28
| | | | | | | It's all very specific to the 14-segment display, so stick it there. Signed-off-by: Keith Packard <keithp@keithp.com>
* Add LCD device driver to STM32L portKeith Packard2012-03-28
| | | | | | | This enables the 6-digit 14-character display on the STM32L discovery board and provides an ascii output to it. Signed-off-by: Keith Packard <keithp@keithp.com>
* Save/restore PRIMASK register on Cortex-M3Keith Packard2012-03-28
| | | | | | This preserves the interrupt-enabled bit across context switches Signed-off-by: Keith Packard <keithp@keithp.com>
* Basic OS running on STM32LKeith Packard2012-03-28
| | | | | | This gets stm-demo working Signed-off-by: Keith Packard <keithp@keithp.com>
* Add stm-demo programKeith Packard2012-03-28
| | | | | | This runs AltOS and talks over the serial port. Signed-off-by: Keith Packard <keithp@keithp.com>
* Add STM platform and stm-bringup demo programKeith Packard2012-03-28
The stm-bringup doesn't run altos, it just initializes the device and writes stuff over a serial port. Works on the STM32L Discovery board at least, should do stuff on other boards too. Signed-off-by: Keith Packard <keithp@keithp.com>