Commit Graph

714 Commits (229b9ad43b3328df59fca50d84d14d13ee6d2aa5)

Author SHA1 Message Date
George Beckstein 5ced28359b
Change "aplication" to "application" 2019-05-13 17:59:03 -04:00
Oren Cohen 73ddfa9f88 Call psa_spm_init() before staring the NS core 2019-04-29 16:42:33 +03:00
Martin Kojtal 5fb5e9808c
Merge pull request #10367 from jeromecoutant/PR_STACK_SIZE_DEBUG
Increase background stack size to fix overflows with debug profile
2019-04-17 15:52:38 +01:00
Martin Kojtal 14b9229b13
Merge pull request #10415 from 0xc0170/fix_licenses
rtos/drivers: add license information
2019-04-17 12:26:43 +01:00
Martin Kojtal 94898a12ab
Merge pull request #10358 from kjbracey-arm/error_print_improvements
Error print improvements
2019-04-17 08:04:15 +01:00
Martin Kojtal 5a96f45ce0 license: fix files list 2019-04-16 11:43:14 +01:00
Martin Kojtal 393707f2b8 rtos: add license information 2019-04-16 11:26:39 +01:00
Kevin Bracey b8e80dd2fb Don't trap RTX errors or mutex errors during errors
Once a fatal error is in progress, it's not useful to trap RTX errors
or mutex problems, so short-circuit the checks.

This makes it more likely that we may be able to get the console
initialised if it is being written to for the first time by `mbed_error`
in a difficult context - such as an RTX error callback from inside an
SVCall.

For example, the one-line program

   osMutexAcquire(NULL, 0);

will generate an RTX error trap, then `mbed_error` will try to call
`write(STDERR_FILENO)` to print the error, which will prompt mbed_retarget to
construct a singleton `UARTSerial`. This would trap in the mutex
for the singleton or the construction of the UARTSerial itself, if
we didn't allow this leniency. If we clear the mutex checks, then
`UARTSerial::write_unbuffered` will work.
2019-04-15 11:29:04 +03:00
Cruz Monrreal 582edf503a
Merge pull request #10366 from kjbracey-arm/feature_CMSIS_5_ca812421
Update CMSIS to 5.5.1
2019-04-11 20:34:00 -05:00
Cruz Monrreal b1e48db242
Merge pull request #10225 from kjbracey-arm/memorypool_blocking_alloc
Mail/MemoryPool: blocking alloc
2019-04-11 20:21:44 -05:00
jeromecoutant 9b2ba12c62 Increase background stack size to fix overflows with debug profile 2019-04-11 16:50:49 +02:00
Kevin Bracey 49928ec143 Adjust EVR_RTX disable macros for 5.5.1 2019-04-10 15:47:43 +03:00
Bartek Szatkowski d55698ec88 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.

1. Patch RTX so irq_cm4f.S files work with no FPU targets
2. Patch RTX so irq_armv8mml.S files to work with and without FPU
2. Patch RTX so irq_armv8mml.S and irq_armv8mbl.S files to work with secure and
   non-secure builds

(cherry picked from commit 094662790a)
2019-04-10 14:42:56 +03:00
deepikabhavnani 9144ecc08c CMSIS/RTX: Move Idle and Timer thread stack to bss section.
In case of ARM compiler, idle and timer thread stack though assigned
to `.bss.os` section since not zero initialized are part of `data` section.

In this commit, we are moving stacks of idle and timer thread to bss
section and thereby saving ROM space.

