1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

339 Commits

Author SHA1 Message Date
22252337b6
cortexm_common: simplify FPU guards
The FPU is only enabled on platforms where it is available. The extra
checks for these platforms are redundant and removed here
2020-09-03 21:00:40 +02:00
Leandro Lanzieri
2e79e00ca7
treewide: change Kconfig prefix for module symbols
This changes the prefix used for the symbols that reprensent modules
(not the ones generated from USEMODULE).

MOD_ => MODULE_
2020-08-31 09:57:28 +02:00
Francisco
f963089b28
Merge pull request #14718 from bergzand/pr/cortexm_common/hard_fault_add_thread_info
cortexm_common: Add thread info to hard fault handler
2020-08-26 12:40:25 +02:00
0d484f4d3a
cortexm_common: Add thread info to hard fault handler
While the hard fault handler prints the offending program counter, it
does not print information about the context triggering the hard fault.
This commit adds a line printing the thread ID and name that triggered
the hard fault. If the hard fault is triggered during an ISR, it only
prints that the hard fault happened during ISR context, not which ISR
triggered it.
2020-08-26 11:42:07 +02:00
Keith Packard
e215261ced picolibc: Use most NEWLIB code with picolibc
In most places, picolibc and newlib are the same, so use
the existing newlib code when compiling with picolibc.

Signed-off-by: Keith Packard <keithp@keithp.com>
2020-08-24 08:26:16 -07:00
Keith Packard
531050ada2 picolibc: Enable TLS support [v4]
Allocate and initialize a thread-local block for each thread at the
top of the stack.

Set the tls base when switching to a new thread.

Add tdata/tbss linker instructions to cortex_m and risc-v scripts.

Signed-off-by: Keith Packard <keithp@keithp.com>

---

v2:
	Squash fixes

v3:
	Replace tabs with spaces

v4:
	Add tbss to fe310 linker script
2020-08-24 08:26:16 -07:00
ff3bee24b9 picolibc: Provide integration into the build system [v3]
Support for picolibc as alternative libc implementation is added with
this commit. For now only cortex-m CPU's are supported.

Enable via PICOLIBC=1

---
v2:
	squash fixes in

v3:
	Remove picolibc integer printf/scanf stuff from sys/Makefile.include,
	it gets set in makefiles/libc/picolibc.mk

fixup for dependency
2020-08-23 13:12:57 -07:00
e2d8d40792
cortexm_common: Enable MPU after configuring regions
Reordering this ensures that the MPU regions are configured before
enabling the MPU and restricting the memory access.
2020-08-21 13:38:59 +02:00
2f30aaaf06 cpu/cortexm_common: use mpu stack guard if DEVELHELP is enabled 2020-08-18 10:26:21 +02:00
Marian Buschsieweke
aeedb3ad16
cpu/cortexm_common: Don't access sched_active_*
Replaced accesses to sched_active_* with API calls in C files
2020-08-17 11:27:52 +02:00
Leandro Lanzieri
7dc6639f59
cpu/cortexm_common: add default Kconfig configuration 2020-08-12 12:22:43 +02:00
Leandro Lanzieri
b98527ef53
cpu: Add 'periph' module to Kconfig
Select it from cortexm_common module as it is always needed.
2020-08-12 12:22:39 +02:00
Leandro Lanzieri
2d53003ee2
cpu/cortexm_common: Model cortexm_common modules
This models cortexm_common and cortexm_common_periph modules.
2020-08-12 12:22:39 +02:00
Marian Buschsieweke
234a720571
Merge pull request #14516 from benpicco/bitband_hw
cortexm_common: fix check for bitbanding feature
2020-08-08 14:26:49 +02:00
Martine Lenders
b1bf8ab981
Merge pull request #14565 from bergzand/pr/sched/fix_retrigger
sched: Prevent retriggering the scheduler interrupt during idle sleep
2020-07-28 22:11:25 +02:00
d59233baf1
Merge pull request #14556 from benpicco/bitarithm_test_and_clear
core/bitarithm: add bitarithm_test_and_clear()
2020-07-28 10:11:47 +02:00
benpicco
f3bce19646
Merge pull request #14503 from maribu/cpp-feature
build system: Add libstdcpp feature and doc
2020-07-23 19:05:10 +02:00
Benjamin Valentin
a8904edd7d core/bitarithm: add bitarithm_test_and_clear() 2020-07-21 16:03:59 +02:00
fc1d642113
cpu/cortexm_init: add specific case for stm32g0 svcall irq 2020-07-21 12:45:25 +02:00
0b549c6e0c
Merge pull request #14152 from aabadie/pr/pkg/stm32cube
pkg/stm32cmsis: retrieve STM32 CMSIS header from a package
2020-07-21 12:27:19 +02:00
0eb66a429f
cortexm_common: Clear PendSV request after idle sleep
The PendSV interrupt is used to request a scheduling operation. An
interrupt during the idle sleep can re-request the PendSV interrupt,
while the PendSV is still busy scheduling the next thread. This clears
the request after sleep to prevent triggering an extra PendSV interrupt
after the current PendSV handler finished.
2020-07-21 11:23:49 +02:00
Leandro Lanzieri
c71c2b79a7
cpu/arm7_common: Add Kconfig symbols
HAS_ARCH_ARM features now is moved to Kconfig.features as it is being
used by multiple architectures.
2020-07-16 19:03:38 +02:00
1f0a3a6bae
cpu/cortexm_common: add special case for SVC interrupt configuration
by default stm32f0/l0/l1 families simply call the interrupt enum SVC_IRQn
2020-07-16 17:35:48 +02:00
Benjamin Valentin
95ec5890b0 cortexm_common: fix bit-banding check
Not all MCUs ≥ Cortex-M3 provide the Bit-Banding feature.
It is up to the manufacturer to implement it.

