Commit Graph

64 Commits

Author SHA1 Message Date
Karl Palsson
9830486509 stm32: standard bauds to 115200
See also be1d296 stm32: serial use 115200
In that commit we mostly replaced 38400, now we've cleaned up all of
them to be consistent.
2019-10-24 21:46:56 +00:00
Karl Palsson
6e12785c84 f1:h103: drop incomplete spi example 2019-10-24 21:30:22 +00:00
Karl Palsson
be1d296e2f stm32: serial use 115200 baud rate
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.
2019-06-02 20:51:42 +00:00
Karl Palsson
90262eb880 stm32-h103: use proper HSE for USB
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
2019-04-21 21:50:42 +00:00
Karl Palsson
4ddb9db8b9 update linker scripts to use common generic files 2018-05-02 11:01:28 +00:00
Karl Palsson
301b4f9194 update usb enum return codes
Should have been fixed in commit 85be1e5e7b when we updated the library, but was... missed.
travis caught it after the fact at least.
2018-03-04 13:57:29 +00:00
Karl Palsson
85be1e5e7b update to current library
Minor api changes required.
2018-03-03 21:42:52 +00:00
Karl Palsson
f368819e81 Update to current master library
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.
2017-09-01 23:19:46 +00:00
Karl Palsson
c03b580722 stm32: morse timer: remove WFI where not critical
__WFI is not standardized, though often provided.  As it's not a core
part of this example, drop it.
2016-12-17 00:24:36 +00:00
Karl Palsson
9af2b8c7fb stm32: morse timer: standardize example
Simplify, clarify and synchronize the two morse LED blinker examples.
Prepare for one day extracting the core as common morse example code.
2016-12-17 00:23:10 +00:00
Valentin Ochs
da04ccdf71 stm32: timer: Clarify some misleading comments.
Start clearing up misleading/redundant commentary.
2016-12-16 22:35:22 +00:00
Karl Palsson
1260b16772 timer_reset -> rcc_periph_reset_pulse() replace
timer_reset wasn't fully implemented for all timers on all series, and
was simply a wrapper of the RST bits in the RCC registers anyway.

First part of https://github.com/libopencm3/libopencm3/issues/709
2016-12-16 21:32:36 +00:00
Karl Palsson
833da68c18 f1: h103: drop duplicate usb_hid example.
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.
2016-12-16 21:27:25 +00:00
Karl Palsson
8fae7811a8 stm32f1: ubshid: add re-enumeration forcing.
This makes the demo reliably work on "generic" "other" style f1 boards
out of the box.
2016-12-16 21:27:25 +00:00
Karl Palsson
23001dfbcb stm32f1: hid: drop irrelevant gpio A15 config
Relates to jtag vs swd on some specific board, but not relevant to the
demo.
2016-12-16 21:27:25 +00:00
Roland Hieber
bb8f4699da stm32 button: use more idiomatic GPIO read
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.
2016-10-11 19:51:51 +02:00
Karl Palsson
eb54fbf285 adc: update to standardized calibrate api
Drop leftover code from before they were blocking, unify all to standard
api.
2016-10-01 16:13:45 +00:00
Karl Palsson
fc690fd6c4 upgrade library to latest.
Requires changes to all temperature sensor enabling on f1.
2016-10-01 16:02:26 +00:00
Karl Palsson
bcd7d57c11 make flash: overhaul openocd configuration
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.
2016-08-18 22:41:23 +00:00
Karl Palsson
b227e1609c rules: provide default C and C++ standards
Default CSTD to c99, no default for CXXSTD, but if provided it will be used.

Add required gnu99 flags to projects using gnu styles.
2016-08-18 22:41:23 +00:00
Karl Palsson
30667fe62c rules: rename file only.
Trivial rename, allow vim to properly detect the file as a makefile.
2016-08-18 22:41:23 +00:00
Karl Palsson
2092a6759d update libopencm3
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
2016-04-10 13:49:07 +00:00
Karl Palsson
b22ea8b616 stm32f1: maple LED is on A5.
Fix incorrect RCC port.  Only applies to "maple" not to maple mini.