(cherry picked from commit ba92372b8d)
2019-04-10 14:42:52 +03:00
Bartek Szatkowski b8408bc231 CMSIS/RTX: Fix using FALSE/TRUE with preprocesor
(cherry picked from commit 1752803626)
2019-04-10 14:42:21 +03:00
Bartek Szatkowski 1aab93ac98 CMSIS/RTX: Allow overwriting mutex ops for ARMC
(cherry picked from commit b88254809e)
2019-04-10 14:42:06 +03:00
Bartek Szatkowski 4edb719624 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)
2019-04-10 14:41:48 +03:00
Kevin Bracey 00c9005b4e [CMSIS_5]: Updated to ca812421 2019-04-10 14:41:35 +03:00
Martin Kojtal 43cbc10616
Merge pull request #10020 from TacoGrandeTX/fix_iar_single_threaded
Fix single-threaded apps for IAR v8 builds
2019-04-08 10:38:42 +02:00
Kevin Bracey e2a965fe1e Mail/MemoryPool: blocking alloc
Mail and MemoryPool did not permit access to the blocking form of
allocation available in CMSIS-RTOS 2 - give them new blocking methods.
2019-03-26 14:12:59 +02:00
Kevin Bracey b7171d1bbf RTOS API: minor tidies
Remove unneeded memsets and an unneeded cast.

Add missing initialisation of EventFlags attributes - no all fields were
being initialised.
2019-03-18 17:27:07 +02:00
RFulchiero 0562128998 Fix single-threaded apps for IAR v8 builds
For single-threaded apps __iar_Initlocks() is not required and must
not be called because the proper IAR library is brought in only if
"--threaded_lib" is defined in the linker command.
2019-03-08 15:33:04 -06:00
Martin Kojtal e75794ec6e
Merge pull request #9888 from ARMmbed/feature-armc6
ARM Toolchain update to ARM Compiler 6.11(ARMC6)
2019-03-04 12:23:38 +01:00
deepikabhavnani a9ce4b3d9a Target_WIZWIKI: Add ARM_LIB_STACK and ARM_LIB_HEAP section
Instead of user defined symbols in assembly files or C files,
use linker scripts to add heap and stack - this is inconsistent
with ARM std linker scripts
2019-02-28 19:52:06 -06:00
deepikabhavnani 7f6b4e51a3 Microlib only supports the two region memory model
Update arm_std.c and linker scripts to use ARM_LIB_STACK
and ARM_LIB_HEAP section from scatter files, instead of user
defined symbols
2019-02-28 19:52:06 -06:00
Cruz Monrreal e393c2dc0b
Merge pull request #9785 from c1728p9/default_to_us_ticker
Use us ticker for tickless on devs with wrapper
2019-02-28 18:25:01 -06:00
Kevin Bracey 0adc7dc927 RTX5: Make rtx_core_ca.h cope with compiler in Thumb mode
Assembler in rtx_core_ca.h is on the whole unified syntax such that it
should work fine if assembled as either ARM or Thumb-2.

The exception was __get_PSP, which uses STM^, which is only available
in ARM state.

Flagging for this function was incorrect, except for IAR - it switched
assembler state without telling the compiler, meaning that the resulting
assembler output could be incorrect, and that the function itself would
not be correctly marked as an ARM function - the CPU would enter in
Thumb state.

Alternative fix would be to switch to System mode, which would work
as either ARM or Thumb-2 assembler, like the rest of the file, but
this is the minimal change.

Fixes #526.
2019-02-28 11:55:20 -06:00
d-kato 0ef1620ffb Back to the original : "rtx_core_ca.h" 2019-02-28 11:55:19 -06:00
d-kato 7aebee07b1 GR_LYCHEE,RZ_A1H,VK_RZ_A1H: Update to fix ARMC6 build failures 2019-02-28 11:55:19 -06:00
Cruz Monrreal 3352b431b3
Merge pull request #9786 from c1728p9/tickless_optimization
Optimize tickless tick computation
2019-02-26 23:22:04 -06:00
Cruz Monrreal e1736cd06f
Merge pull request #9571 from mprse/fix_9523_rtos_less_issue
Update to 2-region model for HEAP and Stack Memory
2019-02-26 22:50:19 -06:00
Russ Butler f6ed7cee41 Optimize tickless interrupt latency
Remove unnecessary critical sections from the SysTimer code since
the access should already be serialized.
2019-02-23 17:44:51 -06:00
Russ Butler d43ca21ec5 Optimize tickless tick computation
Optimize the tick computation in the following ways:
1. Use relative time rather than absolute time
2. Replace multiplication/division pair with just multiplication
    or division:
    "* 1000000ULL / OS_TICK_FREQ"   ->   "* US_IN_TICK"
    "* OS_TICK_FREQ / 1000000"      ->   "/ US_IN_TICK"
