summaryrefslogtreecommitdiff
path: root/src/stmf0/ao_usb_stm.c
Commit message (Collapse)AuthorAge
* 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: 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/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>
* 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 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: 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>
* altos/stmf0: Allocate USB buffers at startupKeith Packard2015-02-28
| | | | | | | This lets the extra allocations used from ao_usb_alloc_buffers be allocated before the first USB connection happens. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Support PA11/PA12 remappingKeith Packard2015-02-01
| | | | | | | | Small pin-count versions of the STMF0 can remap PA11/PA12 on the same pins as PA9/PA10. These are used by USB, so have the USB driver deal with remapping them. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos/stmf0: Add faster USB pathKeith Packard2015-01-26
| | | | | | | | This adds a way to allocate private USB buffers for sending data without needing to copy it again. It requires ensuring that all accesses are 16 bits aligned to 16 bit boundaries. Signed-off-by: Keith Packard <keithp@keithp.com>
* altos: Initial STMF04x supportKeith Packard2015-01-25
Basic clock configuration, OS support, LED and USB drivers. Signed-off-by: Keith Packard <keithp@keithp.com>