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

193 Commits

Author SHA1 Message Date
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