Instead, rely on the CPU_HAS_BITBAND being set in `periph_cpu.h`.
2020-07-16 14:44:28 +02:00
eec7aa2e42
cortexm_common: disable IRQ during thread_sched_idle
A race condition is present where an IRQ is serviced between the
priority increase of the PENDSV and the sleep. When the IRQ
is serviced before the WFI sleep, the core will sleep until the next
IRQ and the thread activated by the IRQ will not be scheduled until
a new IRQ triggers.

This commit wraps an IRQ disable and restore around the priority
modification and sleep to prevent interrupts from being serviced until
the WFI call returns.
2020-07-16 11:11:15 +02:00
Marian Buschsieweke
cf482c5d46
build system: Add libstdcpp feature and doc
- Add libstdcpp feature to indicate a platform is providing a libstdc++
  implementation ready for use
- The existing cpp feature now only indicates a working C++ toolchain without
  libstdc++. (E.g. still useful for the Arduino compatibility layer.)
- Added libstdcpp as required feature were needed
- Added some documentation on C++ on RIOT
2020-07-15 11:45:22 +02:00
Marian Buschsieweke
91a294aa45
cpu/cortexm_common: Drop LTO workaround for Cortex M thread_arch.c
The `ldr    r1, =sched_active_thread` instruction couldn't be assembled with
LTO, as the no immediate offset could be found to construct the address of
`sched_active_thread`. This commit instructs the assembler to generate a
literate pool which can be used to construct the address. While this issue
was only triggered during LTO, it theoretically could also pop up without LTO
due to unrelated changes. Thus, it is a good idea to create the literate pool
even without LTO enabled.
2020-07-15 10:37:15 +02:00
Marian Buschsieweke
0feebcb094
cpu/cortexm_common: Drop #7776's LTO workaround
The workaround from #7776 is no longer needed with recent toolchains, e.g. such
as the toolchain in the riot/riotbuild docker image.
2020-07-15 10:37:15 +02:00
Marian Buschsieweke
056100c1ca
cpu/cortexm_common: Fix cpu_switch_context_exit()
- Use `irq_enable()` over `bl irq_enable`, as `irq_enable()` is an inline
  function and not a C function any more
- Drop `__attribute__((naked))` qualifier
    - It must be used with the declaration of the function, but there it is
      missing. (And it cannot be added there, as this function would need to
      be implemented as "naked" by every platform; which is impossible for
      platforms not supporting `__attribute__((naked))`.)
    - Only functions consisting completely of basic asm may be marked as naked.
      But both the assembly used to trigger the SVC interrupt as well as the
      assembly used in `irq_enable()` are extended asm, not basic asm