2019-02-23 17:44:29 -06:00
Russ Butler d901c51056 Apply astyle fixes
Apply the fixes found from astyle.
2019-02-21 18:43:59 -06:00
Russ Butler b32b996419 Use us ticker for tickless on devs with wrapper
The low power ticker wrapper layer adds a large amount of interrupt
latency. This can cause dropped bytes at a baud of 115200 on some
devices. To prevent this by default use the microsecond ticker for
tickless on devices which make use of the low power ticker wrapper.
2019-02-21 10:51:10 -06:00
Martin Kojtal baed84a109
Merge pull request #9670 from kegilbert/timeout_units
Add units to timeout argument in EventFlags
2019-02-21 15:53:38 +01:00
kegilbert f1abca35cf Change EventFlag timeout paramter
Matches rest of RTOS class timeout parameters by using the unit name. Remove ambigious statement in reference to 0 ms being no-timeout as a timeout of 0 causes the function to not block and return immediately (osWaitForever is used as no timeout as it will wait forever)
2019-02-20 17:52:28 -06:00
Deepika f13a3e32b6 Fix GCC _sbrk allocation 2019-02-19 15:49:49 -06:00
deepikabhavnani b36147fbe9 ISR_Stack_start/size defines are not needed, use linker file defines 2019-02-19 15:49:49 -06:00
deepikabhavnani 9d1ce66b14 ISR_STACK_START/ HEAP_START defines not used by GCC_ARM toolchain 2019-02-19 15:49:49 -06:00
Deepika 537b3646d3 Resolve build/type cast errors 2019-02-19 15:49:49 -06:00
Deepika 41eaefeeb4 Update memory model for stack and heap memory
Memory model for RTOS and No RTOS was initially single stack and heap,
only few targets implemented 2-region RAM model.

2-region RAM model is applied for all toolchains and targets.

GCC: __wrap__sbrk was implemented for 2-region ram model, with switch to 2-region
for all targets, we do not need target specific implementation of this API
Also _sbrk is WEAK function, hence can be over written in target folder for
special cases
2019-02-19 15:49:45 -06:00
Deepika a1fe75093e Interrupt stack is always explicitly specified, hence other condition is not needed
Earlier if interrupt stack is specified it was used and remaining section of
IRAM was used to allocate heap, if stack is not specified heap section was
reduced by isr stack size and it was added at the end of RAM

With 2-region RAM support interrupt stack will always be specified.
2019-02-19 15:46:32 -06:00
Oren Cohen 5dbb8fef09 Call tfm_ns_lock_init() on TFM NSPE boot 2019-02-19 15:19:02 +02:00
Oren Cohen 34895a05ad CR fixes 2019-01-31 17:17:54 +02:00
Oren Cohen 8841ba69f8 Align to new spec changes and prep for TFM SPM
# Conflicts:
#	components/TARGET_PSA/services/crypto/COMPONENT_PSA_SRV_IPC/psa_crypto_spm.c
#	components/TARGET_PSA/services/crypto/COMPONENT_SPE/psa_crypto_partition.c
2019-01-31 17:17:53 +02:00
Bartek Szatkowski 094662790a 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.

1. Patch RTX so irq_cm4f.S files work with no FPU targets
2. Patch RTX so irq_armv8mml.S files to work with and without FPU
2. Patch RTX so irq_armv8mml.S and irq_armv8mbl.S files to work with secure and
   non-secure builds
2019-01-18 17:39:43 -06:00
Deepika bb25e8660d Reverted 4 CMSIS/RTX commits for Assembly files
1. Revert "CMSIS/RTX: __FPU_USED to be set based on HW FPU support"
This reverts commit b4f5bed7e75c21927c954a50d40422b81a1de5a0.

2. Revert "CMSIS/RTX: Update Armv8M IAR 8.x assembly files - add END"
This reverts commit b228cd9db0.

3. Revert "CMSIS/RTX: Pre-processor defines used for assembly"
This reverts commit 287121ffdc.

