Commit Graph

72 Commits

Author SHA1 Message Date
Piotr Esden-Tempski f8734dfcd3 [STM32F3] Move the f3 specific stuff out of common. 2013-07-07 16:01:50 -07:00
Federico Ruiz Ugalde efe08e4898 stm32f3: flash_common_f24 now includes f3 support. Also, renamed to f234.
- Makefiles of other stm32s updated accordingly.
- f3/rcc.c updated to some definition changes.
- f3/flash.c removed in order to use flash_common_f234.c to comply with new organization.
2013-07-07 16:01:49 -07:00
Federico Ruiz Ugalde 3af5833b83 Initial support for stm32f3. Changes in makefiles, gpio.
- Makefiles now include building f3 src directory.
- Gpio support added. gpio_common_f24 changed to support also f3.
- f3 still not compiling, but f2 compile not broken (probably also f4).
2013-07-07 16:01:45 -07:00
BuFran 035c67ced6 Add preliminary support for Cryptographic coprocessor on stm32 F2 and F4 2013-06-30 21:20:42 -07:00
Piotr Esden-Tempski 39fa9e4c58 Stile fixes run, 80 char boundry. 2013-06-12 21:07:35 -07:00
Piotr Esden-Tempski 34de1e776e Changed to use stdint types. 2013-06-12 19:11:22 -07:00
Piotr Esden-Tempski 7df63fcae0 First coarse run to fix coding style in locm3.
Added --terse and --mailback options to the make stylecheck target. It
also does continue even if it enounters a possible error.

We decided on two exceptions from the linux kernel coding standard:
- Empty wait while loops may end with ; on the same line.
- All blocks after while, if, for have to be in brackets even if they
  only contain one statement. Otherwise it is easy to introduce an
  error.

Checkpatch needs to be adapted to reflect those changes.
2013-06-12 18:22:56 -07:00
Mikhail Avkhimenia 15e35d5bc1 [stm32] Added basic support for hash processor
Added hash processor register definitions and main functions. Hash
processor is supported in stm32f21, stm32f41 and stm32f43 and can be
used to calculate Md5 and Sha1.
2013-06-02 18:23:49 -07:00
Fergus Noble b039504494 Moving stm32 f2/f4 flash code into the common area. 2013-05-10 18:34:55 -07:00
Nicolas Schodet b2df978eae Add support for static constructors and destructors 2013-04-24 22:49:25 +02:00
Ken Sarkies 5b8953124e This mainly moves the STM32 timers' code to the common area.
F2 and F4 have a common section to deal with the options register (TIM2 and TIM5 only)
L1 has been made common with timer_common_all as its options register has very different settings to F2/F4. Code is in the L1/timer.c L1/timer.h files

Note that F3 and F05 timers should fit into this scheme, with F3 having additional features.

Bundled with this is L1/pwr.h to change a documentation setting
Also all the Doxyfiles have added "ENABLE_PREPROCESSING = NO" to fix a problem introduced by commit 118.
2013-03-09 14:39:01 +10:30
Ken Sarkies a9a85f080b Add test in common headers for improper inclusion of such files in application.
(prevents inclusion and also issues warning)
Changes to some source files to remove references to common headers.
Changes to rng.h to make guard symbols the same in f2 and f4.
2013-03-07 18:35:04 +10:30
Ken Sarkies e2022f5884 Repair to documentation (most documented files)
to remove errors, duplications and inconsistencies.
File lib/stm32/f1/pwr.c - all code removed as it duplicates that in common/pwr_common.c
Remaining changes do not affect code. Compiles OK.
TODO efm32 has no code so generates no modules
TODO F2 needs pwr.c
TODO L1 needs dma.h and dma.c
2013-03-07 11:14:06 +10:30
Piotr Esden-Tempski 7cd9b43529 Fix all warnings for stm32f2 lib. 2013-02-26 17:17:43 -08:00
Piotr Esden-Tempski b0233ae6fb Added more warning CFLAGS to all makefiles. 2013-02-26 16:42:20 -08:00
Piotr Esden-Tempski 5e7ec39440 FLASH: Make sure that the flash unlock register state is cleared before trying to unlock the flash. 2013-02-26 15:25:55 -08:00
Piotr Esden-Tempski 6eef01ce26 Merge pull request #84 "Pr flash reg rename"
Merge remote-tracking branch 'karlp/pr_flash-reg-rename'

Conflicts:
	include/libopencm3/stm32/l1/flash.h
2013-02-18 14:09:31 -08:00
Karl Palsson 316b068cb4 [flash] f2: use "proper" bit definition naming.
Part 3 of 4: updated f2 to use flash_<reg>_bit instead of just
flash_bit
2013-01-23 13:58:11 +00:00
Karl Palsson e5b3250382 [stm32] Support the "new" BCD style RTC peripheral
Add the register definitions and some of the most basic helper functions
for the new style BCD RTC module found on the F2, F4, L1, F3 and F0.

This tries to keep as close to HACKING_COMMON_DOC as possible, while
maintaining sane names.
2013-01-22 23:55:59 +00:00
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