Commit Graph

180 Commits

Author SHA1 Message Date
Karl Palsson
9577cd71eb stm32f0: eliminate outdated comments
Fixes: https://github.com/libopencm3/libopencm3-examples/pull/229
2021-11-17 12:48:23 +00:00
Piotr Esden-Tempski
3a8911627d Corrected the clock lookup table.
Due to copypasta we were using the hse table for hsi clocks.
2021-06-20 00:54:16 -07:00
Piotr Esden-Tempski
991bb45710 stm32f429i-discovery/spi: Fixed an OBO index bug. 2021-06-19 02:19:47 -07:00
Piotr Esden-Tempski
4cfc75f715 i2c_stts75_sensor: Replaced the depricated define with number. 2021-06-19 02:19:47 -07:00
Piotr Esden-Tempski
66d622aa7e Fixed an unintended fall through bug. 2021-06-19 02:19:47 -07:00
Piotr Esden-Tempski
e599e34073 Updated all rcc_clock_setups to use the new lookup tables.
The old "one function per config" system is depricated for quite a while
now...
2021-06-19 02:19:47 -07:00
Piotr Esden-Tempski
02f48ef616 Corrected the linker script selection for l0 & l1 examples. 2021-06-19 02:19:47 -07:00
Piotr Esden-Tempski
520e7523ec Updated to the new DAC api. 2021-06-19 02:19:47 -07:00
Piotr Esden-Tempski
0bbafd690a stm32vl-discovery: Corrected linker script. 2021-06-19 02:19:30 -07:00
Santiago Piccinini
882f5b7d1b stm32: cdcacm: fix array out of bounds write
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.
2021-01-24 11:02:40 -03:00
Jeff Kent
4b4115fd72 stm32f429: lcd-dma: Fix LCD clock shift
RCC_DCKCFGR was missing a shift for register write
2020-12-19 00:29:47 +00:00
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
e0f377fec0 stm32f4: use new rcc_clock_setup_pll()
Batch replaced to use new api.  User code doesn't need this, but
examples should be up to date, and this avoids deprecation warnings.
2019-06-02 20:39:56 +00:00
Karl Palsson
4f4e6f9ef2 stm32f4: use 168MHz instead of intermediate 120MHz
120MHz is being removed in the library.
2019-06-02 16:02:43 +00:00
Karl Palsson
fed62e7ef4 stm32l1: button-irq-printf: add syscfg clock.
Not strictly required as we're using port A out of the box, but makes
for bad example code, when the syscfg clock is required for selectin
exti sources other than port A.
2019-06-01 16:20:13 +00:00
Karl Palsson
c9fe1da748 stm32l4: include missing makefile
Fixes: b8b97209 stm32l4: basic uart/exti/led/clock demo

which introduced the l4 example, but left out the makefile.include file
and didn't add it to the root build.

Reported at: 2a7e4fac14
2019-05-27 11:23:46 +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
b7aac4bc76 stm32f4/usart: use 115200 baud rate
38400 is uncommon and slow.  Just live in the modern world of at least
115200.
2018-10-07 13:43:21 +00:00
Karl Palsson
3527ce407e stm32f3: usb: use proper clocks
Don't use the HSI clock, that's not specced for USB use.
Also, drop the unnecessary delays that were working around old bugs.
2018-08-29 10:32:56 +00:00
Karl Palsson
8faca31dc5 stm32f3: update examples for new library code 2018-08-29 10:32:56 +00:00
Nicolas Schodet
5b30e3d98d Fix usage of USB_VBUS
USB_VBUS is not an alternate function, it is an additionnal function which is
always enabled.

If configured as an alternate function, it will draw current from VBUS.
2018-07-03 22:42:44 +00:00
Markus Barenhoff
ce364386d6 stm32f429: allow using all of ram 2018-07-03 22:38:04 +00:00
Karl Palsson
4ddb9db8b9 update linker scripts to use common generic files 2018-05-02 11:01:28 +00:00
Karl Palsson
8c6c8720bf stm32f3: cdcacm: fix grossly misleading comments 2018-05-01 22:14:26 +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
b8b9720926 stm32l4: basic uart/exti/led/clock demo
No miniblink, let people interpret a more useful example.
2018-03-04 00:24:39 +00:00
Karl Palsson
85be1e5e7b update to current library
Minor api changes required.
2018-03-03 21:42:52 +00:00
Peter Mortensen
6e71b9dea8 stm32f0: miniblink: update comments to match code
Brought the comments up to date wrt. the actual code (inconsistency removed).
2018-01-08 10:02:47 +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
d6876b1f77 f3:i2c: use printf and update docs
Preparations for updating the tree was making sure the existing example
worked :)
2017-09-01 23:01:56 +00:00
Sergey Alirzaev
fc60651b6a stm32f4-discovery: add new board revision 2017-08-25 14:55:45 +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
Karl Palsson
d2abd471a5 stm32: timer: further clarify example commentary
The "timer" example is actually "the same" for both f1 and f4.  Do a
sanity sweep over the commentary, remove all vestiges that this was
cloned from a motor control example, and synchronize both examples.

Future work should extract the common portions "somewhere" but at least
make them consistent for now.
2016-12-16 22:41:15 +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
Karl Palsson
c22200ceb5 stm32f4: clarify input mode comment
Based on irc discussion, make the comment more accurately reflect what
the code is doing.
2016-11-23 17:36:01 +00:00
Karl Palsson
ed6973584c f3: adc: drop the _worst_ of the bad code
The example is pointlessly complicated and includes lots of dead code,
but at least remove the wasteful and confusing references to the
temperature channel as pointed out on github.
2016-10-28 17:39:38 +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
b5fcf55005 stm32f4: switch two examples to linker generation
Proves that the tree can have projects specifying the linker script explicitly,
and also "modern" projects specifying simply the DEVICE= variable.
2016-08-18 22:41:23 +00:00