Commit Graph

156 Commits

Author SHA1 Message Date
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
Trevor Woerner
a5641ab63e cookie_io fixes for gcc-5.3
Using the latest (as of today) gcc-arm-embedded toolchain caused two build
failures similar to:

	error: unknown type name 'cookie_io_functions_t'

These custom IO functions are now protected by a define, so define _GNU_SOURCE
which enables all such areas. This is a libc issue.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
2016-06-17 10:31:56 -04:00
Karl Palsson
8924042d2a stm32f4: timer: correct misleading comments.
Code was correct, comment was badly imported.
2016-05-03 21:14:09 +00:00
Karl Palsson
9f8d37d8c8 stm32f4: usb midi: use unique serial numbers
The unique serial number from the device unique signature block was never used
in any examples.  Add it to the these two usb midi examples, to have a user for
this api available for reference.
2016-04-11 23:24: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
b50cdb56de stm32f0: systick_blink: Robustness and correctness fixes
Update documentation and comments in code to reflect reality.
Ensure that GPIO pin output speed is actually set, to ensure that 48Mhz sysclk
output is functional.
Actually set AF, instead of relying on reset values.
Replace the systick code, the core of this example, with some code that has
less traps and surprises.  Instead of trying to get a direct interrupt x times
per second, and reguarly running into problems with the 24 bit counter limit,
use a method that triggers an interrupt every x ms instead.  Tested MCO and
blink rates with a logic analyser, properly verified working now :)
2016-04-07 22:04:03 +00:00
Fabian Bartschke
ec1d59e344 stm32f4-discovery: correct part number for alternatives
STM32F401 Discovery is labelled MB1115B:
http://www.st.com/stm32f401discovery
2016-01-21 00:08:11 +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
c6af45ba8f [nucleo-f411re] Stylefix. 2015-02-24 19:47:28 -08:00
Chuck McManis
d90d72291a USART with Standard I/O
This example takes advantage of the big Flash memory space and
uses the standard library functions printf, and fgets to
implement a simple interactive application.
2015-02-24 19:44:14 -08:00
Chuck McManis
4837775449 Nucleo F411RE - Simple USART example
Same as the one for other boards
2015-02-24 19:44:14 -08:00
Chuck McManis
8019726f51 Nucleo Examples F411RE 2015-02-24 19:44:14 -08:00
kbob
9cee61f089 [stm32f429i-discovery] Added LTDC DMA example.
This example is just using buffers and built in alpha overlay
functionality to animate a dmond floating on a checker board. After
initializing of the frame buffers only 7 registers are being modified to
implement the animation.
2015-02-24 17:14:57 -08:00
Chuck McManis
22f59c4583 LCD version of the Mandelbrot example
This version is the ASCII one but uses the LCD display
that is attached to the board for a more colorful result.

This example also zooms into a more "interesting" place in the set so
the display stays interesting during the full 100 generations.
2015-02-16 18:13:28 -08:00
Piotr Esden-Tempski
4de8d15303 [stm32f4-discovery] Using WFI instead of nop in the main loop.
WFI (Wait for Interrupt) tells the processor to suspend untill the next
interrupt is called. Better than burning away the cycles with nop.
2015-02-13 16:41:18 -08:00
Piotr Esden-Tempski
ec7c0f318b [stm32f4-discovery] Added timer example for the stm32f4 discovery board. 2015-02-13 16:41:18 -08:00