- Use ` UNREACHABLE();` over a custom asm construct
2020-07-03 12:48:42 +02:00
0ff9e554eb cpu/cortexm: implement sched_arch_idle() and disable idle thread 2020-06-25 16:02:28 +02:00
d7c1510b0f
cortexm_common: Remove read in ICSR register operations
All bits in the ICSR register in the cortexm system control block are
either read-only or don't have an effect when writing a zero. A
read-modify-write cycle is thus not required when writing bit flags in
the register. This commit removes the reads in the read-modify-store
patterns for this register.
2020-06-23 11:53:53 +02:00
Leandro Lanzieri
2c4c04d11b
cpu/cortexm_common: Unify Kconfig and Makefile arch identifiers 2020-06-16 12:05:41 +02:00
Leandro Lanzieri
649017f0b2
cpu/cortexm_common: Rename arch_cortexm feature to cpu_core_cortexm 2020-06-16 12:05:41 +02:00
Leandro Lanzieri
4d65bc8e0a
cpu: Rename CPU_ARCH to CPU_CORE 2020-06-16 12:05:40 +02:00
8466946ea1 cpu/cortexm_common/Kconfig: add cortexm_svc feature 2020-06-10 23:13:43 +02:00
dbe7331d10 cpu/cortexm: "free" SVC 2020-06-10 23:12:58 +02:00
Jean Pierre Dudey
fea44e8b35
cpu/cortexm_common: add HAS_CORTEX_MPU feature
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2020-06-04 22:16:43 -05:00
José Alamos
917cc66e48
Merge pull request #14162 from jia200x/pr/kconfig/cortex
Kconfig/armv7_m/cortexm: declare CPU_ARCH and CPU_CORE symbols
2020-05-28 14:59:37 +02:00
Leandro Lanzieri
be8289bd8d cpu/cortexm_common: Add Kconfig symbols
This declares the architecture and core specific Kconfig symbols and the
features provided by it are selected.
2020-05-28 14:11:21 +02:00
Francisco Molina
b5e4224a6f
cpu/cortexm_common: remove special cortexm_sleep handle for stm32l152re
__set_PRIMASK(state) had been directly inlined to avoid a hardfault that
occured when branching after waking up from sleep with DBG_STANDBY,
DBG_STOP or DBG_SLEEP set in DBG_CR.

The hardfault occured when returning from the branch to irq_restore,
since the function is now inlined the branch does not happen either.

Refer to #14015 for more details.
2020-05-12 16:37:34 +02:00
Francisco Molina
4ad3164599
cpu/cortexm_common/irq_arch: fix irq_enable return type 2020-05-12 16:37:34 +02:00
Francisco Molina
cb5cbe7431
cpu/cortexm_common: add inlined header only def for irq_%
irq_% are not inlined by the compiler which leads to it branching
to a function that actually implement a single machine instruction.

Inlining these functions makes the call more efficient as well as
saving some bytes in ROM.
2020-05-12 16:37:34 +02:00
iosabi
7e7b6e1cfe Allow to define reserved fields in CortexM vector table.
The ARM CortexM vector table has some reserved fields which are used by
some manufacturers to store their custom image information. In
particular, NXP QN908X stores the checksum, Code Read Protection, image
type and boot block pointer in this region.

This patch allows the cpu and board modules to define the value of these
fields at build time by defining a macro.
2020-04-10 10:37:41 +00:00
Pekka Nikander
4534e9b773
cpu/cortexm_common: add irq sub-priorities
This commit enables Cortex-M CPU interrupt sub-priorities
and allows the PendSV interrupt to have a priority different
from the default one.  Together these two preprocessor
defines can be used to have PendSV always run as the last interrupt
before returning from the interrupt stack back to the user space.

Running PendSV as the last interrupt before returning to the
user space is recommended by ARM, as it increases efficiency.
Furthermore, that change enhances stability a lot with the
new nRF52 SoftDevice support, currently being worked in
PR #9473.