4. Revert "CMSIS/RTX: Patch RTX so irq_cm4f.s files work with no FPU targets"
This reverts commit cc2e0517e1.
2019-01-18 17:31:42 -06:00
deepikabhavnani ba92372b8d CMSIS/RTX: Move Idle and Timer thread stack to bss section.
In case of ARM compiler, idle and timer thread stack though assigned
to `.bss.os` section since not zero initialized are part of `data` section.

In this commit, we are moving stacks of idle and timer thread to bss
section and thereby saving ROM space.
2019-01-15 12:04:39 -06:00
Deepika 255661e55b Adding debugger awarness with Keil MDK
Main thread in Mbed OS is statically allocated and was not available in call
stack of Keil MDK. The RTX5 kernel requires statically allocated thread
information objects that are placed into a specific section to enable RTOS
thread awareness in Keil MDK. This fix is to keep main thread in specific
section of memory.
2019-01-15 12:04:39 -06:00
Martin Kojtal aff2bee8a4
Merge pull request #9352 from mprse/armc6_fix
mbed_boot_arm_std.c: remove redundant compiler check
2019-01-15 10:39:01 +01:00
Martin Kojtal 116e42f840
Merge pull request #9295 from deepikabhavnani/iar_asm
Add missing END to Armv8M IAR assembly files
2019-01-14 08:54:21 +00:00
Przemyslaw Stekiel 8cc4234181 mbed_boot_gcc_arm.c: remove redundant compiler check 2019-01-11 12:59:53 +01:00
Przemyslaw Stekiel bfcdb7dd3c mbed_boot_arm_std.c: remove redundant compiler check
Check is not needed since this file is exclusive for ARM compiler.
It causes problems on ARMC6.
2019-01-11 12:59:21 +01:00
Deepika b228cd9db0 CMSIS/RTX: Update Armv8M IAR 8.x assembly files - add END
Add missing END to the IAR assembly files. In future this commit should be
merged to other assembly file commit, when performing CMSIS update.
287121ffdc
2019-01-10 13:57:01 -06:00
Przemyslaw Stekiel 1739d7e6dd Define heap/stack start and size based on linker script symbols for ARM and GCC_ARM 2019-01-08 15:32:01 +01:00
Antti Kauppila 02b0f79e15 mbed.h includes removed 2018-12-28 14:36:10 +02:00
Alastair D'Silva 2617c5d55b Don't use define checks on DEVICE_FOO macros (mbed code)
The DEVICE_FOO macros are always defined (either 0 or 1).

