2063 Commits

Author SHA1 Message Date
Karl Palsson
99a79c7a53 docs: make a note of doxygen usage in HACKING
About all we can do to encourage consistency.

Fixes Github issue #256
2016-08-18 23:01:25 +00:00
Karl Palsson
13d430268a genlink: stop silencing errors
The $() form only captures stdout anyway, so explicitly silencing stderr
simply meant we lost useful debug information when things went wrong.
2016-08-18 22:08:59 +00:00
Karl Palsson
53de290fda atmel samd: Basic framework.
Thoughts: should this be a "sam0" family rather than samd?  (Much like Atmel's
own software package lumps all the cortex-m0+ devices in one family)

This was enough to get a basic blinky working at least.
2016-08-18 22:08:58 +00:00
Daniele Lacamera
b9f3f9da49 lm3s: Added linker script for LM3S6965
This is not strictly required, as this part is supported by the
devices.data linker script generator tool.  However, as we're still in
migration for that tool, and this is the first time we're getting proper
lm3s(qemu) support, keep it for now.
2016-08-18 22:08:58 +00:00
Karl Palsson
f20d433e0d devices.data: add lm3s6965 2016-08-18 22:08:58 +00:00
Daniele Lacamera
09a66cd6d9 lm3s: Support basic UART + RCC 2016-08-18 22:07:36 +00:00
Karl Palsson
e2dbcd7653 genlink: use a "generated" prefix on files made
This makes it easier to gitignore them, and clean them
2016-08-18 22:07:36 +00:00
Karl Palsson
374796c1fd devices.data: fix case on stm32f072xb
this is the part on the f072 discovery board.  The devices.data file is
expected to be already lowercased, while the user provided DEVICE= variable is
then lowercased.
2016-08-18 22:07:36 +00:00
Jonas Meyer
06aa6f1b16 devices.data: Add several chips
Added lpc43xx to devices.data

For now all lpc43 chips resolve to their cortex-m4 variant. How m0 should
be handled is to be determined later.

devices.data: add some vf6xx and lm4f support. fix typos

devices.data: added missing lpc13 family group

devices.data: fix lm4f with info from examples

devices.data: add some vf610 info

devices.data: add some entries for examples
2016-08-18 22:07:36 +00:00
Jonas Meyer
6aeb55c5d7 mk rules: Improve behaviour when DEVICE is set to family. Improved Warning
The warning now uses family instead of subfamily, which is available
sooner.
2016-08-18 22:07:36 +00:00
Jonas Meyer
60ca09c61e genlink.awk: no need to make mode a regexp
Since I don't understand regular expressions and don't see how they are
useful in this case I made the mode selection a simple string match
2016-08-18 22:07:36 +00:00
Jonas Meyer
c025dc0327 mk/genlink: change devices.data format to remove gcc specific options
As discussed with karlp on irc the devices.data file should not contain
gcc specific command line options.

For that reason the command line options for gcc are now generated from
the variables CPU and FPU by the rules in the mk directory.

This breaks the genlink tests.

genlink: simplified devices.data

devices.data already had the information about the family name.
By using the first field (by the pattern used to match it) as family name information that data doesn't
have to be provided explicitly. The same data is used to generate the
CPPFLAGS, such as -DSTM32F1

The architectures block of the devices.data file was redundant.