This commit merely enables sub-priorities and a separate
PendSV priority to be used without changing the default
RIOT behaviour.
2020-04-03 17:49:31 +02:00
Leandro Lanzieri
ea2f963302
cpu/cortexm: Add 'cortexm_fpu' as a DEFAULT_MODULE if possible
This adds cortexm_fpu to the DEFAULT_MODULE list when the feature
cortexm_fpu is provided by the architecture. It also moves the
dependency resolution of this module to the architecture-specific
Makefile.dep file.
2020-04-01 09:46:29 +02:00
Leandro Lanzieri
64552a3b9a
cpu/cortexm_common: Move common modules to Makefile.dep
This moves the following modules to a architecture-specific Makefile.dep
file:
- cortexm_common
- cortexm_common_periph
- newlib
- newlib_nano
- periph
2020-04-01 09:46:21 +02:00
Benjamin Valentin
a11bcdcd5c cpu/cortexm_common: define BACKUP_RAM attribute 2020-03-19 13:37:58 +01:00
Sören Tempel
59676a1f5e Make sure the mpu_noexec_ram regions has the lowest priority
From the ARMv7-M ARM section B3.5.3:

	Where there is an overlap between two regions, the register with
	the highest region number takes priority.

We want to make sure the mpu_noexec_ram region has the lowest
priority to allow the mpu_stack_guard region to overwrite the first N
bytes of it.

This change fixes using mpu_noexec_ram and mpu_stack_guard together.
2020-03-10 11:16:22 +01:00
Sören Tempel
2c1a627118 Add mpu_noexec_ram pseudomodule 2020-03-07 13:09:55 +01:00
Gunar Schorcht
f688f84a15
Merge pull request #12928 from benpicco/newlib-multiheap
sys/newlib: enable multiple heaps in _sbrk_r()
2020-02-25 19:16:42 +01:00
Benjamin Valentin
cfd0ef415e cpu/sam0_common: hook up low power RAM as extra heap
This enables unused low-lower RAM on saml21/samd5x to be used for
heap memory.
2020-02-20 17:11:25 +01:00
496ae49692
Merge pull request #13091 from bergzand/pr/mpu/enable_once
cortexm_common/mpu: Only enable during low low level init
2020-02-11 11:11:13 +01:00
Sören Tempel
5ef5ab7e4b Add CPU feature for stack smash protections 2020-01-22 15:59:02 +01:00
c1cd286ec5
mpu: remove harmful assertion 2020-01-11 13:37:20 +01:00
88bdf166ec
cortexm_common: Enable the mpu only in the low level init 2020-01-11 13:36:23 +01:00
84bf543d78 cpu/cortexm_common: fix typos 2019-11-23 22:39:36 +01:00
Francois Berder
4a31f94cfc many typo fixes
Signed-off-by: Francois Berder <18538310+francois-berder@users.noreply.github.com>
2019-11-23 22:39:07 +01:00
Marian Buschsieweke
314184adb5
cpu: Platform specific C11 atomics compat headers
Added headers to define platform specific sizes and types for the C11 atomics
compatibility module for C++.
2019-10-24 23:08:36 +02:00
ebf43616b7 cpu: add arch_* features 2019-10-13 21:03:41 +02:00
Marian Buschsieweke
d749e2de5d
Merge pull request #12312 from kaspar030/cortexm_dont_disable_irq_in_cpu_jump_to_image
cpu/cortexm: don't disable IRQs in cpu_jump_to_image()
2019-10-08 11:20:06 +02:00
Benjamin Valentin
84a8a26dde cpu/cortexm: pointer to .text should be const
A pointer to read-only ROM data should be const.
2019-10-01 18:42:56 +02:00
Benjamin Valentin
2c09d9bd5b cpu/cortexm_common: Make Low-Power SRAM available to programs
Many MCUs contain some Backup or Low Power SRAM that is retained'even
in the deepest sleep modes.

In such sleep modes the MCU is essentually turned off with only the RTC
still running.
It can be woken by a GPIO or a RTC alarm. When this happens, a reset is
triggered and the normal startup routine is invoked.

This adds bss & data section for this memory in the linker script.
This allows for structures to be placed in it e.g.:

e.g.:

    static uint8_t persistent_buffer[64] __attribute__((section(".backup.bss")));
    static uint32_t persistent_counter __attribute__((section(".backup.data"))) = 1234;
