50 Commits

Author SHA1 Message Date
TitanMKD
0dec187fee lpc43xx basic IPC for multicore M4 & M0 (with basic examples for hackrf jellybean). 2013-07-07 13:52:12 -07:00
TitanMKD
edab264704 Added _data_rom / _edata_rom for ld ram only and standard spifi ld Fixed ROM to RAM copy of ".data" 2013-07-07 13:52:12 -07:00
Jared Boone
f4e45e74bc Add a duty cycle count argument to i2c0_init() to adjust for changes in APB1 clock. 2013-07-07 13:52:12 -07:00
Jared Boone
18bcbc3d28 Consolidate ssp_read and ssp_write into a single function, ssp_transfer. SSP bus transfers are bi-directional -- when bytes are written, they are also read. 2013-07-07 13:52:12 -07:00
Jared Boone
25d7853422 Switch ssp.c to using CGU #defines instead of local #defines. 2013-07-07 13:52:12 -07:00
Jared Boone
18d72099a5 Changed ldscripts to use new RAM region names, placed .data/.bss/stack into separate local RAM region.
Added ldscript for RAM-only debugging over SWD or JTAG.
2013-07-07 13:52:10 -07:00
Jared Boone
ffffb71ba2 Added distinct _bss ldscript constant, in case .text and .bss are not contiguous. 2013-07-07 13:52:10 -07:00
Jared Boone
24d8d81b43 Add generated bit/shift/mask #defines for CGU, CREG, RGU, USB (USB0 only) peripherals.
Added script used to generate #defines above.
Fixed one small change in the #define naming scheme in i2c0_init().
2013-07-07 13:52:08 -07:00
TitanMKD
f8542c09a6 UART driver and Example code for JellyBean. 2013-07-07 13:52:07 -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
Nicolas Schodet
b2df978eae Add support for static constructors and destructors 2013-04-24 22:49:25 +02:00
Ken Sarkies
1627cd60c3 Documentation structures added to place the non-STM32 families into the documentation tree.
Actual documentation has not been added. Volunteers?
2013-04-14 15:30:02 +02:00
Piotr Esden-Tempski
9c552e7585 Fix all remaining lib warnings. 2013-02-26 17:32:07 -08:00
Piotr Esden-Tempski
b0233ae6fb Added more warning CFLAGS to all makefiles. 2013-02-26 16:42:20 -08:00
chrysn
99d7b21032 define platform specific constants for all chips
previously, only stm32 chips passed the information about which chip to
build on into the compiler. this information is essential to dispatch,
thus defining LPC13XX, LPC17XX, LPC43XX and LM3S in analogy to
STM32F1..4.
2012-10-19 19:10:42 +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
bc5146b710 unified systick handling
the only change this results in in the example binaries is in the
hackrf-jellybean/systick example, where the the check in
systick_set_clocksource for overflowing from the stm32 area gets used.
2012-10-18 22:48:14 +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
9c13299f25 unified nvic.c 2012-10-18 13:22:12 +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
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
TitanMKD
81317c02ab * Updated GPIO added gpio_toggle() function.
* Fixed ROM to RAM Linker script (libopencm3_lpc43xx/libopencm3_lpc43xx_rom_to_ram.ld).
2012-06-25 22:12:00 +02:00
TitanMKD
d80ee80e06 Merge branch 'master' of git://github.com/jboone/libopencm3 2012-06-16 12:51:44 +02:00
Jared Boone
536c922577 Modified SSP driver to wait for data to be sent before returning. This is critical when controlling device CS# pins via GPIO. Long-term, it might be better to have a different API that permits this level of control. 2012-06-15 17:20:50 -07:00
TitanMKD
c65ca01044 Fix Linker bug copy ROM to RAM & exec from RAM (need more test). 2012-06-13 01:05:49 +02:00
TitanMKD
3c8e76f679 Added ROM to RAM code copy & exec with example of how to use it (miniblink_rom_to_ram). 2012-06-10 11:44:36 +02:00
TitanMKD
8d97dbc7c3 Work on scs.h register and also nvic.h.
ARM Interrupt API (see nvic.h).
ARM SysTick API (see systick.h).
Example using both Interrupt and SysTick and blink LED1/2/3 see systickdemo.c.
2012-06-09 18:27:42 +02:00
Michael Ossmann
251687fe37 changed I2C to run directly from IRC 2012-06-06 22:05:03 -06:00
TitanMKD
8adc873e84 Fixed SSP, tested with Oscilloscope Write work fine (tested SPI Mode).
For more details on tests see ssp/README.
2012-06-06 00:30:25 +02:00
Michael Ossmann
3a4a6b75de resolved minor conflict 2012-06-04 18:00:20 -06:00
Michael Ossmann
e7941eace9 added i2c.c that I forgot earlier 2012-06-04 17:57:49 -06:00
TitanMKD
d7a7fd9d30 * Added SSP Driver (Not Tested).
* Replaced leading space by tabulations.
2012-06-05 01:41:54 +02:00
Michael Ossmann
5698016877 moved stuff out of i2cdemo.c and into drivers/headers 2012-06-04 17:30:08 -06:00
TitanMKD
686c0cf050 Minor fix 2012-06-04 19:13:53 +02:00
TitanMKD
e7fbc2220b Added JellyBean Configuration for PinMux, GPIO In/Out (work in progress).
Added scu driver file scu.c.
Modified Makefile/Makefile.include to generate .map file and use -O2 as optimization.
Modified hackrf-jellybean miniblink.c to enable 1V8 and blink LED1,2&3 with configuration of PinMux and GPIO.
2012-06-02 09:45:03 +02:00
Michael Ossmann
38abe9f01f replaced linker script I accidentally deleted 2012-05-27 23:07:13 -06:00
Michael Ossmann
82181c2cda trying to rm again 2012-05-27 23:02:18 -06:00
Michael Ossmann
27b1597c1a rm renamed file 2012-05-27 20:33:18 -06:00
Michael Ossmann
4c37af55f4 renamed linker script 2012-05-22 14:46:05 -06:00
Michael Ossmann
3a9d48923a semicolons might help 2012-05-22 14:21:11 -06:00
Michael Ossmann
61e162e3d2 Makefile updates 2012-05-22 14:20:39 -06:00
Michael Ossmann
ce14f4c077 updated linker script 2012-05-22 14:15:20 -06:00
Michael Ossmann
5e1bcaa582 gpio.c, vector.c updated for LPC43xx 2012-05-22 13:55:50 -06:00
Michael Ossmann
9439ce9d69 new lib/lpc43xx, starting with copy of lpc17xx 2012-05-22 10:59:27 -06:00