This patch replaces any instances of a define check on a DEVICE_FOO
macro with value test instead.

Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
2018-12-20 10:16:42 +11:00
Cruz Monrreal 463a4536e2
Merge pull request #8961 from marcemmers/this-thread
ThisThread get_name()
2018-12-14 11:13:31 -06:00
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
Marc Emmers 2f792a9c88 Added get_name function to ThisThread namespace 2018-12-05 08:39:29 +01: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
Martin Kojtal e69aa15aea
Merge pull request #8744 from kfnta/psa_spm_base
PSA Secure partition manager and services
2018-11-27 15:26:38 +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
deepikabhavnani b6e381b701 MBED_NO_GLOBAL_USING_DIRECTIVE is added to remove auto-addition of namespace
Macro guard `MBED_NO_GLOBAL_USING_DIRECTIVE` is added around namespace, to avoid
polluting users namespace.
2018-11-26 09:23:16 -06:00
Senthil Ramakrishnan 6181394e37 Error and fault handling changes for crash reporting 2018-11-16 13:59:59 -06:00
Martin Kojtal e1e20a64f9 rtos: fix coding style 2018-11-15 07:20:12 +00: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
Cruz Monrreal II 0a8f5e07d3 Merge branch 'sen_KernelDoxyUpdate' of ssh://github.com/SenRamakri/mbed-os into rollup 2018-11-06 21:29:13 -06:00
Cruz Monrreal c792d33112
Merge pull request #8652 from 0xc0170/dev_rollup
Rollup PR for docs
2018-11-06 20:40:04 -06: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
kegilbert 3008de5cbf Fix typos in RTOS doxygen. 2018-11-01 15:46:40 -05:00
Amanda Butler 2418d9c0ae
Edit Kernel.h
Make minor copy edits for active voice, branding and deletion of extra spaces.
2018-10-30 10:25:25 -05: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
Senthil Ramakrishnan 4cdcdc1010 Updated attach_thread_terminate_hook doxygen comments 2018-10-29 13:53:19 -05:00
Senthil Ramakrishnan ad88218a35 Kernel.h doxygen update 2018-10-29 13:47:22 -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
Cruz Monrreal II 3da861808b Make variables that are private in ConditionVariable.h, protected
Paritally reverts docs PR 8511
2018-10-26 13:03:56 -05:00
Mel W 0d128d13f1
Breaking behaviors into two sections
as per @kjbracey-arm review
2018-10-26 14:10:33 +03:00
Mel W 96a6368814
Adding missing punctuation. 2018-10-26 11:37:40 +03:00
Mel W 6a1b260f68
True -> `true`, inserting article 2018-10-26 11:32:27 +03:00
Cruz Monrreal II fab0c3f031 Merge branch 'docs-condition-variable-refactor' of ssh://github.com/scartmell-arm/mbed-os into rollup 2018-10-25 21:49:46 -05:00
Cruz Monrreal II 3a66d9dca3 Merge branch 'doc-fix-mail' of ssh://github.com/paul-szczepanek-arm/mbed-os into rollup 2018-10-25 21:49:43 -05:00
Amanda Butler 5abe427f50 Edit Mail.h
Edit file for active voice, branding and comma use.
2018-10-25 21:47:57 -05:00
paul-szczepanek-arm f57d8978ff no doxygen guards needed for private 2018-10-25 21:47:56 -05:00
paul-szczepanek-arm 1b38b5a717 fix docs in Mail 2018-10-25 21:47:56 -05:00
Amanda Butler fbc5a381af Edit Queue.h
Edit file, including existing text, mostly for active voice and consistent tense.
2018-10-25 21:41:54 -05:00
Steve Cartmell 7e8a932b6f docs(api-queue): Update documentation for the Queue API 2018-10-25 21:41:53 -05:00
Cruz Monrreal de6ba91644
Merge pull request #8365 from 0xc0170/fix_astyle_common2
Fix astyle for tests folders
2018-10-25 10:41:13 -05:00
Cruz Monrreal 9c59d9acc3
Merge pull request #7864 from deepikabhavnani/remove_mbed_h
Add required header file and namespace element instead add all.
2018-10-25 09:26:24 -05:00
Melinda Weed 98e6d531bf Capitalization, header level adjustment 2018-10-25 17:16:34 +03:00
Melinda Weed c8f9759b90 Adding punctuation 2018-10-25 17:09:45 +03:00
Melinda Weed 5cc5e47929 future to present tense 2018-10-25 14:25:43 +03:00
Martin Kojtal e80f2ff18a rtos cortex: fix astyle 2018-10-25 09:58:18 +01:00
Martin Kojtal e7acdc4cc8 rtos: fix astyle 2018-10-25 09:58:16 +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
Cruz Monrreal b18c819837
Merge pull request #8519 from cmonr/rollup
Rollup PR - UK Docathon pt1
2018-10-24 09:32:46 -05:00
Amanda Butler 8ddfdf5b2f
Copy edit ConditionVariable.h
Copy edit file, including existing text.
2018-10-23 15:34:16 -05:00
Amanda Butler 57b79403bb
Edit EventFlags.h
Make minor copy edits to existing text.
2018-10-23 15:21:37 -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
Steve Cartmell c86ceb1bc1 docs(api-condvar): Update documentation for the ConditionVariable API
- Hide protected member structures from doxygen.
- Add some more details/comments to the example.
- Add some defined/undefined behaviours.
- Add some additional details to function documentation
2018-10-23 15:24:37 +01:00
Filip Jagodzinski e2b117f7c6 EventFlags docs update. 2018-10-23 15:11:26 +02: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
Deepika 3d5ec6626f RTOS: Add required header file and namespace element instead add all 2018-10-15 10:39:41 -05:00
Cruz Monrreal ec03df4823
Merge pull request #7980 from kjbracey-arm/thread_deprecations
Clean up rtos::Thread deprecation warnings
2018-10-15 10:09:55 -05:00
Amanda Butler bbc6e5dee4
Edit Mutex.h
Make minor copy edits to existing text.
2018-10-12 11:11:20 -05:00
Aashish chaddha b993eb9d3d mutex doc changes 2018-10-12 10:51:38 -05:00
Kevin Bracey 1ef213ec89 Clean up Thread deprecation warnings
Static Thread methods and signal methods have been deprecated. Remove
all references in the main code, and most of the tests. Some tests of
the deprecated APIs themselves remain.
2018-10-12 14:57:13 +03:00
Aashish chaddha 24054ec723 improve mutex doc 2018-10-11 16:48:39 -05:00
Aashish chaddha 8786bfbb9a improve mutex doc 2018-10-11 16:33:56 -05:00
Cruz Monrreal b7cf1abf81
Merge pull request #8039 from c1728p9/stack_size_framework
Add framework for configuring boot stack size
2018-10-08 10:26:16 -05: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
Russ Butler 1ead033423 Add framework for configuring boot stack size
Add the target config option "boot-stack-size" which is passed to the
linker as the define "MBED_BOOT_STACK_SIZE" so the linker can
adjust the stack accordingly. On mbed 2 the boot stack becomes the
main stack after boot.  On mbed 5 the boot stack becomes the
ISR stack after boot. Because of these different uses  the stack size
for mbed 2 is set to 4K by default while on mbed 5 it is set to 1k.

