53 Commits

Author SHA1 Message Date
Piotr Esden-Tempski
204eb047b4 Merging pull request #72 Doc
Merge remote-tracking branch 'ksarkies/doc'

Conflicts:
	doc/stm32f1/Doxyfile
	doc/stm32f2/Doxyfile
	doc/stm32f4/Doxyfile
	lib/stm32/f1/Makefile
	lib/stm32/f2/Makefile
	lib/stm32/f4/Makefile
2013-01-09 01:05:37 -08:00
Ken Sarkies
efee94901a CRC moved to common area 2013-01-08 19:58:18 +10:30
Ken Sarkies
e831f4db51 I2C to common area
F2/4 has now I2C3 included
2013-01-08 19:57:19 +10:30
Ken Sarkies
312d887825 IWDG moved to common area 2013-01-08 19:51:49 +10:30
Ken Sarkies
0878a534cd Move usart files to common area
Again added to L1 which is similar to F1
2013-01-08 19:51:08 +10:30
Ken Sarkies
1029597e70 Move DAC to common area
(Note there are now dummy source files dac.c (and others) that are
not compiled but are needed for documentation).
2013-01-08 19:50:22 +10:30
Ken Sarkies
7ec382c7d5 STM32: Moved SPI code into the common area.
Updated the documentation so that it appears in all families
Also added it to the L1 area, but is untested. An addition to the memorymap
allows commonality and a #ifdef added to the spi_common_all code to
exclude the case of SPI3 for L1 and F0 as SPI3 doesn't exist in those.
An rcc dispatch header was added to remove same code from the spi header.
2013-01-08 19:48:52 +10:30
Ken Sarkies
a60ae5044c STM32 DMA: replaced F4 header to match that for F2, and move header and source files to common.
In the header:
- Fix DMA_SxCR_CT: change shift from 18 to 19
For use with the convenience functions:
- Added DMA_SxCR_CHSEL generic values
- Added DMA_STREAM - generic values
- Added dma_if_offset - rather than separating out LISR and HISR
- Added masks
- Added dma_disable_double_buffer_mode()
2013-01-08 08:16:25 +10:30
Ken Sarkies
4ab5c94b90 Proposed deduplication of peripherals, GPIO example
See rambling post on dev list for justification
2012-11-13 18:41:31 +10:30
Karl Palsson
d417666095 Eliminate redundant gpio code from f2/f4/l1
Implemented as per exti2
2012-11-07 21:58:16 +00:00
Karl Palsson
ce8f47e7df Enable nvic and exti support for L1
And include an example that uses it.
2012-11-07 21:54:18 +00:00
Piotr Esden-Tempski
507a1742dc Merge pull request #57 F2/F4 timer merging action
Merge remote-tracking branch 'tdaede/f4-timer'
2012-10-31 13:47:54 -07:00
Piotr Esden-Tempski
6b2ca89f48 Merge pull request #22 fixing usb and f4 alignment issues
Merge remote-tracking branch 'jdk/master'

Conflicts:
	lib/stm32/f1/Makefile
	lib/stm32/f4/Makefile
