Commit Graph

255 Commits

Author SHA1 Message Date
Karl Palsson
daff5b130a update library to latest 2018-05-01 22:26:36 +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
a4eec6026b travis: add basic build check
And a badge to the readme.
2018-03-04 13:30:44 +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
7d6a2e36ee update library to get exti for l4 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
saogalde
bcf608fa54 readme: use full gdb commands
gdb will actually accept as little "tar ext :4242" but use the full
commands to help clarify the intent for people who might not be as
familiar with the syntax.
2018-01-08 10:04:26 +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
Paul Fertser
f4e129cd4a rules.mk: Add cross-reference to the map file
This adds a section to the bottom of the .map file containing the
symbol->object file mapping.  (the logical inverse of the existing
section at the start of the .map file that lists objects, and the
symbols that pulled them in)

Reviewed-by: Karl Palsson <karlp@tweak.net.au>
2017-12-18 12:28:52 +00:00
Paul Fertser
6dbc067b3e Add maximum debugging info to ELF; doesn't affect binary size 2017-12-18 12:17:50 +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
Jelmer Tiete
2107faf5ee rules: drop broken stlink util support
There was an attempt at providing support for the texane/stlink utility.
It has been broken for a long time, referring to missing scripts.
Remove it as clearly unused.
2017-08-25 14:58:41 +00:00
Jelmer Tiete
1f322c1cef rules: flash target helpers had broken script paths 2017-08-25 14:58:20 +00:00
Sergey Alirzaev
fc60651b6a stm32f4-discovery: add new board revision 2017-08-25 14:55:45 +00:00
Chuck McManis
766f89c724 Better Debugging in make
This commit does two things, it removes the "Quiet" flag
from the flash target so you can see what it is trying to
do when it trys to flash your code, and it adds a make
target print-% which can be used to print the resolved
value of make variables (also helpful in figuring out
what it is trying to do).
2016-12-29 15:38:50 +00:00
Karl Palsson
d23bee4f1a docs: mention targets might need GNU awk 2016-12-27 21:43:04 +00:00
Karl Palsson
1b92d46b97 docs: try and clear up how "make flash" works
Likely to be insufficient, but perhaps a start.

See https://github.com/libopencm3/libopencm3-examples/issues/34
2016-12-27 21:41:08 +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
4dfa31f9f8 rules.mk: flash: send full path for existing openocd
When using netcat to send commands to an already existing openocd
session, you must path full paths to the file to flash.  There's no
guarantee that it is running from the same directory as the present
example
2016-10-04 20:25:49 +00: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
9fbac7daaf .gitignore more project files
add intellij (clion/pycharm) and eclipse project files to the ignore
list.
2016-09-02 21:12:28 +00:00
Chuck McManis
da679c1775 [Makefile]: add objects to clean target
Some demos will use object files from a different directory and
those files would not be cleaned by the simple CLEAN rule. This
small change insures that those objects and their dependency files
are also cleaned.
2016-08-18 22:51:55 +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
408b83f47a make: provide "examplesclean" to avoid cleaning library as well
We already have "make examples" and "make lib" but make clean cleans
everything.  Not super useful for end users, but rather handy for people
working on the examples.
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
133a45b734 atmel samd: initial blinky demo
Uses the DEVICE linker and config generation style.
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
Karl Palsson
0f04829415 gitignore generated linker script files 2016-08-18 22:41:23 +00:00
Karl Palsson
de0d4af890 make: enable DEVICE _or_ LDSCRIPT to be specified
First step towards migrating towards generated devices.
2016-08-18 22:41:16 +00:00
Karl Palsson
52b12d5259 update library: pickup devices.data and friends 2016-08-18 22:39:25 +00:00
Karl Palsson
140d0864b8 rules: use TGT_xxx to avoid trampling user vars
As in the main library, instead of constructing and making our own CFLAGS
CXXFLAGS and LDFLAGS variables, use TGT_ for ones we construct, and include any
user provided variables afterwards.
2016-08-18 22:39:25 +00:00
Karl Palsson
4b772a4437 rules: pull up optimization level 2016-08-18 22:39:25 +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
5b35c7d7a1 rules: provide better feedback on missing libraries.
If the library files are missing (haven't been built) it's better to get a
failure message saying that, rather than a failed dependency with no rules to
generated it.

Before: (I'd manually removed the f4 library)
```
$ make clean all V=1
Using ../../../../../libopencm3/ path to library
rm -f *.o *.d *.elf *.bin *.hex *.srec *.list *.map
make: *** No rule to make target `adc-dac-printf.elf', needed by `elf'.  Stop.
```

After:
```
$ make clean all V=1
Using ../../../../../libopencm3/ path to library
rm -f *.o *.d *.elf *.bin *.hex *.srec *.list *.map
arm-none-eabi-gcc -Os -g -Wextra -Wshadow -Wimplicit-function-declaration
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes -fno-common
-ffunction-sections -fdata-sections -MD -Wall -Wundef
-I../../../../../libopencm3//include -DSTM32F4 -mthumb -mcpu=cortex-m4
-mfloat-abi=hard -mfpu=fpv4-sp-d16 -o adc-dac-printf.o -c adc-dac-printf.c
arm-none-eabi-gcc --static -nostartfiles -L../../../../../libopencm3//lib
-T../stm32f4-discovery.ld -Wl,-Map=adc-dac-printf.map -Wl,--gc-sections -mthumb
-mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 adc-dac-printf.o
-lopencm3_stm32f4 -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group -o
adc-dac-printf.elf
/home/karlp/tools/gcc-arm-none-eabi-4_9-2015q2/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld:
cannot find -lopencm3_stm32f4
collect2: error: ld returned 1 exit status
make: *** [adc-dac-printf.elf] Error 1
```

I strongly feel that the latter is far more informative.
2016-04-17 00:21:24 +00:00
Alexandru Gagniuc
07c2326f7e examples/tiva/lm4f: Use correct openocd interface
I'd love to meet the person who managed to use flossjtag interface
with a Stellaris board, but until we can meet, use the correct
interface, which is ti-icdi. Note that this setting is redundant,
since the board config file already specifies the correct interface;
however, OOCD_INTERFACE variable cannot be empty, by virtue of how
higher-level makefiles are written.
2016-04-11 23:27:23 +00:00