Fixes github issue #117
2016-01-11 10:01:22 +00:00
Zhiyuan Wan
7322fdcdb9 stm32f103: fix all usb driver
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>
2016-01-03 14:51:12 +00:00
Piotr Esden-Tempski
976720c355 Updated libopencm3 to current master. Made all examples compile again.
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.
2015-12-15 00:56:25 +01:00
Andrew Chen
2314635cf0 Makefile.include: don't override DEFS
Allow examples (such as usart-semihosting) to set DEFS for their own use,
and _then_ add the target definitions.
2015-12-10 15:51:57 +00:00
Karl Palsson
393fe8e449 stm32: usb: register control handlers in config callback
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.
2015-08-23 15:02:34 +00:00
Jan
dd0e48369d stm32f1: fix h103 usbdfu example
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>
2015-08-23 15:02:20 +00:00
Karl Palsson
b7c04b4eee docs: try and clarify that you should look in other directories 2015-07-16 16:30:17 +00:00
Karl Palsson
a023b0a7ca stm32f1: rtc: drop redundant ld script
Now that this is known targetting h103 board, drop the duped ld script.
2015-07-16 16:28:07 +00:00
Karl Palsson
3a06a8d24c stm32f1: other: rtc example is actually for h-103 board
Move it into the directory already available for this board.
No code changes, just clarifies it a little bit
2015-07-16 16:25:46 +00:00
Ken Sarkies
697d4f307a STM32F1xx RTC example: Change usart_send to blocking form to allow time to send characters
Tested with ET-STAMP-STM32
2015-07-16 16:23:43 +00:00
Piotr Esden-Tempski
2583cc54cc [rcc_periph_clock_enable] Using the new rcc enable format.
We are missing handling of stm32l1 AHBLP clock rail.
2015-01-20 15:33:00 -08:00
Piotr Esden-Tempski
1c4ae95729 [README] Coarse sweep to use markup in READMEs.
This should improve online readability of the readme files.
2015-01-19 19:20:12 -08:00
Piotr Esden-Tempski
ab7efee88e [README] Renamed all readme files to indicate markup format. 2015-01-19 19:19:42 -08:00
Piotr Esden-Tempski
397780799a [copyright] Added credit copyright for Laurent. Thanks! 2015-01-19 15:54:08 -08:00
Barattero Laurent
f6a1a3ee14 adding spi exemple to stm32vl-discovery 2015-01-19 15:47:39 -08:00
Frantisek Burian
a265fd4d64 Correct include path in all examples 2014-02-13 19:15:00 +01:00
Frantisek Burian
5bb4d47aae Examples updated to use new rcc_periph_clock_enable function 2014-02-13 19:14:59 +01:00
Frantisek Burian
ffe9376c55 [BUILD] Allow to override FP_FLAGS in make as specified in libopencm3 README 2014-01-09 07:33:11 +01:00
Frantisek Burian
02c35eee70 Make the STM32 Makefile.includes usable from outside the examples tree (Issue #28) 2014-01-06 22:25:55 +01:00
Frantisek Burian
9934e40fe9 [BUILD] Add generic Makefile.rules 2014-01-06 22:25:40 +01:00
Karl Palsson
cc800be89a linker script paths: don't hardcode the path
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.
2014-01-03 21:54:34 +00:00
Onno Kortmann
3efd9f8675 Make the STM32 Makefile.includes usable from outside the examples tree
The Makefile.includes contain a hardcoded ../../../../../libopencm3
path for the TOOLCHAIN_DIR variable. They also contained another copy
of this hardcoded path, that is now generated from $TOOLCHAIN_DIR.

This allows to have a symbolic link to a Makefile.include in an
out-of-tree project and reuse the Makefile infrastructure.
2014-01-03 00:08:01 +01:00
Joshua Harlan Lifton
4505fa1926 Add USB<->serial loopback example to WaveShare Open103R 2014-01-02 23:38:53 +01:00
Joshua Harlan Lifton
b59c0a9e05 Add joystick example to WaveShare Open103R 2014-01-02 23:38:53 +01:00
Joshua Harlan Lifton
d944c0cba6 Port fancyblink example to WaveShare Open103R 2014-01-02 23:38:53 +01:00
Joshua Harlan Lifton
c672f1b329 Port button example to WaveShare Open103R 2014-01-02 23:38:52 +01:00
Joshua Harlan Lifton
f1bb59e19c First working example for the WaveShare Open103R eval board 2014-01-02 23:38:52 +01:00
Frantisek Burian
80ba923da1 [FIX] Populate the STK_CTRL to STK_CSR change 2014-01-02 23:14:09 +01:00