Jimmy Brisson
2ffd264bba
Merge pull request #4601 from pan-/fix_memory_pool_destructor
...
rtos: Fix MemoryPool and Queue destructor
2017-06-29 11:07:38 -05:00
Bartek Szatkowski
8cc21ea505
RTX: Fixed RTXv5 mutex owner list handling.
...
The prev-pointer of the running threads mutex list was not set when
multiple mutexes are acquired at a time. This leads to a corrupted list
if the mutexes are not freed in reversed order.
Original commit for CMSIS_5:
commit 729f6ab08540342b7de7612fac103539d5b2f168
Author: Jonatan Antoni <jonatan.antoni@arm.com>
Date: Wed Apr 19 15:38:43 2017 +0200
2017-06-27 14:39:34 +01:00
Vincent Coubard
e690ee04e0
rtos: Add missing Queue destructor.
2017-06-21 11:21:34 +01:00
Vincent Coubard
b49fbf1d91
rtos: Add missing destructor for MemoryPool objects.
2017-06-21 11:14:50 +01:00
Vincent Coubard
3119c4238d
rtos Thread: Remove private copy constructor and assignment operators in favor of the NonCopyable traits.
2017-06-20 16:23:44 +01:00
Vincent Coubard
4d5f805cde
rtos: Tag non value type as NonCopyable.
...
The types marked are: Mail, MemoryPool, Mutex, Queue, RtosTimer and Semaphore.
2017-06-20 16:23:44 +01:00
Jimmy Brisson
77b6127a71
Merge pull request #4579 from geky/rtos-unbreak-semaphore
...
RTOS: Fix semaphore
2017-06-19 15:32:48 -05:00
Christopher Haster
6b02ceab5d
rtos: Unbreak semaphore, trade assert for saturation with original limit
...
Before rtx 5, the max count on semaphores was UINT16_MAX, aftewards it
was decreased to 1024 with an assert on overflow.
This is especially problematic for semaphores used for signaling, since
there is no replacement currently available in C++.
2017-06-16 17:18:40 -05:00
Vincent Coubard
fd7eff202c
RTOS: Allow per target definition of OS_IDLE_THREAD_STACK_SIZE.
...
The stack required for the idle thread is highly dependent on the
target because it will call the sleep function which is target
specific.
While 256 bytes of stack is enough for most targets, others like the
NRF52840 might require more.
With this change, target maintainers can specify the idle thread stack
size in their mbed_rtx.h file.
2017-06-16 10:11:12 +01:00
Russ Butler
fc18250b1f
Increase background stack size to fix overflow
...
Bump the background stack size to 512 bytes to fix stack overflows on
the NRF52 and so it is the same size as it was before the switch to
RTX5.
2017-06-14 17:31:52 -05:00
Martin Kojtal
d3cf5fb999
Merge pull request #4445 from theotherjimmy/fix-exporters
...
Fixes for exporter issues
2017-06-09 15:04:01 +01:00
Jimmy Brisson
fc6c2b85ff
Upcase assembly file suffix for preprocesssing
2017-06-09 00:03:23 -05:00
Kevin Gilbert
567589f138
Resolve Doxygen errors from RTOS. Fixed minor Doxygen bug in FileSystemHandle.h as well
2017-06-08 15:51:04 -05:00
Jaeden Amero
778d6822bf
RTX5: uVisor: Switch threads very carefully
...
uVisor doesn't set the PSP of the target thread. The RTOS sets the PSP
of the target thread from the target thread's TCB. However, when
interrupts of higher priority than PendSV happen between the call to
uVisor to switch boxes, and the RTOS setting PSP, the uVisor vIRQ
interrupt handler will attempt to use an invalid PSP (the PSP from
before the box and thread switch). This leads to a crash. Make box and
thread switching atomic by disabling interrupts immediately before the
box switching until immediately after the new PSP is set.
2017-06-04 14:41:59 +01:00
Russ Butler
cabc1e0911
Fix Thread class synchronization
...
Prevent osTheadTerminate from being called on an already terminated
thread. Also make sure the thread termination process is properly
synchronized.
2017-06-02 23:50:38 -05:00
Russ Butler
96bd943ea2
RTX5: Enable priority inheritance and robust mode
...
Add the attribute flash to enable priority inheritance and robust mode.
The robust flag allows mutexes held by terminated threads to be
properly released.
2017-06-02 23:50:36 -05:00
Russ Butler
e48e599a9d
Fix RTOS function prototypes by adding extern "C"
...
Wrap the file mbed_rtos_storage.h in extern "C". This allows the
functions inside rtx_lib.h to have correct definitions when included
in a C++ file.
This is required for the RTX5 error trapping.
2017-06-02 23:50:32 -05:00
Bartosz Szatkowski
39a1b39ce1
Bump number of ARMC mutexes to fix PAL test failure
2017-05-30 18:55:56 +01:00
Yuguo Zou
f03509c6cb
Add up OS_MUTEX_NUM for ARMCC compiler
...
CI shield test (SPI test) may need 7 mutexes
2017-05-30 18:55:56 +01:00
Bartek Szatkowski
80cb65e094
Add more verbose RTOS error messages
2017-05-30 18:55:56 +01:00
Bartek Szatkowski
a8229b5351
Make sure all RTOS attribute structures are 0-ed before use
2017-05-30 18:55:56 +01:00
Bartek Szatkowski
0064df1ce6
Add name parameter for C++ mutex wrapper
2017-05-30 18:55:55 +01:00
Bartek Szatkowski
e66f9ee818
Fix IAR coding style and thread/mutex namingin mbed_boot.c
2017-05-30 18:55:55 +01:00
Bartek Szatkowski
b01f13d1a0
Make sure all system threads and mutexes have clear names
2017-05-30 18:55:55 +01:00
Bartek Szatkowski
05548e786d
Rename directories rtx->rtx4 rtx2->rtx5
2017-05-30 18:55:55 +01:00
Bartek Szatkowski
535ee8ba25
Make stack sizes configurable by the app
...
Application can overwrite stack sizes by defining main-stack-size and
thread-stack-size in mbed_app.json
2017-05-30 18:55:55 +01:00
Bartek Szatkowski
b793a3fb89
Update codebase for CMSIS5/RTX5
...
Update all of mbed-os to use RTX5.
2017-05-30 18:55:52 +01:00
Bartek Szatkowski
7b022f8785
Modify CMSIS 5 so it is suitable for mbed-os
...
Make changes to the files taken from RTX5/CMSIS5 so they work
with mbed-os and uvisor.
2017-05-30 18:53:38 +01:00
Jaeden Amero
7ae2e6e9ec
RTX5: uVisor: Use OsEventObserver
2017-05-30 18:53:38 +01:00
Jaeden Amero
24c60f6cc7
RTX5: uVisor: Extend thread control block with context
...
OsEventObserver objects expect a context to be maintained per thread on
their behalf. Add this context to the thread control block and extend
the thread creation functions with the ability to supply a context.
2017-05-30 18:53:38 +01:00
Jaeden Amero
756e0cae99
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.
2017-05-30 18:53:38 +01:00
Jaeden Amero
25021f271a
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.
2017-05-30 18:53:37 +01:00
Bartek Szatkowski
a9a29a4529
Pull in CMSIS 5 files
...
Pull in unmodified CMSIS5 files from the repository
https://github.com/ARM-software/CMSIS_5.git from the commit
c1b4232f4a98275dd79ebc99cf9b5da5053def4d.
The files were copied as shown below with source->dest_dir.
CMSIS_5/CMSIS/Core/Include/core_*.h -> mbed-os/cmsis/
CMSIS_5/CMSIS/Core_A/Include/core_*.h -> mbed-os/cmsis/
CMSIS_5/CMSIS/DSP/Include/arm_math.h -> mbed-os/cmsis/
CMSIS_5/CMSIS/Core/Include/tz_context.h -> mbed-os/cmsis/
CMSIS_5/CMSIS/Core/Include/cmsis_compiler.h -> mbed-os/cmsis/TARGET_CORTEX_M/
CMSIS_5/CMSIS/Core/Include/cmsis_arm*.h -> mbed-os/cmsis/TARGET_CORTEX_M/TOOLCHAIN_ARM/
CMSIS_5/CMSIS/Core/Include/cmsis_gcc*.h -> mbed-os/cmsis/TARGET_CORTEX_M/TOOLCHAIN_GCC/
CMSIS_5/CMSIS/Core_A/Include/cmsis_compiler.h -> mbed-os/cmsis/TARGET_CORTEX_A/
CMSIS_5/CMSIS/Core_A/Include/cmsis_arm*.h -> mbed-os/cmsis/TARGET_CORTEX_A/TOOLCHAIN_ARM/
CMSIS_5/CMSIS/RTOS2/RTX/Library/cmsis_os1.c -> mbed-os/rtos/rtx/
CMSIS_5/CMSIS/RTOS2/Include/cmsis_os2.h -> mbed-os/rtos/rtx2/TARGET_CORTEX_M/
CMSIS_5/CMSIS/RTOS2/RTX/Config/* -> mbed-os/rtos/rtx2/TARGET_CORTEX_M/
CMSIS_5/CMSIS/RTOS2/RTX/Include1/* -> mbed-os/rtos/rtx/
CMSIS_5/CMSIS/RTOS2/RTX/Include/* -> mbed-os/rtos/rtx2/TARGET_CORTEX_M/
CMSIS_5/CMSIS/RTOS2/RTX/Source/rtx_* -> mbed-os/rtos/rtx2/TARGET_CORTEX_M/
CMSIS_5/CMSIS/RTOS2/RTX/Source/core_cm.h -> mbed-os/rtos/rtx2/TARGET_CORTEX_M/
CMSIS_5/CMSIS/RTOS2/RTX/Source/ARM/irq_cm0.s -> mbed-os/rtos/rtx2/TARGET_CORTEX_M/TARGET_M0/TOOLCHAIN_ARM/
CMSIS_5/CMSIS/RTOS2/RTX/Source/GCC/irq_cm0.s -> mbed-os/rtos/rtx2/TARGET_CORTEX_M/TARGET_M0/TOOLCHAIN_GCC/
CMSIS_5/CMSIS/RTOS2/RTX/Source/IAR/irq_cm0.s -> mbed-os/rtos/rtx2/TARGET_CORTEX_M/TARGET_M0/TOOLCHAIN_IAR/
CMSIS_5/CMSIS/RTOS2/RTX/Source/ARM/irq_cm0.s -> mbed-os/rtos/rtx2/TARGET_CORTEX_M/TARGET_M0P/TOOLCHAIN_ARM/
CMSIS_5/CMSIS/RTOS2/RTX/Source/GCC/irq_cm0.s -> mbed-os/rtos/rtx2/TARGET_CORTEX_M/TARGET_M0P/TOOLCHAIN_GCC/
CMSIS_5/CMSIS/RTOS2/RTX/Source/IAR/irq_cm0.s -> mbed-os/rtos/rtx2/TARGET_CORTEX_M/TARGET_M0P/TOOLCHAIN_IAR/
CMSIS_5/CMSIS/RTOS2/RTX/Source/ARM/irq_cm3.s -> mbed-os/rtos/rtx2/TARGET_CORTEX_M/TARGET_M3/TOOLCHAIN_ARM/
CMSIS_5/CMSIS/RTOS2/RTX/Source/GCC/irq_cm3.s -> mbed-os/rtos/rtx2/TARGET_CORTEX_M/TARGET_M3/TOOLCHAIN_GCC/
CMSIS_5/CMSIS/RTOS2/RTX/Source/IAR/irq_cm3.s -> mbed-os/rtos/rtx2/TARGET_CORTEX_M/TARGET_M3/TOOLCHAIN_IAR/
CMSIS_5/CMSIS/RTOS2/RTX/Source/ARM/irq_cm4f.s -> mbed-os/rtos/rtx2/TARGET_CORTEX_M/TARGET_RTOS_M4_M7/TOOLCHAIN_ARM/
CMSIS_5/CMSIS/RTOS2/RTX/Source/GCC/irq_cm4f.s -> mbed-os/rtos/rtx2/TARGET_CORTEX_M/TARGET_RTOS_M4_M7/TOOLCHAIN_GCC/
CMSIS_5/CMSIS/RTOS2/RTX/Source/IAR/irq_cm4f.s -> mbed-os/rtos/rtx2/TARGET_CORTEX_M/TARGET_RTOS_M4_M7/TOOLCHAIN_IAR/
2017-05-30 18:53:37 +01:00
Russ Butler
fd233778db
Remove RTOS and CMSIS files
...
Remove the RTOS and CMSIS files in preperation for CMSIS 5. Note that
the RTOS heap ad stack test is left since this is still applicable to
RTX5. This file can be found here:
rtos\rtx\TARGET_CORTEX_M\TESTS\memory\heap_and_stack\main.cpp
2017-05-30 18:53:37 +01:00
Russ Butler
0a3b2561bc
Merge pull request #4316 from c1728p9/remove_cortex_a
...
Remove Cortex A boards as Cortex-A it is not supported in CMSIS5/RTX2
2017-05-15 11:55:36 -05:00
Martin Kojtal
1b94d5abd1
Merge pull request #4292 from bulislaw/fix_release_version
...
Set mbed minor and patch version to 0 for master
2017-05-15 16:19:41 +01:00
Bartek Szatkowski
5f29445103
Remove Cortex A support from CMSIS/RTOS
...
This change is temporary, Cortex A support will be reenabled when it's
fully supported in CMSIS/RTX 5.
2017-05-15 11:53:59 +01:00
Bartek Szatkowski
2ddf4b33cb
CMSIS5: Remove ARM7 support and targets
2017-05-12 13:48:43 -05:00
Bartek Szatkowski
be0f65a417
Set mbed minor and patch version to 0 for master
...
The proper version will be set for releases.
2017-05-09 16:37:04 +01:00
Jimmy Brisson
7ace0cbb14
Merge pull request #3881 from geky/log-no-io
...
Remove debug links to printf/exit in NDEBUG builds
2017-05-02 11:37:10 -05:00
Christopher Haster
cfc223cc3f
Removed debug links to printf/exit in NDEBUG builds
...
Allows development of small applications where stdio is avoided
2017-04-24 10:40:24 -05:00
Anna Bridge
88fb819e25
Merge pull request #3862 from c1728p9/thread_start_assert
...
Trap earlier when a Thread instance is re-used
2017-03-14 14:36:39 +00:00
Russ Butler
88f879d0f8
Prevent underflow in heap size calculation
...
If the free memory on a device is small enough then the calculation to
determine heap size could underflow to a large value. If this happens
then malloc will never return failure and instead will cause a crash on
allocation. This patch prevents the underflow so malloc works as
expected even with low amounts of free memory.
2017-03-06 17:15:51 -06:00
Russ Butler
ab4da40e81
rtos: Prevent Thread class from being copied
...
Make the copy constructor and assignment operator private to prevent
them from being used.
2017-03-06 11:54:58 -06:00
Russ Butler
05403d4231
rtos: Add Inactive return to thread get state
...
If a thread hasn't been started return Inactive as the status when
Thread::get_state() is called.
2017-03-06 11:54:57 -06:00
Russ Butler
11ef1d10b8
rtos: Return an error when a Thread is re-used
...
Calling Thread::start multiple times leads to undefined behavior since
the Thread class was not designed to handle being restarted. Return an
error code if Thread::start is called a second time to prevent this
behavior.
2017-03-06 11:54:50 -06:00
Christopher Haster
aff49d8d1e
Renamed files in platform to match source names
...
critical.h -> mbed_critical.h
sleep.h -> mbed_sleep.h
toolchain.h -> mbed_toolchain.h
rtc_time.h -> mbed_rtc_time.h
semihost_api.h -> mbed_semihost_api.h
wait_api.h -> mbed_wait_api.h
2017-02-22 18:17:54 -06:00
Sam Grove
e852d7fecf
Merge pull request #3566 from betzw/betzw_wb_sleep
...
Put system to sleep when going idle
2017-02-07 10:30:33 -06:00
Wolfgang Betz
2a585ea060
Include new "platform/sleep.h" file
2017-01-26 13:14:54 +01:00
Wolfgang Betz
c6897c58dc
Put system to sleep when going idle
2017-01-26 12:59:39 +01:00