2019-10-01 18:39:40 +02:00
a7f6508109 cpu/cortexm: don't disable IRQs in cpu_jump_to_image() 2019-09-26 23:38:43 +02:00
Francisco Molina
d075e55bb4 cpu/cortexm_common: replace irq_restore by __set_PRIMASK for stm32l152re
- The __NOP() that was added in #8518 is now remooved.
- When DBG_STANDBY, DBG_STOP or DBG_SLEEP are set in DBG_CR a hardfault
  occurs on wakeup from sleep. This was first diagnosed in #8518. When
  enabled, a hardfault occured when returning from a branch to irq_restore()
  we avoid the call by inlining the function call. See #11830 for more
  details.
2019-08-05 10:40:28 +02:00
francisco
4acceefa65 cortexm_common/Makefile.include: set RIOTBOOT_HRD_LEN for cortex-m
- Since the Vector table must be naturally aligned to the next power
  of two of the amount of supported ISR, and the table will be
  placed after riotboot_hdr, we must ensure RIOTBOOT_HRD_LEN has the
  same alignment.
2019-06-18 15:11:05 +02:00
Gaëtan Harter
bbb6dec054
Merge pull request #11630 from fjmolinas/pr_kinetis_ld
kinetis/ldscript: handle _rom_offset
2019-06-05 16:12:25 +02:00
francisco
43182bd8f7 cortexm_common/ldscript: use cortexm_rom_offset.ld 2019-06-04 18:05:35 +02:00
francisco
1e5a485539 cortexm_common/ldscript: add common script for rom_offset calculation 2019-06-04 18:05:35 +02:00
Benjamin Valentin
1c3f96495d ldscripts: move .noinit section behind .bss section
If the .noinit section starts at the beginning of the RAM,
a bootloader that is unaware of it will clear it.
Instead, move it behind the .bss section, hoping that a bootloader
will always use less .bss memory than RIOT proper.
2019-05-16 23:11:45 +02:00
bf000a1fa5
Merge pull request #11514 from kaspar030/fix_c11_atomic_definitions
core: fix c11 atomic definitions (fix gcc9 compilation)
2019-05-15 12:29:23 +02:00
Benjamin Valentin
29bf6c712b cortexm_common: add .noinit section
Make it possible to specify a section of RAM that is not touched by
the init routing so data can be kept across resets.

This should behave the same as on atmega & lpc2387.
2019-05-14 12:10:27 +02:00
68a4099c1c cpu/cortexm: fix pointer calculation
gcc9 started realizing that _sram is basically an uint8_t[1] and thus
HARDFAULT_HANDLER_REQUIRED_STACK_SPACE cannot be added to it without
exceeding the one-sized array.

This commit casts _sram to (uintptr_t) where that happens.
2019-05-13 17:38:10 +02:00
Oleg Artamonov
a5ce6deb02 cpu/cortexm_common: function to check address validity 2019-05-13 09:35:34 +02:00
emmanuelsearch
61c793aa4c cpu/cortexm_common: Add image_baseaddr support for Cortex-M23 2019-03-26 11:46:00 +01:00
3163b8d6e2
nrf52: use cortexm.ld script when applicable
The common linker script is not used when the nordic_softdevice_ble is
included
2019-03-13 11:57:44 +01:00
Dylan Laduranty
6d3fda7260 cpu/cortexm: add cortex-m23 support 2019-01-21 17:04:20 +01:00
7226daf33e
Merge pull request #10558 from dylad/pr/update_arm_cmsis
cpu/cortexm_common: Update ARM CMSIS to V5.4.0
2019-01-16 16:49:14 +01:00
Emmanuel Baccelli
209d90bc00
Merge pull request #10215 from kYc0o/pr/riotboot_multislot
riotboot: add multislot support
2019-01-15 19:04:28 +01:00
Dylan Laduranty
fdcac731eb cpu/cortexm_common: Update ARM CMSIS to V5.4.0
Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
2019-01-15 17:35:40 +01:00
Vincent Dupont
06f0c14460 cortexm_common: enable FPU on cortex-m4f 2019-01-03 15:24:20 +01:00
Francisco Acosta
e8660b2012 cpu/cortex_common: add support for multislot
A second slot is defined with a calculated size, from the
remaining flash after the bootloader and the first slot.
Both slots are defined as equal size, but it can be overriden.
2019-01-02 17:56:11 +01:00
7a6849ca17 cpu/cortexm_common: add riotboot and slot support
RIOTBOOT_SLOT_LEN is calculated as an hexadecimal value and
handles ROM_LEN defined as kilobytes like '512K'

