| Commit message (Collapse) | Author | Age |
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
This way it can be incorporated into multiple operating systems more easily.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
This also allows us to stop shadowing USB rx buffers in system ram
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This shouldn't have much of an effect, but shows how double buffering
works.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Use the 16-bit USB memory directly, avoiding the buffer space and the copy
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
These counters are only useful for helping debug the USB driver.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
Redefines some stdio bits so that we can build with either pdclib or
newlib + avr stdio.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
If you try this after the UART is running, it won't work.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
This allows other systems to see what baud rate the host has requested.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
And allow application space to be limited to less than available flash.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
It's 8MHz, not 16MHz
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
This allows the system clock to vary at runtime, instead of requiring
a fixed value.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Allow applications to select other configurations.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Mis-placed )
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Tested on timer 2, all four channels.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
ch1 was broken and ch2 didn't have any code at all.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Let applications define HAS_BOOT_LOADER on their own if desired.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Need HSI clock and the flashing functions loaded in ram.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Need the HSI clock running for the flash hardware to work.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
The .bin files are what the DFU utility uses to flash the boot loader
using USB.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
This can't work without a lot more effort.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
| |
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
| |
Allows the use of crystals instead of requiring USB.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|