Commit Graph

176 Commits (91f0be6ac3a602c6f177eebb6a418f53bdf55175)

Author SHA1 Message Date
Kevin Bracey 770baa22ea Rework MPU use option
Make the option positively named, and as it is a platform config
option make sure it only affects platform code.

HAL functions still remain available even if platform is told not
to use them.
2018-12-11 13:03:59 +02:00
Kevin Bracey 842587ddb5 Save ROM by specifying initial MPU state
We can omit the need for the "change MPU state" calls from simple images
by specifying the initial state at init.
2018-12-10 15:53:34 +02:00
Martin Kojtal fd301c708b rtos: fix copyright years 2018-11-28 10:42:11 +00:00
Martin Kojtal e3ddd519c3 rtos: add spdx license 2018-11-28 10:39:52 +00:00
Martin Kojtal 52822cb8af
Merge pull request #8871 from c1728p9/mpu
MPU API (Reopened)
2018-11-28 10:28:32 +01:00
Russ Butler 1821d37621 Overhaul MPU for new requirements
Make the following changes:
-Allow a vector specific ARM MPU driver by defining MBED_MPU_CUSTOM
-Allow ROM address to be configured for ARMv7-M devices by
    setting the define MBED_MPU_ROM_END
-Add ROM write protection
    -Add new functions and lock
    -enable at boot
    -disable during flash programming
2018-11-27 09:29:32 +00:00
Russ Butler ecd0414494 Integrate MPU with mbed
Enable the MPU as part of the boot sequence and disable it before
starting a new application. Also add reference counted MPU lock and
unlock functions to allow code to execute from ram when necessary.
2018-11-27 09:29:31 +00:00
Oren Cohen dd73fa689c PSA SPM
* Intorduce PSA-SPM to mbed-os
* Add SPM tests (for PSA targets)
* Add PSA PRoT internal storage Secure implementation
* Integrate SPM into the boot proccess
* PSA manifest data generator
* Introduce PSA targets skeleton to mbed-os
* Add artifact delivery to the tools
2018-11-27 09:16:35 +02:00
Senthil Ramakrishnan 6181394e37 Error and fault handling changes for crash reporting 2018-11-16 13:59:59 -06:00
Martin Kojtal 830f7464cc rtx idle: fix coding style 2018-11-15 07:20:10 +00:00
Cruz Monrreal 9d95d46d6c
Merge pull request #8591 from 0xc0170/fix_coding_style_features
features: fix coding style
2018-11-09 09:40:56 -06:00
Martin Kojtal 57be9d2492 Merge branch 'fix_background_overflow' of https://github.com/c1728p9/mbed-os into dev_rollup 2018-11-08 09:21:20 +00:00
Martin Kojtal 87265f7744 rtos: fix coding style in the boot files 2018-11-08 08:54:22 +00:00
Russ Butler 9613e0ffbd Increase background stack size to fix overflows
On platforms using both tickless and the low power ticker wrapper
so much of the background stack is used that it overflows. To
ensure the background thread's stack doesn't overflow increase this
size by 256 bytes when tickless is enabled. Worst case usage
on the NUCLEO_F476RG was recorded at 656 when tickless is
turned on so this increased size should safely prevent overflows.
2018-11-06 10:55:58 -06:00
Jeroen de Bruijn 2ef82e18f5
fix: Remove rtx from main thread name 2018-11-03 18:32:23 +01:00
Jeroen de Bruijn 3f635ef813
fix: Update thread names
Remove _thread suffix and rename threads.
2018-11-02 13:44:24 +01:00
Cruz Monrreal 5ed07c2dd4
Merge pull request #8328 from kjbracey-arm/noreturn
Error path tightening: use MBED_NORETURN; add+use core_util_atomic_flag
2018-10-29 20:49:54 -05:00
Kevin Bracey 90a731daee rtos_idle_loop is MBED_NORETURN
Don't need loops at two layers.