This enables support for all the cortex-m0+/3/4/7 arch,
so most boards embedding these are potentially supported.
One needs just to ensure that the CPU can be initialised
at least twice.

Co-authored-by: Gaëtan Harter <gaetan.harter@fu-berlin.de>
2018-12-18 19:31:35 +01:00
9cfdf6e379 cpu/cortexm_common: introduce cpu_jump_to_image()
This new function allows to jump to another execution
environment (VTOR) located at a certain (aligned) address.
It's used to boot firmwares at another location than
`CPU_FLASH_BASE`.

The user needs to ensure that the CPU using this feature
is able to be initialised at least twice while jumping
to the RIOT `reset_handler_default` function, since it
initialises the CPU again (calls cpu_init()).

Co-authored-by: Kaspar Schleiser <kaspar@schleiser.de>
2018-12-18 19:31:35 +01:00
PeterKietzmann
0be350e352 sys/puf_sram: CPU specific attributes for variables 2018-11-20 08:34:53 +01:00
smlng
59e299635b cppcheck: add/correct reason for cppcheck-suppress
Adding and correcting description/rational on why certain cppcheck
warnings or errors are intentionally suppressed.
2018-09-25 12:03:58 +02:00
Pekka Nikander
6aa0a48558 cpu/cortexm_common/cortexm_init: Allow piecewise calling
Refactor cortexm_init to allow bits and pieces of
   it to be called separately, while retaining the
   current API, too.  Needed for non-standard
   Cortex-M initialisation, such as with nRF52
   SoftDevice.
2018-08-28 14:07:50 +03:00
Martine Lenders
b305ee4b41 cortexm_common: Mark llvm and gnu as supported toolchains 2018-08-16 16:41:58 +02:00
Gaëtan Harter
7dad2e7096
cortexm_common/ldscript: allow defining FW_ROM_SIZE
Allow defining a specific rom length to use for linking the firmware,
_fw_rom_length, instead of the default configuration to use the whole rom from
_rom_offset to the end.

 * Add cortexm_common/Makefile.include FW_ROM_SIZE configuration
 * Add an assertion that _fw_rom_length still respects _rom_length
2018-08-11 11:34:01 +02:00
Gaëtan Harter
c84539fdb3
cortexm_common: allow defining ROM_OFFFSET in a compilation rule
Define _rom_offset with a conditional evaluated at execution time to allow
setting it in compilation rules and generate in the same make instance different
elf files with different configurations.
2018-08-11 11:33:55 +02:00
Gaëtan Harter
9103dcaeda
cortexm_common: refactor the definition test
The variables should all always be defined.
2018-08-11 11:33:52 +02:00
Gaëtan Harter
83a617261a
cortexm_common/ldscript: add _fw_rom_length variable
It will help testing if it is taken into account and for defining for outside
after.
2018-08-11 11:33:47 +02:00
Gaëtan Harter
d9db258411
cortexm_common/ldscript: re-use _rom_offset variable name
Inspired by kaspar030 version to removing the new _boot_offset variable.

