Commit Graph

976 Commits

Author SHA1 Message Date
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
Piotr Esden-Tempski ecb0cbbf78 Merged pull request #38 Add assert macros to aid in debugging.
Merge remote-tracking branch 'avian2/assert-macros'
2012-10-04 14:18:55 -07:00
chrysn b5de267b06 use _data_loadaddr instead of _etext
this change was done in master in [1] and just merged here.

[1] 74cd991e7e
2012-10-02 12:05:36 +02:00
chrysn 36f95447a8 add back minimal support libraries
some of the libraries removed in [1] were essential to building
anything on efm32 (especially, irq.h).

[1] 4a6f4c0f7d
2012-10-02 11:55:05 +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 aac5909ff1 Add a floating-point example to the stm32f4.
This example calculates a mandelbrot fractal using floating point
in C.
2012-09-27 23:12:18 +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
Daniel Serpell c9ab75878f Add all SCB registers mentioned in ARM DDI 0403D manual.
See table B3-4 and B3-5 for the definitions and B3-24 for the
bit assignments of SBC_CPACR.
2012-09-27 23:12:18 +02:00
Paul Sokolovsky d6e0e6e976 Explicitly link example binaries statically.
This allow good share of binaries be linkable (and actually run) with a
typical distro-packaged ARM toolchain (Cortex-A and Linux targetted).
2012-09-25 00:31:31 +03:00
Nicolas Schodet 7851515c5c Fix merge error
This line was removed in commit acc276a612, but it has been restored in the
merge 02ea612142.
2012-09-17 17:27:50 -07:00
Ken Sarkies ff83a1ae1c Setup to document entire project using doxygen.
New doc directory with config files and generated html, LaTeX/pdf.
Makefile provided for autogeneration and explanatory README.

The project structure is hostile to doxygen, which can't cope with functions
of the same name. Doxygen is run for each family separately, and separately
for LaTeX generation. Customized layout files sort of "integrate" HTML, and
separate pdfs are generated for each family. Not ideal but seems the best
solution until doxygen changes, if at all.
2012-09-15 12:51:46 +09:30
chrysn 4a6f4c0f7d remove the support libraries for efm32
i don't plan to extend or support them, and they'll just grow stale
2012-09-15 01:29:31 +02:00
chrysn 50b3c92d7f removed efm32lib examples
they would have needed migration work from efm32lib to emlib, and depend
on non-free cmsis anyway.
2012-09-13 23:41:52 +02:00
chrysn 0508f30d2d Merge branch 'master' into efm32
Conflicts:
	Doxyfile
	Makefile
2012-09-13 22:32:28 +02:00
Jason Kotzin e8ec29e636 Adding vendor class definition 2012-09-13 10:43:35 -07: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
Jason Kotzin 4958fae906 fixing usb and alignment issue 2012-09-13 10:43:26 -07:00
Piotr Esden-Tempski dcd98dde86 Renamed adc example to be more descriptive. 2012-09-10 14:01:24 -07:00
Piotr Esden-Tempski d1cc8ca2b3 Added simple adc example for lisa/m 2. 2012-09-10 14:01:23 -07:00
Piotr Esden-Tempski 7373bfcb9b Merging pull request #26 "Linker script cleanup/improvements"
Merge remote-tracking branch 'schodet/linker-script'
2012-09-10 13:42:10 -07:00
Piotr Esden-Tempski 03807ddd6c Merge pull request #27 "added a make target stlink-flash to use the stlink on the stm32f4-disovery"
Merge remote-tracking branch 'twaldecker/stlink'
2012-09-10 12:29:37 -07:00
Piotr Esden-Tempski 02ea612142 Merge pull request #25 "Add support for C++ and fix some comments typo"
Merge remote-tracking branch 'schodet/master'

Conflicts:
	include/libopencm3/stm32/f1/adc.h