Also tighten up slightly-invalid extern "C" markings.
2018-10-29 13:58:06 +02:00
Cruz Monrreal 4798a91f2e
Merge pull request #8223 from c1728p9/deep_sleep_wakeup_fix
Improve RTOS behavior with deep sleep
2018-10-27 08:45:33 -05:00
Martin Kojtal e80f2ff18a rtos cortex: fix astyle 2018-10-25 09:58:18 +01:00
Russ Butler 50316d00bd Improve RTOS behavior with deep sleep
Only deep sleep when the wakeup time is more than
MBED_CONF_TARGET_DEEP_SLEEP_LATENCY ms in the future.
This ensures that RTOS events are handled at the correct time. Note -
when deep sleep is allow interrupt latency may still be as high as
10ms.
2018-10-24 15:02:56 -05:00
Senthil Ramakrishnan e4525fbea1 Mbed Fault Handler was originally placed under rtos folder because of its dependency on some of the RTX data structures for capturing the thread info. But with the new error handling in place thread info collection on hardfaults has been moved to Mbed_error handler. There is no point for fault handler implementation to exist under rtos and can be used for RTOS-less builds as well. So moving under platform folder. Also removing some references to RTX data structs like osRtxInfo from fault handler implementation. 2018-10-23 13:05:56 -05:00
Kevin Bracey 78f4b4bc82 Make mbed_error not serial-specific
Use write() on current output device instead - this works on the
assumption that write() is safe to call from critical section.

UARTSerial has previously been upgraded to support this, and this also
improves the behaviour when buffered serial is in use - the current
buffered output will be fully flushed before outputting the error
message.
2018-10-17 12:55:20 +03:00
Cruz Monrreal 1a638c7870
Merge pull request #8106 from c1728p9/macros_to_config
Replace macros with config options
2018-09-22 16:40:53 -05:00
Martin Kojtal 9abcbf6acf
Merge pull request #7901 from deepikabhavnani/warning_fix
Compiler Warning fixes
2018-09-17 14:29:15 +02:00
Russ Butler b9b4b8ada6 Replace macros with config options
Add a config option for the following values:
MBED_SYS_STATS_ENABLED
MBED_STACK_STATS_ENABLED
MBED_CPU_STATS_ENABLED
MBED_HEAP_STATS_ENABLED
MBED_THREAD_STATS_ENABLED
MBED_CONF_APP_MAIN_STACK_SIZE
MBED_CONF_APP_TIMER_THREAD_STACK_SIZE
MBED_CONF_APP_IDLE_THREAD_STACK_SIZE
MBED_CONF_APP_THREAD_STACK_SIZE

To maintain backwards compatibility inside the RTOS both
APP and RTOS config values can be used.
2018-09-12 13:59:46 -05:00
Cruz Monrreal 48232be98e
Merge pull request #7872 from kjbracey-arm/thisthread
Add ThisThread namespace and deprecate static Thread methods
2018-09-02 15:10:18 -05:00
Cruz Monrreal 00b7700be2
Merge pull request #7875 from c1728p9/feature_CMSIS_5_0b521765
Update CMSIS to 5.4.0
2018-08-31 11:31:37 -05:00
Russ Butler 325565bf79 Refactor boot process
Refactor the Mbed 5 boot process to make is simpler and more modular.
This is done by breaking the boot sequence into 4 distinct steps -
Target setup, Toolchain setup, RTOS setup and Mbed setup. This patch
also move toolchain specific code into a per toolchain folder to make
it more maintainable.
2018-08-28 19:26:55 -05:00
Kevin Bracey 1330eeecd0 Add ThisThread 2018-08-28 13:25:17 +03:00
Deepika b9ba27b3ee Fixed: @44,18: unused variable 'tid' [-Wunused-variable] 2018-08-27 10:32:35 -05:00
Kevin Bracey 6477b762d1 Style clean-up of Thread-related files 2018-08-27 12:30:33 +03:00
Russ Butler d5be92adb1 Fix define around EvrRtxKernelInitialized
Rename the define EVR_RTX_KERNEL_INITIALIZE_COMPLETED_DISABLE to
EVR_RTX_KERNEL_INITIALIZED_DISABLE so it matches the rest of RTX.
2018-08-25 20:41:11 -05:00
Russ Butler 6f7964b23f CMSIS/RTX: Remove the file os_tick_gtim.c
Cortex-A devices in mbed-os supply their own OS timer so the code
from RTX is not needed.
2018-08-25 20:41:11 -05:00
Bartek Szatkowski b7efe36125 CMSIS/RTX: Fix using FALSE/TRUE with preprocesor
(cherry picked from commit 1752803626)
2018-08-25 20:41:10 -05:00
deepikabhavnani 67b677d285 CMSIS/RTX: Pre-processor defines used for assembly
CMSIS repo does not support pre-processor defines, hence multiple assembly
files are added for secure/non-secure and floating point tools.