genlink-config.mk uses family and subfamily to figure out which libopencm3
variant actually exists.
2016-08-18 22:07:36 +00:00
Karl Palsson
2db3d290e7 stylecheck: fix deprecation warnings for newer perl
Simply escape the { chars as directed.
2016-08-16 21:23:03 +00:00
Karl Palsson
c94a58e844 stm32f4: dsi: trivial style cleanup 2016-08-16 21:22:53 +00:00
Chuck McManis
b897397ba9 stm32f4: dma2d: Add include files for DMA2D
Adds include files and updates memorymap.h file to
include base address of DMA2D
2016-08-16 20:58:18 +00:00
Chuck McManis
32a91e52ff stm32f4: Add QUADSPI Includes
Adds an include file (and required RCC and memorymap changes)
to address registers in the QUADSPI peripheral on the F4 line
of processors.
2016-08-15 22:44:36 +00:00
Chuck McManis
32f2b5042f stm32f4: dsi: DSI Peripheral include file
Adds the dsi.h file to the f4 path of the library.

Signed-off-by: Karl Palsson <karlp@tweak.net.au>
2016-08-15 22:18:24 +00:00
Eric Kerman
9b642dea2a stm32l0: Add timer support
Signed-off-by: Karl Palsson <karlp@tweak.net.au>
2016-08-15 21:10:07 +00:00
Karl Palsson
614c700edb stm32f0: timers: input capture support rising/falling edges
This is common code for f0234, keep renaming files as has become standard, even
if it's a suboptimal solution.  This doesn't rename the header which was not
renamed for f3.

Reported-by: https://github.com/gtoonstra
2016-08-15 21:10:03 +00:00
Alexandru Gagniuc
6f30e76c61 lm4f: Enable FPU using the vector_chipset hook
Newlib and arm-non-eabi-gcc likes to use the FPU by default on
Cortex-M4F chips. AS a result, do the right thing and enable the FPU
by default.

This fixes issues where code is generated which uses the FPU and
causes the CPU to hard-fault. This change removes the responsibility
of FPU initialization from the application code.

This makes the lm4f consistent with other M4+ devices that enable the
FPU in core library startup code.

Signed-off-by: Karl Palsson <karlp@tweak.net.au>
2016-08-15 20:58:34 +00:00
Chuck McManis
b802bd07b2 stm32f4: rcc: support PLL_SAI and PLL_I2S
Adds the missing enums for the extra clocks on stm32f4x9 parts.

Signed-off-by: Karl Palsson <karlp@tweak.net.au>
2016-08-15 20:58:33 +00:00
Chuck McManis
2614577e5a stm32f4: rcc: Add missing defines for f4x9 series
Adds missing bit definitions only.
Signed-off-by: Karl Palsson <karlp@tweak.net.au>
2016-08-15 20:58:29 +00:00
Karl Palsson
543ac0f23c stm32l1: rcc: drop magic numbers in favour of defines
Use the same mask/shift defines as other families.
2016-08-15 16:13:43 +00:00
Karl Palsson
cf7d0a08ca stm32: rcc_wait_for_sysclk_status should actually wait
Original implementation only checked whether the user had _selected_ the
clock, not whether it had actually switched to the clock or not.  For
almost all cases, this made this function either a no-op, if you _had_
selected the clock, or a blocking loop if you hadn't selected it ahead
of time.

Fixes github issue #687
2016-08-15 16:09:58 +00:00
Karl Palsson
781e4d94ba efm32lg: mark internal function as static
Squelches gcc warnings

Fixes github #686
2016-08-15 15:54:55 +00:00
Karl Palsson
ff7a6fbfd6 stm32l1: rcc: drop deprecated form of clock enables
Trivial, but removes more users of the old style.
2016-08-15 14:38:10 +00:00
Karl Palsson
acda7be167 doc: stm32l1: correct typo in family header 2016-08-15 14:24:16 +00:00
Torsten Raudssus
0cb1db0967 genlink: properly escape regexp special characters
Fixes compatibility with mawk, as used on debian and ubuntu now.
2016-07-08 22:24:48 +00:00
Lukas
18e15c133d gpio: stm32f: Fix function name in example 2016-07-08 22:20:48 +00:00
Urja Rannikko
d3fff11c1f stm32/desig: fix/cleanup desig_get_unique_id and to string functionality
This was inspired by an Arch Linux provided ARM GCC 5.3.0 bug:
It gave an
"internal compiler error: in expand_expr_addr_expr_1, at expr.c:7736"
with the array version of the desig_get_unique_id.

While I was at it, fixed:
- a potential alignment issue with casting uint8_t* buf to uint32_t*
- a funny static in the string definition that does nothing (given const)
2016-04-11 22:57:55 +00:00
Josef Gajdusek
28592a7ca3 stm32/f3: Build with desig.c 2016-04-09 17:41:36 +02:00
Tido Klaassen
189396c959 stm32f7: fix build failure when CFLAGS is set
Use TGT_CFLAGS instead of CFLAGS in Makefile. Otherwise build will
abort when CFLAGS is passed to the build process by make option or
environment.
2016-04-08 05:38:12 +02:00
Cem Basoglu
6b5150a4dc stm32: usart-v2: Extended USART functions (data/pin inversion, half duplex)
Includes receive timeout, all inversions and duplex and convenience functions.

Applies for F0 and F3 so far.
2016-04-01 22:49:18 +00:00
Karl Palsson
2c1757d269 Revert "NOUP: stm32f3: rcc: provide async osc checks"
This reverts commit aa5e108553ace3079c6087dec796b9e58fe45fa4.

This commit was not meant to land yet, it should have gone for review, and
doesn't yet include all the parts it should touch.
2016-03-30 17:38:13 +00:00
Karl Palsson
a3998563cd NOUP: FIXME: flag next work 2016-03-30 16:59:58 +00:00
Karl Palsson
aa5e108553 NOUP: stm32f3: rcc: provide async osc checks
replace bulky hardcoded wait for set and wait for clear with a single asynch
routine.  Leave the blocking routines in for compatibility at this point.

NOUP: should be added to other rcc.c files too.
2016-03-30 16:59:57 +00:00
Karl Palsson
0b84540ecb stm32l4: add common timer code. 2016-03-30 16:59:57 +00:00
benjaminlevine
69a3ba6e2a stm32l4: flash: support basic core operations
Heavily reformatted by: Karl Palsson <karlp@tweak.net.au>
Signed-off-by: Karl Palsson <karlp@tweak.net.au>
2016-03-30 16:59:57 +00:00
Karl Palsson
c5b00c3dda stm32l4: rcc: MSI range handling 2016-03-30 16:59:57 +00:00
Karl Palsson
97d644c4d3 stm32l4: rcc: Add core functions
Based on STM32L1, and rather a lot of duplication unfortunately.
2016-03-30 16:59:57 +00:00
Karl Palsson
b69916837e stm32l4: rcc: missing pllp definitions
These are important for implementing the PLL helper functions.
2016-03-30 16:59:57 +00:00
Karl Palsson
9047b8c5f4 stm32l4: rcc: correct register name
Use the same name as the reference manual and the same name as other parts.
2016-03-30 16:59:57 +00:00
benjaminlevine
d60fd7ca94 stm32l4: pwr: basic core functionality
Only support for voltage range setting.

Signed-off-by: Karl Palsson <karlp@tweak.net.au>
2016-03-30 16:59:57 +00:00
benjaminlevine
326899b05b stm32l4: pwr: include register definitions.
Reviewed and edited for consistency.
2016-03-30 16:59:57 +00:00
Karl Palsson
c56bed6e1a stm32l4: Add header base for doxygen 2016-03-30 16:59:57 +00:00
Karl Palsson
04e784d332 stm32l4: gpio: fix doxygen markers
Reported-by: @benjaminlevine
2016-03-30 16:59:57 +00:00
Karl Palsson
0e40d6da02 stm32l4: gpio: Correct ASCR name to match ref manual
Be consistent, not sure why I left off the R originally.
2016-03-30 16:59:57 +00:00
Karl Palsson
f6c7d92c4f stm32l4: enable FPU in chipset specific startup.
Helpful if you don't like seeing:
(gdb) vecstate
HardFault: forced due to escalated or disabled configurable fault (see below)
UsageFault due to access to disabled/absent coprocessor
2016-03-30 16:59:57 +00:00
Karl Palsson
1755098617 stm32: adc-v2: pull up voltage regulator control.
L4 and F3 actually have the same bits to write in the same order, but F3 hides
the name of the deep power down bit.  Keep the like that for now, but there's a
standard API for enabling and disabling the regulator.
2016-03-30 16:59:56 +00:00
Karl Palsson
f40e34680b stm32: adc-v2: pull up regular sequence setting.
Uses more standardized naming, fills in some missing defintions, removes some
redundant definitions.
2016-03-30 16:59:56 +00:00