2012-09-10 12:21:21 -07:00
Oliver Dille 099a5626db Random number generator example. 2012-09-07 22:43:10 +02:00
Oliver Dille e99896120b Random number generator register definitions. 2012-09-07 22:03:36 +02:00
Thomas Waldecker 5604182467 added a make target stlink-flash to use the stlink on the stm32f4-disovery 2012-09-06 11:33:01 +02: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
Nicolas Schodet 5ad8f26ede Fix comments typo 2012-09-02 17:15:13 +02:00
Nicolas Schodet 3aab6220d8 Add C linkage declaration for C++ usage 2012-09-02 17:12:58 +02:00
Ken Sarkies 9af50d6e5c STM32F1xx Additional minor changes to adc.h and adc.c 2012-08-31 21:47:30 +09:30
Ken Sarkies acc276a612 ADC documentation added
In adc.h additional defines needed to assist documentation - lines 172-191
added, and 384,436-451 are duplicates of earlier defines to complete
parameter sets (compiler has no trouble with these).

Minor doc corrections to other files.

No code changes (apart from additional defines).
2012-08-31 09:54:31 +09:30
Piotr Esden-Tempski 11727f56c9 Minor build system fixes. 2012-08-25 19:53:15 -07:00
Piotr Esden-Tempski d98dab6ae2 Merging pull request #23 Changed markup to get more control over documentation.
Merge remote-tracking branch 'ksarkies/doc'
2012-08-25 15:16:50 -07:00
Piotr Esden-Tempski f71742c5da Merging #18 pull request. Adding nvic documentation.
Merge remote-tracking branch 'ksarkies/nvic'
2012-08-25 15:10:01 -07:00
Ken Sarkies 52533a6e3d STM32F1xx: Changed markup to get more control over documentation, each
file having its own group module rather than using @file.

No code changes except for the following:

gpio: Added function to map the eventout signal plus two Remap functions
dma: Prevent changing base addresses while channel enabled (see datasheet)
pwr: Added pwr.c (new file)
timer: Removed the last function that I introduced recently; there is already
an equivalent function present. Changed some parameter names for consistency.
2012-08-20 17:19:20 +09:30
Ken Sarkies e4bcceaa8f And a bit more doc mods 2012-08-18 16:19:47 +09:30
Ken Sarkies 95126e8cd3 Tiny doxygen mod to get all constants to show in doc output 2012-08-18 16:05:17 +09:30
Ken Sarkies 70b2376c9f Update to doxygen comments to fix promiscuity problem (see later) 2012-08-18 13:32:48 +09:30
Piotr Esden-Tempski fa5d689f78 Use make wildcard command for source dir detect. Library path fix.
Thanks ni!
2012-08-14 17:48:23 -07:00
Ken Sarkies 0e5e451e22 Revert nvic_set_priority to original form. Minor doxygen markup changes. 2012-08-14 18:25:19 +09:30
Ken Sarkies cb07ab7c6e Merge branch 'master' into nvic 2012-08-14 14:47:22 +09:30
Piotr Esden-Tempski b82e7eee52 Examples detect if they are being built in src dir.
If an example is in the libopencm3 source directory it will use the
locally built library instead of the system library.

When you copy an example out of the libopencm3 tree it will
automatically detect it and build using the system wide installation.
2012-08-13 15:29:01 -07: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
Piotr Esden-Tempski a2c5b6391d Merging pull request #19 "STM32F timers. Doxygen markup added, and some code changes" by Ken Sarkies.
Merge remote-tracking branch 'ksarkies/timer'
2012-08-11 14:00:06 -07:00
Ken Sarkies 52fd7c7976 STM32F timers. Doxygen markup added, and some code changes:
1. Remove the extra mask (TIM_DIER(timer_peripheral) & flag)
in timer_get_flag. Not all flags in SR relate to IRQs and the flags that
do might be useful even if interrupts not enabled.

2. In a number of functions (e.g. timer_set_output_idle_state) that only
apply to advanced timers, add test for TIM1 and TIM8, as done in some others.

3. Added timer_force_event to manipulate the EG register

TBD DMA burst - can't get my head around why this would be useful.
Someone must have thought so!
2012-07-10 09:32:47 +09:30
Ken Sarkies 9cff0c962b Fix compile error 2012-07-09 17:12:27 +09:30
Ken Sarkies cba9561e89 NVIC_Set_Interrupt_Priority: change to use 4-bit fields.
(viz STM32F10xxx Cortex-M3 programming manual PM0056 and
Cortex-M3-Generic-User-Guide.pdf)

Doxygen commentary added
2012-07-09 16:54:01 +09:30