2012-10-31 13:34:18 -07:00
Thomas Daede
016c74af25 F2 timers are the same as F4 timers, so make the same changes to them 2012-10-31 15:34:10 -05:00
chrysn
f62eee7644 remove nvic.o from stm32/f[24]'s explicit list
this was missed out in 75c216582, see there for details
2012-10-19 19:29:06 +02:00
chrysn
75c2165827 build common .o files everywhere (fixes issue #29)
vector.o, nvic.o, scb.o and assert.o are available on every platform,
but at least some of them differ between the implementations. they
already got built explicityly on some platforms; now adding them to the
common Makefile.include.
2012-10-19 18:56:39 +02:00
chrysn
e20f1c0d8f unify scb (system control block)
these register definitions are common to all cortex mcus. some of the
registers might not be implemented everywhere (especially the floating
point registers), but defining them does no harm.

this modification does not result in any changes in the example
binaries.
2012-10-18 21:45:20 +02:00
chrysn
5afa53f01a drop two-line vector.c dispatchers in favor of central dispatch 2012-10-18 16:29:58 +02:00
chrysn
a69d83d312 unified vector table initialization
the cortex generic interrupts get moved to lib/cm3/vector.c, the
platorms' individual irq names, initialization and handler prototypes go
to platoform specific irq.h files.

as the vector.c file heavily depends on platoform specific headers, it
can't be built once-and-for-all in lib/cm3/, so there are inclusion
stubs in the various architecture dirs; this might be better solved with
Makefile / include path handling.

one particular file is lib/lpc43xx/vector.c; that platform's
initialization code contains an additional section to copy everything
from flash to ram (which probably performs better there). that code
still resides in the inclusion stub, and gets mashed in using defines.
would need a cleaner implementation together with the Makefile solution.

this commit contains some files of the upcoming efm32 branch, from which
it was cherry-picked.

the .bin files produced from before and after this commit only differ in
lpc43xx, where the startup sequence was subtly modified.
2012-10-05 00:55:24 +02:00
Tomaz Solc
fc4047e4b4 Add assert macros to aid in debugging.
Adds libopencm3/cm3/assert.h header that provides assertion check macros
similar to those provided by the standard C library.

Thanks to Nicolas Schodet for help.
2012-10-02 08:48:45 +02:00
Jason Kotzin
fb110dd3e6 stm32 F2/F4 gpio_set_af() fix 2012-09-13 10:43:35 -07:00
Nicolas Schodet
82ef2936a6 Support exceptions on all targets 2012-09-03 20:41:15 +02:00
Nicolas Schodet
74cd991e7e Use a specific symbol for data source address in flash
That way, data source address does not depend on any other unrelated change in
linker script.

This also fixes cases when .data input section is aligned on 8 bytes.  The new
version does not provide any address for the output section so that it is
aligned to the strictest input section.  The _data_loadaddr symbol will
always take this alignment into account.
2012-09-03 20:28:12 +02:00
Nicolas Schodet
2a35377980 Clean up and make linker scripts more uniform
This includes:

 - fix some comments indent,
 - add entry point,
 - align exported symbols,
 - remove unneeded "." assignments.
2012-09-03 19:53:43 +02:00
Piotr Esden-Tempski
3441bba1c4 Changed local build target for library and linker files.
- The library files are now being built into the lib subdirectory of the
  source.
- The linker files for each library are being copied into the lib source
  subdirectory.

Motivation: The relative locations of files in the source directory after make
are now the same as after make install now. This makes it easier to
reuse examples with their makefiles outside of the libopencm3
sourcecode directory.
2012-08-13 15:19:57 -07:00
Nicolas Schodet
12a73ce052 Use ODR instead of IDR to toggle an output GPIO
IDR represents the level on pin input while ODR is the value requested by the
programmer. This makes a difference for example when using the output as open
drain.
2012-05-31 00:08:23 +02:00
Piotr Esden-Tempski
7011d47c70 Mark reg32 variables as used. So that the compiler does not complain. 2012-05-25 17:56:15 -07:00
Piotr Esden-Tempski
3596075ee0 Fixed the linker scripts to be the way Tomaz Solc proposed.
Something went wrong when cherrypicking his commits in the pull request.
Sorry about that. :(
2012-04-25 17:34:07 +02:00
Piotr Esden-Tempski
3b20a5e34e Removed the load address statement from the .bss section.
Otherwise the linker will complain: "section has both a load address and
a load region"
2012-04-24 09:34:39 +02:00
Tomaz Solc
bf65589183 Support for exception handling in linker scripts.
This is needed even in plain C when 64 bit variable (e.g. long long int)
arithmetic is used. For example it is required when newlib is compiled with
--enable-newlib-io-long-long.

Conflicts:

	lib/stm32/f1/libopencm3_stm32f1.ld
	lib/stm32/f2/libopencm3_stm32f2.ld
2012-04-24 09:16:22 +02:00
Gareth McMullin
567faa9b61 Corrected parameters of timer_set_mode() to u32. 2012-04-07 20:31:56 +12:00
Piotr Esden-Tempski
4fbd42148a Added basic exception handling to the stm32 linker scripts. Thanks Mike Smith! 2012-03-18 22:59:31 -07:00
Piotr Esden-Tempski
789ae97212 Some additional LGPL3+ license change cleanups.
Changed the license to LGPL3+ for some makefiles that got ommited in the
previous big patch commit.

Corrected a find and replace error in a linker file.
2012-03-02 15:39:15 -08:00
Piotr Esden-Tempski
43561de329 License change of the library to LGPL, version 3 or later.
Agreed to by all the significant contributors to the library.
2012-03-02 14:44:49 -08:00
Piotr Esden-Tempski
cbef43ddd8 Added set priority group convenience function. 2012-02-24 16:43:37 -08:00
Gareth McMullin
03e44e91e3 Linker scripts provide stack pointer at the top of RAM.
Thanks to Tomaz Solc.
2012-02-12 15:00:09 -08:00
Piotr Esden-Tempski
1a3ad6e998 Added the entry point definiton to all stm32 linker scripts. This allows gdb to reset the target correctly on exit. 2012-02-11 22:24:41 -08:00
Uwe Hermann
9532195e65 More coding-style and cosmetic fixes. 2012-02-06 23:39:06 +01:00
Fergus Noble
ac29b654a9 Fix nasty bug with GPIO alternate function setup on F2/F4 (sorry guys). 2012-02-06 23:08:06 +01:00
Fergus Noble
fae83c43c1 Discard .ARM.exidx section to make newlib 64bit (long long) printf support work. This may need to be fixed if using C++. 2012-02-06 23:08:06 +01:00
Fergus Noble
8cc888a030 Fixing small bug/typo in F2 rcc code. 2012-02-06 23:08:06 +01:00
Piotr Esden-Tempski
c6f30043fd Added UART4 and UART5 gpio definitions for stm32f1. Also corrected the naming everywhere. Both peripherals are UARTS not U_S_ARTS. 2011-11-16 18:17:56 -08:00
Uwe Hermann
d97c937b8e lib: More small fixes. 2011-11-17 00:09:29 +01:00
Uwe Hermann
50f680f3f7 lib/stm32/f2: Coding-style fixes. 2011-11-17 00:09:27 +01:00
Gareth McMullin
7546ad9736 Fixed loading of .data in linker scripts.
This fixes a problem where the linker included some padding
bytes between the end of the .text section (_etext) and the
start of the .data section.

The C runtime copies from _etext, so all static initialised data
was corrupted.  This change forces the .data section to be written
at _etext to avoid this problem.
2011-11-12 21:29:41 +13:00
Stephen Caudle
4c18313da6 Fix alignment issue in data section 2011-11-07 23:23:16 -05:00
Stephen Caudle
d9a76c75c2 Add timer support for STM32F2 & STM32F4 2011-11-02 14:26:36 -04:00
Stephen Caudle
62c105abeb Fix APB1 & APB2 frequencies in STM32F4 RCC table 2011-11-02 14:26:33 -04:00
Stephen Caudle
05bc9d10f1 Add generic STM32F2 RCC clock function 2011-10-31 00:17:53 -04:00
Stephen Caudle
68d2e0d1e3 Fix stm32f2 RCC PLL values for 120MHz 2011-10-30 18:17:33 -04:00