Additionally, the NRF5X family requires a larger interrupt stack size
due to the softdevice so the size  is increased to 2k on mbed 5 builds.
2018-09-07 16:31:49 +01:00
Anna Bridge c2fdc0d972
Merge pull request #7423 from mprse/mutex_lock_assert
Fix issue #6872 - Mutex lock has possibility to fail at runtime (returning status flag)
2018-09-03 14:14:24 +01:00
Przemyslaw Stekiel fba9c4bc57 Address review comments.
Perform the following changes:
- change definition of `void Mutex::lock(void)` to `osStatus Mutex::lock(void)`.
- change definition of `void Mutex::unlock()` to `osStatus Mutex::unlock()`.
- use MBED_ERROR1 macro to check the lock/unlock operation status.
- add notes in the description of lock/unlock functions: "This function asserts status of the lock/unlock operation (will not return in case of failure). Use of the return value is deprecated, as the return is expected to become void in the future.".
- modify/add description of the return value.
- remove reference to Mbed 6.
- make `lock(millisec)` deprecated in favour of lock(), trylock() and trylock_for() functions.
2018-09-03 07:40:01 +02: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 0ddd1d9af5 Make Thread methods const 2018-08-28 13:25:17 +03: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
Przemyslaw Stekiel ac2db7cc06 Mutex: fixing missing include
Macro MBED_DEPRECATED_SINCE is defined in platform/mbed_toolchain.h which was not included.
If someone used member functions lock (which are prefixed with MBED_DEPRECATED_SINCE since some time), there would be a compile error instead of a warning.
Including mbed_toolchain.h fixes that.
2018-08-27 08:50:00 +02:00
Przemyslaw Stekiel c693eb512a Change `Mutex::unlock()` function definition - void return value
This is done for consistency with the new version of `Mutex::lock()` member function which does not return status.
2018-08-27 08:48:59 +02:00
Przemyslaw Stekiel b626e185ec `osStatus lock(uint32_t millisec=osWaitForever)` - remove default value
Since `void lock(void)` member function has been added we need to remove default value from deprecated `lock(uint32_t millisec=osWaitForever)` member function since otherwise calling `lock()` would be ambiguous.
2018-08-27 08:47:16 +02:00
Przemyslaw Stekiel 3decd510dc Fix codding style. 2018-08-27 08:47:16 +02:00
Przemyslaw Stekiel ca8070a482 Fix for issue #6872 - Mutex lock has possibility to fail at runtime (returning status flag)
Add assertions for statuses returned by osMutexAcquire().
Add void Mutex::lock(void) member function - lock function which does not return status and waits for the mutex forever.
Make osStatus Mutex::lock(uint32_t millisec=osWaitForever) member function deprecated in favour of bool Mutex::trylock_for(uint32_t millisec).
2018-08-27 08:47:16 +02: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
Brendan McDonnell b2480d6281 fix comment copy/paste error 2018-07-31 18:14:31 -04:00
Cruz Monrreal 41bd4c48b9
Merge pull request #7628 from SenRamakri/sen_RtxEvrOptimization
Optimize the configuration for RTX evr events
2018-07-31 11:40:03 -05:00
Cruz Monrreal b8a2a461cf
Merge pull request #7545 from SenRamakri/sen_StackMaxStackIssue
Fix for Thread::max_stack not returning right value when OS_STACK_WATERMARK is enabled
2018-07-31 11:37:15 -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
Senthil Ramakrishnan 481285a324 Fix for max_stack not returning right value when OS_STACK_WATERMARK is enabled 2018-07-18 15:05:39 -05:00
ccli8 0b00d0ce11 Allow non-secure main thread to call secure functions 2018-07-12 18:01:32 +08:00
Jimmy Brisson 0222ca4976 Add _RTX_ define where it's needed and used 2018-07-11 13:49:57 +01: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
Martin Kojtal e91ab9c1a1 Thread: fix rtx thread type 2018-06-28 14:40:08 +01:00
Martin Kojtal 5c0f1b5db3 rtos: use RTX identifier
os_thread_t and family are internal and should not be used (thus we included
internal header file). Instead, use those that are exposed via rtx_os.h file.
2018-06-28 14:12:16 +01:00
Deepika 357138468a Remove semicolon at the end of #define 2018-06-27 15:47:49 -05:00
Cruz Monrreal ea47342f81
Merge pull request #7214 from SenRamakri/sen_ErrorOptimAndConfig
Error handling configuration updates and Optimization for exception handling
2018-06-25 10:10:49 -05:00
Deepika bc65153a4d Add names to idle/timer thread 2018-06-21 18:32:43 -05:00
ccli8 8071409963 Move RTX_NO_MULTITHREAD_CLIB from RTX_Config.h to mbed_rtx_conf.h
This is to avoid change to RTX code base.
2018-06-21 09:57:21 +08:00
ccli8 f055c2a700 Add comment with RTX_NO_MULTITHREAD_CLIB movement 2018-06-21 09:54:47 +08:00
Senthil Ramakrishnan baa44eb3f2 Limit error filename capture to 64 chars, wrapping tests with right configs and astyle fixes. 2018-06-20 11:56:32 -05:00
Senthil Ramakrishnan dcdd616e6d Update exception handling code to remove dedicated fault safe printfs and use mbed_error_printf to optimize memory usage.
Dedicated safe printfs were originally developed to print data over serial with minimal resources. But this adds more code space, so we are switching to use mbed_error_printf.
2018-06-20 11:56:32 -05:00
ccli8 afc0a28cc5 Support thread-safety with ARMC6
1. Define RTX_NO_MULTITHREAD_CLIB to provide Mbed-specific multi-thread support for ARM/ARMC6
2. All overridden _mutex_xxx functions are declared with __USED to avoid excluded by linker