Mbed OS tools support assembly file pre-processing, but the build system
does not support multiple assembly files for each target, hence updating
the assembly files.

(cherry picked from commit 287121ffdc)
2018-08-25 20:41:09 -05:00
Bartek Szatkowski 4fd0daf9f5 CMSIS/RTX: Allow overwriting mutex ops for ARMC
(cherry picked from commit b88254809e)
2018-08-25 20:41:09 -05:00
Bartek Szatkowski 1be672d5f0 CMSIS/RTX: Patch RTX so irq_cm4f.s files work with no FPU targets
(cherry picked from commit cc2e0517e1)
2018-08-25 20:41:09 -05:00
Bartek Szatkowski 9a87d7b6a0 CMSIS/RTX: Patch RTX4 to preserve osThreadDef compatibility
mbed OS used older RTX4 version and with osThreadDef accepting only 3
parameters, to preserve compatibility we hardcode the 'instances'
parameter to 1.

(cherry picked from commit 428acae1b2ac15c3ad523e8d40755a9301220822)
(cherry picked from commit 4360b7bbf8)
2018-08-25 20:41:08 -05:00
Russ Butler 342841aa0f [CMSIS_5]: Updated to 0b521765 2018-08-25 20:41:00 -05:00
Russ Butler 5d0aac53bb Move Code to get Cortex A tick irqn
Move the function "mbed_get_a9_tick_irqn()" declared in os_tick.h
to SysTimer.h so it does not get overridden when RTX is updated.

This function was originally added in:
3d3e89097d
Fixes for RZ_A1H issue 6543
2018-08-25 20:40:17 -05:00
Oren Cohen 787317b7eb Remove uVisor from mbed-os 2018-08-22 16:36:59 +03:00
Cruz Monrreal f62e1032af
Merge pull request #7600 from c1728p9/remove_unnecissary_low_power_ticker_rescheduling
Remove unnecessary low power ticker rescheduling
2018-08-16 13:37:01 -05:00
Senthil Ramakrishnan 6221e6fa23 Optimize the configuration for RTX evr events to disable the ones not in use 2018-07-27 13:05:16 -05:00
Russ Butler 05d33b068d Remove unnecessary low power ticker rescheduling
Schedule the next OS tick inside of the ticker interrupt rather than
in the systick interrupt. Scheduling this while the ticker is
dispatching prevents an unnecissary rescheduling since this
rescheduling is done anyway when dispatching is finished.

This is particularly useful for the low power ticker on devices with
LPTICKER_DELAY_TICKS set to a non-zero value. This is because the low
power ticker cannot be reschduled immediately and needs to fall back
onto the microsecond ticker which temporarily locks deep sleep.

Note - the optimization in this commit is made possible by the commit:
"Don't reschedule ticker while dispatching"
2018-07-25 23:24:12 -05:00
Senthil Ramakrishnan 577844d3d3 Fix spelling in error message in fault handler 2018-07-19 10:31:34 -05:00
ccli8 0b00d0ce11 Allow non-secure main thread to call secure functions 2018-07-12 18:01:32 +08:00
Cruz Monrreal 93233c4f5d
Merge pull request #7364 from 0xc0170/fix_storage_rtos
Fix storage rtos types - remove including internal header file
2018-07-05 14:29:46 -05:00
Martin Kojtal 97a3ca193e boot: fix libspace num macro
RTX Config header file is internal and not exposed. With latest fixes to use
only public header files from RTX, we need to add these 2 new macros for
RTX ARMC lib configuration.
2018-06-29 11:43:17 +01:00
Martin Kojtal 2be3c13534
Merge pull request #7355 from deepikabhavnani/rtx_header_fix
Remove semicolon at the end of #6897 

Upstream fix https://github.com/ARM-software/CMSIS_5/pull/384
2018-06-29 08:43:06 +02:00