91 Commits

Author SHA1 Message Date
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
0548317683 fix bug resulting from equally named files
the local vector.o files shadowed the ../cm3/vector.c from VPATH,
resulting in empty reset vectors.
2012-10-18 18:54:52 +02:00
chrysn
5afa53f01a drop two-line vector.c dispatchers in favor of central dispatch 2012-10-18 16:29:58 +02:00
chrysn
7c33025c31 Merge branch 'master' into generalizations
Conflicts:
	lib/lm3s/vector.c -- split out to lm3s/irq.h
	lib/stm32/f4/vector.c -- put the floating point initialization code into a function like in lpc43xx
2012-10-17 18:55:54 +02:00
Piotr Esden-Tempski
cb60e37608 Merging pull request #37 Adds hard-float support to stm32f4, with a nice mandelbrot example
Merge remote-tracking branch 'schodet/hard-float'
2012-10-05 13:03:58 -07: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
Daniel Serpell
e4819d3cd2 Enable floating-point coprocessor on reset.
Always enable the floating-point coprocessor with full access on
reset, allowing usage of hard-fp toolchains.
2012-09-27 23:12:18 +02:00
Daniel Serpell
584052c28c Compile stm32-f4 library with floating point support.
This enables hard-float in the compilation of library and examples
for the stm32f40* chips.
2012-09-27 23:12:18 +02:00
Jason Kotzin
fb110dd3e6 stm32 F2/F4 gpio_set_af() fix 2012-09-13 10:43:35 -07:00
Jason Kotzin
34beeae925 USB core updated for reentrance based on Christian Cier-Zniewski's branch 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
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
Mike Smith
5310cd1b57 Flash sector erase requires the FLASH_SER bit set. 2012-02-12 15:00:08 -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
5dce4172a8 Fix bug with F4 clock settings, change HPRE to PPRE. 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
Gareth McMullin
651917aeb4 Added USB example for stm32f4.
Moved clock enable for OTG_FS back into applications.  This and gpio config
are the only differences between f107 and f2xx/f4xx.
2011-12-17 14:11:39 +13: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
0d25aa3fcd lib/stm32/f4: Coding-style fixes. 2011-11-17 00:09:28 +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
c26abb6c25 Add pwr to STM32F4 makefile 2011-11-02 14:26:31 -04:00
Stephen Caudle
5a89d44591 Add initial support for STM32F4 2011-10-31 00:41:19 -04:00