summaryrefslogtreecommitdiff
path: root/src/stmf0
Commit message (Collapse)AuthorAge
* 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>
* altos/stmf0: Not all timer configurations use AF2Keith Packard2017-04-24
| | | | | | Allow applications to select other configurations. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Pull beeper pin low when beeper is offKeith Packard2017-04-21
| | | | | | | This avoids having the pin float and pick up noise from any adjacent signals, like TeleMini's radio. Signed-off-by: Keith Packard <keithp@keithp.com>
* alots/stmf0: Fix vpath entry for AES directoryKeith Packard2017-04-21
| | | | | | Mis-placed ) Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lpc,altos/stmf0: Use -n flag to work around link editor issueKeith Packard2017-04-21
| | | | | | | | | Something changed in the link editor which makes it complain about 'no space for program headers' on LPC and STMF0 builds. Somehow, adding the '-n' flag to the linking step fixes it. It doesn't appear to break the build, so I guess it's ok? Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Split up rom load in altos.ld to make linker happyKeith Packard2017-04-13
| | | | | | | The linker isn't happy when the .ld file tries to add text, the .exidx and .rodata segments in the same block. Split them up for success. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Support timer 2/3 for the beeperKeith Packard2017-02-20
| | | | | | Tested on timer 2, all four channels. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Support tim1 beeper channel other than 3Keith Packard2017-02-20
| | | | | | ch1 was broken and ch2 didn't have any code at all. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Add adc and beep support for TeleMini v3.0Keith Packard2017-02-20
| | | | | | | Note that the ADC code is running very slowly as required by the high impedance dividers on the TeleMini v3.0 pyro circuits. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Allow projects to not use the USB boot loaderKeith Packard2017-02-20
| | | | | | Let applications define HAS_BOOT_LOADER on their own if desired. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Complain if the SPI configuration isn't completeKeith Packard2017-02-20
| | | | | | | | If the pin usage values SPI_1_PA5_PA6_PA7 or SPI_1_PB3_PB4_PB5 aren't defined, then the speed values for the pins aren't going to get set correctly, which results in erratic SPI behaviour. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Allow apps to leave interrupt vectors at 0Keith Packard2017-02-20
| | | | | | | | TeleMini v3.0 doesn't need a boot loader, so we'll have the app run its interrupt vector right at the bottom of the address space instead of copying it to the bottom of ram and reconfiguring the chip to use that. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/chaoskey: use both halves of the CRCKeith Packard2017-02-20
| | | | | | | | When pulling 16 bits from the 32-bit crc, instead of just using the low bits, xor the two halves together. This appears to even out the number of zero and one bits. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Add a comment about the requirements for using ao_flash_stmKeith Packard2017-02-20
| | | | | | Need HSI clock and the flashing functions loaded in ram. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/lambdakey: Get save/restore workingKeith Packard2017-02-20
| | | | | | Need the HSI clock running for the flash hardware to work. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Add lisp to include directoriesKeith Packard2017-02-20
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* Add first lisp bitsKeith Packard2017-02-20
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/arm: Align data so that gcc 5.4 doesn't do byte-accesses. Add -Wcast-alignKeith Packard2016-12-17
| | | | | | | | | | | | | | | | | | | | | | Gcc 5.4.1 tracks alignment of data through assignments, so that a uint32_t pointer which comes from byte-aligned uint8_t data: extern uint8_t foo[]; uint32_t *q = (void *) foo; Fetches and stores through this pointer are done bytewise. This is slow (meh), but if q references a device register, things to bad very quickly. This patch works around this bug in the compiler by adding __attribute__((aligned(4))) tags to some variables, or changing them from uint8_t to uint32_t. Places doing this will now be caught as I've added -Wcast-align to the compiler flags. That required adding (void *) casts, after the relevant code was checked to make sure the compiler could tell that the addresses were aligned. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Add USART supportKeith Packard2016-10-30
| | | | | | | The STM32F0 usart can be operated much like the STM32L usart, but the registers are all moved around. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Switch ADC fast to ADC clockKeith Packard2016-08-08
| | | | | | | Using this slower clock eliminates sampling problems with the ADC and cleans up the chaoskey raw data. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Clean .bin files from flash-loader dirsKeith Packard2016-08-02
| | | | | | | The .bin files are what the DFU utility uses to flash the boot loader using USB. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Hook up clock output supportKeith Packard2016-08-02
| | | | | | | This was used to try and not have two xtals on telemini, but failed because the provided clock has too much noise. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Add STM32F0 beep and SPI byte API.Keith Packard2016-07-14
| | | | 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/stmf0: Remove ao_usb_freeKeith Packard2016-06-11
| | | | | | This can't work without a lot more effort. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Rework the sram allocation to save a few text bytesKeith Packard2016-06-11
| | | | | | | Boot loaders were going over 4096 bytes of ROM. I suspect we'll need more serious work soon. Signed-off-by: Keith Packard <keithp@keithp.com>
* stmf0: Do not send more data than requested for GET_DESCRIPTORKeith Packard2016-06-09
| | | | | | | | When Linux boots, it asks for only the first 8 bytes of the device descriptor; we must limit the amount of data sent back to that amount or USB will get wedged. Signed-off-by: Keith Packard <keithp@keithp.com>
* stmf0: Clear all USB state when resetting chip. Wakeup all sleepersKeith Packard2016-06-09
| | | | | | | | | When USB is reset, but the board is not power cycled, all of the internal USB state needs to be reset, and any tasks blocked on sending or receiving packets need to be awoken so they can go wait for USB to start running again. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Fix external interruptsKeith Packard2016-04-19
| | | | | | | | 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>
* altos/detherm: Add ms5607 to dethermKeith Packard2016-04-13
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Add pwm and exti driversKeith Packard2016-04-02
| | | | Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Support HPE clock sourceKeith Packard2016-04-02
| | | | | | Allows the use of crystals instead of requiring USB. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Add SPI driver.Keith Packard2016-04-02
| | | | | | | 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>
* altos/stmf0: Construct .bin files for flash loadersKeith Packard2016-03-18
| | | | | | | 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>