summaryrefslogtreecommitdiff
path: root/src/stmf0
Commit message (Collapse)AuthorAge
* 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>
* altos: Fixed timing of panic display LED to be readableBart Massey2016-03-07
| | | | | | | | | | | When we don't have a beeper, there's no way to signal a 'warble' for panic. So, elide that bit. Second, panic can't use the scheduler and timer because those may not be running (or may have failed), and so it uses a delay loop. Add a configurable scale value to the panic loop so that the LED blinks can be read. For stm32f0 devices, scale that by the sysclk value to automatically make them of reasonable length.
* altos/stmf0: Fix build without second USB IN endpointKeith Packard2016-03-05
| | | | | | The code for the second IN endpoint was using the wrong ifdef. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/chaoskey: Add another USB endpoint to read raw dataKeith Packard2016-03-02
| | | | | | | | | | | This replaces having the single output switch based on a pin value and allows us to box the device and still fetch raw data. For now, this will use a special libusb2 program, ao-chaosread, to pull bits as I haven't figure out how to make linux provide two /dev entries for one USB device. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Use device ID as usb serial number if requestedKeith Packard2016-02-15
| | | | | | | | This exposes the hardware device ID (which is unique per-chip) as the USB serial number, avoiding the need to create a custom ROM image for each device. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Fix location of device_id registerKeith Packard2016-02-15
| | | | | | Copied from stm32l and never fixed. Signed-off-by: Keith Packard <keithp@keithp.com>
* Clean up stmf0 adc init.Bart Massey2016-02-08
| | | | | | This better matches the documented cal sequence. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Add missing ao_gpio.cKeith Packard2016-02-07
| | | | | | This contains the code for power managing the GPIO pins Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Allow USB drivers to skip CDC-ACM -specific descriptorsKeith Packard2016-02-07
| | | | | | | | For devices not providing the standard CDC-ACM interface, let them skip the various descriptors and interfaces to provide a more limited set of capabilities. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Add suspend/resume supportKeith Packard2016-02-07
| | | | | | Allow USB suspend to suspend USB, GPIOs and master clock. Signed-off-by: Keith Packard <keithp@keithp.com>