Commit Graph

215 Commits

Author SHA1 Message Date
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
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
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
a6c183d470 vf6xx: merge gpio/uart examples
The plain "uart" example was just a slightly less featured version.
Compile tested only!
2015-07-16 17:17:12 +00:00
Stefan Agner
1123768e78 vf6xx: add GPIO example
This example muxes two pins as GPIO and enables one GPIO (logical
high). The other GPIO is then read in the main loop. One can use
a jumper to bridge the two GPIOs to see that also reading succeeds.
2015-07-16 17:10:11 +00:00
Stefan Agner
0b9e7d0d5d vf6xx: add UART example
The UART's baud rate is calculated using the current clock
configuration from the clock module. This example makes use
of the standard C library and writes the characters to the
UART in blocking mode.
2015-07-16 17:10:11 +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
Priit Laes
48b2f10e66 [BUILD] Report proper error when linker script cannot be found. 2015-06-28 22:53:55 +03: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
Piotr Esden-Tempski
51dda90570 [stm32f429i-discovery] Replaced the ctrl-c handler in console for a shorter version.
Thanks to ChuckM for that.
2015-02-05 16:34:36 -08:00
Piotr Esden-Tempski
8c6eb9ca57 [stm32f429-discovery] General sweep to fix style according to make stylecheck. 2015-02-04 20:39:32 -08:00
Piotr Esden-Tempski
c06aba1603 Removed the use of ITM_Sendchar. 2015-02-04 17:07:57 -08:00
Chuck McManis
0a863789b0 Additional cleanup on lcd-serial
Remove the ISR function and remains of the hack in lcd-spi.c and
convert console.c to use the LOC3 system reset code rather than
the hack which only works on the F4 as it turns out.
2015-02-04 16:48:36 -08:00
Chuck McManis
5379525a87 Updated the LCD SPI
Now that I know a bit more about how SPI is working on the STM32F4
I removed the egregious hack and replaced it with some cleaner code
for driving the LCD. On the positive side it gets a faster update
rate on the screen.
2015-02-04 16:48:18 -08:00
Chuck McManis
b76c30cdb0 Fixups 2015-02-04 16:34:03 -08:00
Piotr Esden-Tempski
d29e4d2b7c [stm32f429i-discovery] Moved Chucks remaining examples to the correct directory.
Additionally added Chucks readme to the stm32f429i-discovery board
readme.
2015-01-22 18:38:16 -08:00
Piotr Esden-Tempski
86c42bc2dd [stm32f429i-discovery] Switched over to UART1.
UART1 is connected through two jumpers to the programmer chip on the
board. Making the use of it very streight forward.
2015-01-22 18:27:28 -08:00
Piotr Esden-Tempski
d6cb05d792 [stm32f429i-discovery] Moved Chucks usart irq example to usart irq console.
Chucks irq example is more elaborate than the ported one so we keep
both.
2015-01-22 16:08:28 -08:00
Piotr Esden-Tempski
fbcb1ca66e [stm32f429i-discovery] Moved Chucks example to usart_console
Chucks example is more elaborate than the simple ported example so we
keep both.
2015-01-22 16:05:48 -08:00
Piotr Esden-Tempski
ed4bec540c [stm32f429i-discovery] Removed Chucks blink example. 2015-01-22 15:57:20 -08:00
Piotr Esden-Tempski
c18a16d979 [stm32f429i-discovery] Merge and delete systick blink example.
Added Chucks improvements to the systick example into the ported one.
2015-01-22 15:51:20 -08:00
kbob
7629bb01e6 Switched from USART 2 to USART 1. 2015-01-21 02:00:08 -08:00
Piotr Esden-Tempski
71b2c1991f [style] Trailing white space fixes. 2015-01-20 16:27:50 -08:00
Piotr Esden-Tempski
ea5af55b92 [stm32f4-discovery] Reverted addition of console. 2015-01-20 16:18:43 -08:00
Chuck McManis
a3ff2c9250 Intermediate step in the examples tree, looking to get USB working correctly on the
429 still
2015-01-20 16:12:57 -08:00
cmcmanis
e4d106dce6 Updated to use the new rcc_periph_clock_enable code 2015-01-20 16:12:57 -08:00