cbf324a66d/cpu/cortexm_common/ldscripts/cortexm.ld
2018-08-11 11:33:39 +02:00
PeterKietzmann
20397c5b15 cortexm_common: add SRAM based PRNG seeder 2018-07-04 17:55:16 +02:00
938677cc83 cpu*: fix doxygen grouping 2018-06-11 19:12:02 +02:00
smlng
34ade00db9 cpu/cortex_common: fix indention in vector table 2018-05-24 11:26:46 +02:00
Joakim Nohlgård
77449aa592
Merge pull request #9103 from gebart/pr/cortexm-vectors-const
cortexm: const ISR vectors
2018-05-11 21:35:12 +02:00
Joakim Nohlgård
4532c348b4 cortexm_common: Adjust ldscript memory segment attributes 2018-05-09 06:44:12 +02:00
Joakim Nohlgård
b8d6bcdb07 cortexm_common: specify load segment instead of load address for .data 2018-05-09 00:41:27 +02:00
Joakim Nohlgård
f073fdb34f cortexm_common: Mark base ISR vector as const 2018-05-09 00:32:28 +02:00
c9c7cd4951 cpu: cortexm_common: use thread_yield_higher() in cortexm_isr_end() 2018-04-13 10:12:39 +02:00
Girts Folkmanis
b9744f698f cortexm_common: don't try to set MEMFAULTENA on ARMv6-M
Before this change, if one tried to build a Cortex-M0+ target that had
an MPU, compilation would fail due to missing
'SCB_SHCSR_MEMFAULTENA_Msk' in SCB structure. Cortex-M0+ is a ARMv6-M
arch (unlike most other targets that have MPU support). ARMv6-M has more
limited support for fault conditions, see ARMv6-M Architecture Reference
Manual, D3.6.2.
2018-03-12 19:57:29 -07:00
Francisco Acosta
ac9328381c cpu/cortexm_common: add NOP after WFI to avoid hardfault on stm32l152 2018-02-12 15:10:34 +01:00
99d484f336 cpu/cortexm_common: select bitarithm_lsb() by available instructions 2018-01-16 23:35:14 +01:00
32c10ae2c9 core, cpu: rename thread_start_threading() -> cpu_switch_context_exit() 2017-11-16 14:40:16 +01:00
86665b71bf cpu: adapt to COREIF_NG removal 2017-11-16 14:40:16 +01:00
f6d7e54228
Merge pull request #7739 from kYc0o/factorise_sam0_ldscripts
ld: refactor sam0 ldscripts
2017-11-13 11:36:25 +01:00
Joakim Nohlgård
e3d5a70e0c cpu/cortexm: Remove leftover _estack declarations
These are leftovers from before the Cortex-M common ISR vectors were
split into vectors_cortexm.c
2017-11-10 15:38:14 +01:00
kYc0o
d25fd647e7 cpu/cortexm_common/ldscripts: add common linker script for cortexm family 2017-11-07 15:05:43 +01:00
kYc0o
4d681ac862 cpu/cortexm_common/Makefile.include: define linker length vars if set 2017-11-07 15:05:43 +01:00
268e763d63 make: move mcuboot related stuff to makefiles/mcuboot.mk 2017-11-07 12:28:41 +01:00
3ec8126c84 cpu: cortexm: provide periph_pm for all cortexm 2017-11-06 12:01:19 +01:00
a20745b6c5 cpu: make use of Makefile.periph 2017-11-06 12:01:19 +01:00
7c9f6a4763
Merge pull request #7907 from gebart/pr/cortexm-fix-hardfault-print
cortexm_common: Correct offset for hardfault stack
2017-11-02 15:59:36 +01:00
b5b970d760 cpu: cortexm: add Makefile.features 2017-11-02 12:59:45 +01:00
Joakim Nohlgård
2f55fdcec4 cortexm_common: Correct offset for hardfault stack
The required space for the hardfault handler is defined by
HARDFAULT_HANDLER_REQUIRED_STACK_SPACE, which is given in bytes,
this length is added to &_sram to find a lower limit on the amount of
stack space that the hard fault handler can work with. The _sram
variable, was mistakenly defined as a uint32_t, which makes &_sram into
a uint32_t*, which through pointer addition, made the required space 4
times as big as it was supposed to. By changing the type of _sram to
uint8_t, the required stack space is correctly computed.

