Remove debug leftovers that were causing memory corruption.
Writes of 64 or more bytes from the USB host side caused memory
corruption before this commit.
I've tested it in a STM32L4 board and it is working as expected.
115200 is a much more sane "default" than 38400.
Instead of a mix of 38400 and 115200, just use 115200 in all places.
There's no reason for modern 32bit cpus to be using such old slow
baudrates.
Tested on f1, f4, l1. Replaced some old f1 code that predated some
library support code for this.
HSI is out of spec for reliable USB operation, even though it sometimes
works. stm32-h103 board has an 8Mhz external crystal which should
therefore be used for any USB work.
Originally reported as https://github.com/libopencm3/libopencm3-examples/pull/192
can fixes are compile tested only. I don't have those boards.
f3 i2c is tested on i2c and gives the same results
l1 low power demo seems to have been broken for some time already.
=> should be fixed, but not something I'm going to work on right now.
This example was functionally similar to the "other" example, but had
the actual functional mouse movement disabled. To reduce maintennance
cost with slightly divergent examples, simply drop the less useful
example.
Using GPIOA_IDR directly looks a bit arcane, and the example can benefit
from introducing gpio_get() and how to use it. The stm32f0-discovery
example already does it like this.
Instead of OOCD_SERIAL triggering an attempt to use a specific ftdi based
adapter, introduce common target/interface pairs, OOCD_INTERFACE and
OOCD_TARGET, and an override via OOCD_FILE allowing full control.
Further, attempt to connect to a running openocd instance to flash if possible.
This _will not_ work well if you have multiple openocd instances open at once,
but that's a rare use case.
Examples:
OOCD_INTERFACE=stlink-v2
OOCD_TARGET=stm32f0x
--> openocd ... -f interface/stlink-v2.cfg -f target/stm32f0x.cfg)
OOCD_FILE=board/ek-lm4f120xl.cfg
--> openocd ... -f $(OOCD_FILE) (ie, the variable is passed untouched)
As part of implementing this, correct variables that were always wrong, and
update the openocd flashing commands to use current commands.
This brings in the new ADC api for STM32 parts.
Update to new standardized ADC apis.
Drops pointless channel definitions, uses common names for common functions.
No functional changes.
Based on work in: https://github.com/libopencm3/libopencm3-examples/pull/130
Correctly migrate stm32f103_usb_driver to st_usbfs_v1_driver instead of the
f107 driver.
Fixes: 976720c355
Reviewed-by: Karl Palsson <karlp@tweak.net.au>
Be specifically careful with the usb examples. There is likely some
breakage to be expected, not sure I updated all the drivers to the
correct types for the respective chips.
As found in 6f2b39c1be6a8b9531264d92138dc2629d51cfa0, you can't just register a
control callback by itself, you can only register them in the set config
callback, (or, at least, _after_ set config has been done.
This has been compile tested only for the extra examples that were found to
have this failing pattern.
This has been broken since f87170e when set config started clearing control
handlers to be re-registered by different configurations.
Fix this example to use a set config callback to setup control transfer
callbacks, just like CDC-ACM demos. With this fix, this demo works with
dfu-tool 0.8
Signed-off-by: Karl Palsson <karlp@tweak.net.au>
While some of the examples include a "board.ld" style file, some of them were
pointing to the libopencm3 provided chip specific ld scripts. When
TOOLCHAIN_DIR has been overridden, those paths were no longer valid/correct.