NOTE: Microlib doesn't support multi-thread
2018-06-20 10:35:47 +08:00
Jan Jongboom 63d1684bbe
Spelling error in fault handler 2018-06-18 10:58:12 +08:00
Michael Coulter 3d3e89097d Fixes for RZ_A1H issue 6543
Removed debugging code, fixed errors indicated in the comments.
2018-06-11 13:30:17 -05:00
Cruz Monrreal 1fa333df82
Merge pull request #7032 from TomoYamanaka/feature-rtx_update
Update cmsis/rtx for Cortex-A
2018-06-02 20:52:40 -05:00
Cruz Monrreal f92c227558
Merge pull request #7027 from c1728p9/timer_fix
Fix possible bug with SysTimer
2018-05-31 11:07:34 -05:00
Vladimir Umek 4251af0248 RTX5 (Cortex-A): exception handling restructured, post processing moved after context save. 2018-05-28 19:36:42 +09:00
Vladimir Umek 165c663871 RTX5: fixed nesting interrupt handling (Cortex-A) 2018-05-28 13:55:35 +09:00
Vladimir Umek b6c4139328 RTX5: ignoring CPUID field in GIC implementation
updated interrupt handler for GCC and IAR
2018-05-28 13:54:44 +09:00
Vladimir Umek 0226b11b67 RTX5: disabled OS Tick interrupt during post processing in IRQ handler for Cortex-A devices 2018-05-28 12:52:11 +09:00
Russ Butler aa6b931698 Fix possible bug with SysTimer
Ensure the SysTimer isn't added to the timer list twice by adding
an extra call to remove() inside suspend().
2018-05-27 13:15:00 -05:00
Bartek Szatkowski a92ff94904 Fix rebase error 2018-05-25 12:20:10 -05:00
Bartek Szatkowski 9575dd26ec Don't use tickless if LPTICKER is not present
The current implementation of tickless requires LPTICKER to be present.
2018-05-25 12:20:09 -05:00
Cruz Monrreal 527f9a12fd
Merge pull request #6983 from SenRamakri/sen_ErrorHandling_Push2
Standardized Error Handling and Error Codes
2018-05-24 10:57:00 -05:00
Martin Kojtal d8cb72a0a2
Merge pull request #6273 from bulislaw/update_cmsis_5.3
Update cmsis/rtx to version 5.3
2018-05-24 09:37:40 +02:00
Senthil Ramakrishnan 5ef6728c08 Splitting MBED_ERROR macros to support ones with/without error value argument 2018-05-23 12:21:28 -05:00
Senthil Ramakrishnan 693a6c40bb Refactor error reporting 2018-05-23 12:21:11 -05:00
Senthil Ramakrishnan d4fe75731d Adding mbed prefixes to all macros and functions to avoid namespace conflicts 2018-05-23 12:21:10 -05:00
Senthil Ramakrishnan 147d9cac4e Test application/cases optimization for some low memory targets, macro changes and test fixes 2018-05-23 12:21:10 -05:00
Senthil Ramakrishnan cbfc06577b Fixes to align with naming conventions 2018-05-23 12:21:09 -05:00
Senthil Ramakrishnan 92df68b1ea Changed variable names for registers to avoid namespace conflicts, build fixes, macros and other fixes 2018-05-23 12:21:09 -05:00
Senthil Ramakrishnan 530e9d323f Changed variable names for registers to avoid namespace conflicts and rtos disabled build fixes 2018-05-23 12:21:09 -05:00
Senthil Ramakrishnan 2e28dd95e1 Change set_error/set_error_fatal to warning/error, add itm support and other changes 2018-05-23 12:21:08 -05:00
Senthil Ramakrishnan 9041b475c6 Error handling/logging implementation and tests 2018-05-23 12:21:07 -05:00
Bartek Szatkowski b4d5f0e10f CMSIS: Move non-config includes behind PTIM ifdef
That is to enabled integration with build-it-all Mbed OS type build
system.

Cherry-picked from CMSIS_5 repo: e8d0a476
2018-05-14 12:18:21 +01:00
Bartek Szatkowski 1752803626 CMSIS/RTX: Fix using FALSE/TRUE with preprocesor 2018-05-14 12:18:21 +01:00
Bartek Szatkowski a1fb51c283 RTX5: uVisor: Remove static from svcRtxKernelUnlock/Lock to support uVisor 2018-05-14 12:18:21 +01:00
Jaeden Amero 2f7a841e0e RTX5: uVisor: Defer to uVisor for SVCall priority
Only set the SVCall priority if uVisor is not present. If uVisor is
present, keep using whatever priorities it has already set up.
2018-05-14 12:18:21 +01:00
Jaeden Amero 32d04a08d0 RTX5: uVisor: Add OsEventObserver
Add the OsEventObserver mechanism. A client interested in receiving
notifications on certain OS events can register to receive notifications
with osRegisterForOsEvents. This is useful for clients like the secure
memory allocator, which observes thread switching events in order to
swap in and out different memory allocator objects.
2018-05-14 12:18:21 +01:00