The symptom was that the hardfault handler always reported that the
stack pointer had been corrupted and it was impossible to get any useful
information from the crash text.
2017-10-30 07:08:33 +01:00
14646fb332 Merge pull request #7776 from kaspar030/fix_cortexm_vectors_lto
cpu: cortexm: fix LTO issue for shared vector table
2017-10-21 00:02:48 +02:00
96b1b76ac9 cpu: cortexm: fix LTO issue for shared vector table (see #5774) 2017-10-20 22:19:44 +02:00
167bd30453 all: fix my email address 2017-10-20 15:02:41 +02:00
Hauke Petersen
5920d99752 pm: fix weak-based default implementations
Instead of using `weak` function definitions, this PR handles
default implementations using `PROVIDES_x` defines, allowing
for cpus/pm realted modules to use their own implementations.
2017-10-16 14:27:35 +02:00
Vincent Dupont
dd49f22532 cpu/cortexm_common: use irq_disable/irq_restore 2017-10-06 17:40:47 +02:00
Hauke Petersen
3ede8e9d95 cpu: force size of CPU specific vector table 2017-09-04 15:13:43 +02:00
Hauke Petersen
1a20ef8223 cpu: unified cortex-m base interrupt vector 2017-09-04 15:13:32 +02:00
kYc0o
3b6fad4dde cpu/cortexm_common: add image headers default size 2017-07-17 14:48:30 +02:00
kYc0o
1a52c80bf4 cpu/cortexm_common/ldscripts: add multislot variables 2017-07-17 14:48:28 +02:00
smlng
692cf96297 doc: fix doxygen grouping of cpu periph drivers 2017-06-26 14:42:11 +02:00
Joakim Nohlgård
dc3aa13e90 cortexm_common: Introduce bitbanding macros 2017-06-09 05:19:13 +02:00
Hauke Petersen
fd981dff22 cpu/cortexm: set VTOR for selected M0+ CPUs 2017-06-02 11:53:59 +02:00
0fcc7d3834 cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
Hauke Petersen
10a7486246 cpu/cortex_common: added support for Cortex-M7 2017-05-08 09:16:11 +02:00
Hauke Petersen
f875c3efc2 cpu/cortexm: s/cpu_sleep_until_.../cortexm_sle.../ 2017-05-04 13:45:11 +02:00
Vincent Dupont
f656a31e58 cpu/cortexm_common: use linker variable to initialize SCB->VTOR 2017-03-17 18:07:22 +01:00
Hauke Petersen
37d4f44379 cpus: mv vendor headers to include/vendor/. 2017-03-07 08:55:15 +01:00
Michael Andersen
a72df9f015 cpu/cortexm_common: fix periph_pm typo 2017-02-22 15:58:20 -08:00
Joakim Nohlgård
20b184604b cortexm_common: Remove atomic_arch 2017-02-08 16:23:49 +01:00
Hauke Petersen
3da9ceb705 cpu/cortexm: fixed cortexm_sleep() 2017-01-27 13:00:24 +01:00
Oleg Hahm
c5abb08316 Merge pull request #4058 from daniel-k/pr/gdb_threads_openocd
cortex_m: Add debug symbols for OpenOCD/GDB thread support
2017-01-25 17:49:42 +01:00
be7771e0b9 cpu: cortexm_common: add define for number of non-isr exceptions 2017-01-25 10:22:03 +01:00
d8f0eaf127 cpu: cortexm: fix signed<->unsigned compare 2017-01-25 10:10:47 +01:00
d1db946188 Merge pull request #6344 from haukepetersen/opt_pm_misc
pm: misc cleanup and fixes
2017-01-24 14:07:36 +01:00
Oleg Hahm
7ee7801c10 *: remove trailing underscores from header guards 2017-01-19 18:30:53 +01:00
Hauke Petersen
801eeceb59 cpu/cortexm: removed unused pm include in panic.c 2017-01-19 11:05:44 +01:00
Hauke Petersen
409516c4d2 cpu/cortexm: moved pm.c to periph/pm.c 2017-01-19 11:05:44 +01:00
079a6ec5f4 Merge pull request #6346 from haukepetersen/opt_pm_cortexmsleep
cpu/cortexm: added shared cortexm_sleep() function
2017-01-18 10:55:04 +01:00
daniel-k
9d403d95ce cortex_m: Add debug symbols for OpenOCD/GDB thread support 2017-01-16 20:50:35 +01:00
Joakim Nohlgård
8c82d9952b cortexm_common: Fix -Wsign-compare warning in cortexm_init 2017-01-16 08:55:08 +01:00
Joakim Nohlgård
2c5e1065c5 cortexm_common: Fix unused parameter warnings in mpu_configure 2017-01-16 08:55:08 +01:00
Hauke Petersen
ed5d7ac0fd cpu/cortexm: added shared cortexm_sleep() function 2017-01-13 12:26:42 +01:00
807a190e20 cpu: cortexm: adapt to periph/pm 2017-01-12 16:26:01 +01:00
ca7bf15ac4 core: panic: adapt to pariph/pm 2017-01-12 16:26:01 +01:00
0194091673 remove obsolete lpm code 2017-01-12 11:24:15 +01:00