Commit Graph

169 Commits (be0f65a41793e4ecdd6dca2969cf948902e5c0d0)

Author SHA1 Message Date
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
TomoYamanaka 33d5c5139d Fix Stack stats by running the test command with "-DMBED_HEAP_STATS_ENABLED=1"
In CI, I receive an mbed assert of stack stats by running the following commands. Its assert is TIMEOUT.
mbed test -m RZ_A1H -t GCC_ARM -DMBED_STACK_STATS_ENABLED=1 --clean --compile
mbed test -m RZ_A1H -t GCC_ARM --run -n tests-mbed_drivers-stl_features -v

So, I fixed the process of related to stack stats (osThreadInfoStackMax).The Detail contents is here.
https://github.com/ARMmbed/mbed-os/issues/3273#issuecomment-268407191
2017-01-23 18:11:27 +09:00
TomoYamanaka 9af3173993 [RZ/A1H]Support RTX v4.80 for Cortex-A and a few Malloc API (#3470)
* [RZ/A1H]Support RTX v4.80 for Cortex-A and a few Malloc API

PR to update RTX to v4.80 for Cortex-A.
In the latest CI test, three tests result in an error. The cause is mainly three points
- Unsupport RTX v4.80 for Cortex-A
- Insufficient stack size of thread defined in test
- A few Lack of Malloc API in GCC
Therefore, I supported to these. For the stack size for test, @Russ already supported in PR #3362.

Reference for issue of test error is here.
https://github.com/ARMmbed/mbed-os/issues/3273

Reference for PR to update RTX for Cortex-M.
https://github.com/ARMmbed/mbed-os/pull/1702

* Revert "[RZ/A1H]Support RTX v4.80 for Cortex-A and a few Malloc API"

This reverts commit e71f79aaf2.

* [RZ/A1H]Support RTX v4.80 for Cortex-A and a few Malloc API

PR to update RTX to v4.80 for Cortex-A.
In the latest CI test, three tests result in an error. The cause is mainly three points
- Unsupport RTX v4.80 for Cortex-A
- Insufficient stack size of thread defined in test
- A few Lack of Malloc API in GCC
Therefore, I supported to these. For the stack size for test, @c1728p9 already supported in PR #3362.

Reference for issue of test error is here.
https://github.com/ARMmbed/mbed-os/issues/3273

Reference for PR to update RTX for Cortex-M.
https://github.com/ARMmbed/mbed-os/pull/1702
2017-01-09 10:11:52 -06:00
Sarah Marsh ee7e21d722 Remove Thread::wait from thread example 2016-12-20 10:42:29 -06:00
sarahmarshy dd07d30c7e Remove invalid thread::start example
This changes reflects the correct syntax for spawning a thread that will execute a local function with given parameters.
2016-12-19 14:43:38 -06:00
Christopher Haster 048a47b908 Marked the RtosTimer class as deprecated
The non-irq timer functionality provided by the RtosTimer is now
duplicated by the EventQueue. See RtosTimer.h for more info.
2016-11-07 13:01:08 -06:00
Sam Grove f2b49b860d Merge pull request #2949 from NXPmicro/Fix_For_Cortex_M4
The HAL CM4 for ARM and IAR toolchains is valid only for FPU present.…
2016-10-07 11:15:22 -05:00
Sam Grove 3a16ca9855 Merge pull request #2911 from theotherjimmy/docs-generation
[Tools] Add documentation generation script
2016-10-06 15:57:08 -05:00
Mahadevan Mahesh b290c71f57 The HAL CM4 for ARM and IAR toolchains is valid only for FPU present. These guards were added
to mbed SDK as there are targets with Cortex-M4. This is similar to the implementation already
done for GCC ARM

Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2016-10-06 09:27:59 -05:00
Jimmy Brisson f1a78027d3 Add tags to our code 2016-10-04 15:02:44 -05:00
Laurent MEUNIER 3a61bd025f INIT:ARM + rtos: Align pre-main initialization steps between TCs
Various toolchains supported in MBED don't followthe same initialization
steps. This can have impacts on platform behavior.

For STM32, it is needed to call the HAL_Init() _after_ the  RAM has been
initialized (sdata from flash / zero initialized data) and _before_ the C++
objects are being created, especially if those objects require support
of tickers for instance.

In GCC and IAR, this was done in previous commit to avoid HAL_Init()
to be called twice.

In ARM this there is no hook defined in MBED yet to place the call.
The proposal is to take benefit of the library's
_platform_post_stackheap_init function that is going to be called before
__rt_lib_init where the C++ object init is done (__cpp_initialize__aeabi_)

In case of mbed with rtos, the __rt_entry is redefined so we need to add
the call to _platform_post_stackheap_init.

This series should solve issue reported here:
STM32 (At least F401) breaks if Tickers are activated in a global object #2115
2016-10-04 14:55:28 -05:00
Sam Grove 301b77c4b2 For drivers, events, hal, platform, rtos and mbed.h add one level of path to make sure specific and unique includes files are found. 2016-10-01 02:11:36 -05:00
Christopher Haster 2dd90bbe3c restructure - Restructured rtos directory 2016-09-30 19:18:09 -05:00
Mike Fiore 7836c6eaf1 rebase support for MultiTech xDot platform
[XDOT_L151] copy new target CMSIS files from NZ32_SC151 target

[XDOT_L151] remove Modtronix code, add HardFault_Handler, update clock configuration to match xDot hardware

[XDOT_L151] copy new target HAL files from NZ32_SC151 target

[XDOT_L151] update HAL to match xDot hardware

[XDOT_L151] add xdot_eeprom.* and xdot_low_power.* files

[XDOT_L151] add RTOS support for target

Conflicts:
	rtos/rtx/TARGET_CORTEX_M/RTX_Conf_CM.c

[XDOT_L151] match NUCLEO_L152RE startup code for GCC_ARM so RTOS works

[XDOT_L151] fix GPIO write failure

[XDOT_L151] add XDOT_L151CC target to targets.json

[XDOT_L151] change xDot default stack size to 256 bytes and main stack size to 1.5kB

[XDOT_L151] update PinNames.h to match rev E hardware - no change to external pinout

[XDOT_L151] update style in custom xDot HAL files

Conflicts:
	rtos/rtx/TARGET_CORTEX_M/RTX_CM_lib.h
	rtos/rtx/TARGET_CORTEX_M/RTX_Conf_CM.c
2016-09-27 00:13:08 -07:00
Sam Grove 196584d571 Merge pull request #2805 from RobMeades/master
OS_TCB struct size is increased to 64 bytes (from 60 bytes).  With th…
2016-09-25 22:20:29 -05:00
Sam Grove c49e970909 Merge pull request #2794 from geky/callback-c-order
callback - Reorder optional argument to static C function
2016-09-25 22:07:45 -05:00
Sam Grove 5556d781a1 Merge pull request #2779 from jeromecoutant/PR_NUCLEO_F103RB
[NUCLEO_F103RB] RTOS tests update
2016-09-25 21:57:35 -05:00
Sam Grove e453b5ea9f Merge pull request #2391 from geky/fix-rtos-critical-sections
[rtos] Fix irq-safe rtx calls when inside critical sections
2016-09-24 16:22:26 -05:00
Rob Meades 0b2657932d OS_TCB struct size is increased to 64 bytes (from 60 bytes). With the change to introduce stats checking in commit c1728p9, OS_TCB now includes an extra pointer, *argv, hence it is larger by 4 bytes. 2016-09-24 18:11:10 +01:00
Christopher Haster b371eb5269 callback - Reordered optional argument to static C function
Before:
Callback<void()> a = callback(obj, member)
Callback<void()> b = callback(context, function)

After:
Callback<void()> a = callback(obj, member)
Callback<void()> b = callback(function, context)

This ordering is more intuitive based on feedback from users. This order
was initially considered but proved problematic when integrated with
other variable arguments in attach functions.

With `callback` as a separate convenience function, this style
no longer presents a problem.
2016-09-23 04:52:58 -05:00
Christopher Haster 3e7b5ed6b9 Fixed rtx calls when inside critical sections
Before, rtx calls would hard fault in critical sections when an svc
instruction was attempted with interrupts disabled.

Required changes:
- Added check for CPSR I bit in cortex A rtx
- Added check for PRIMASK in cortex M rtx
- Modified critical sections in cortex M rtx to be recursive
  (already recursive in cortex A)
2016-09-22 21:19:22 -05:00
jeromecoutant c416a1286d [NUCLEO_F103RB] RTOS tests update
As this target has 20K RAM, default stack size needs to be tuned
2016-09-22 14:48:11 +02:00
Tony Wu aa663ea42d RTOS - Move per-target RTX config to mbed_rtx.h
Disintegrate global RTX target config. Move per-target fragment
to mbed_rtx.h under each vendor's directory.

One mbed_rtx.h is defined for each vendor at this moment, however,
the granularity of mbed_rtx.h can be per-chip, or per-board
if necessary.

Signed-off-by: Tony Wu <tung7970@gmail.com>
2016-09-22 15:09:49 +08:00
Sam Grove 0c0455bf3f Merge pull request #2745 from pan-/disable_global_objects_destruction
Disable global objects destruction
2016-09-22 00:48:08 -05:00
Vincent Coubard ce23ec3120 Disable registration of __libc_fini_array in the init process.
With this call, destructors are not registered for execution atexit.
2016-09-19 13:54:50 +01:00
jeromecoutant 7eb69b041f STM32F070RB/STM32F072RB: decrease thread_stack_main size
Thread_stack_main is by default too large for this 16K target
2016-09-19 10:17:53 +02:00
jeromecoutant 519b52181f [STM32F070RB] correct INITIAL_SP 2016-09-19 10:17:30 +02:00
Sam Grove ee1cba0b69 Merge pull request #2572 from tung7970/master
Fix STM32F407VG target name and LPC11U6X linker errors
2016-09-18 17:44:55 -05:00
Sam Grove 52fd7b6864 Merge pull request #2642 from c1728p9/stack_stats
Stack stats
2016-09-16 17:24:20 -05:00
Martin Kojtal 21a2123aad Merge pull request #2669 from andreaslarssonublox/updated_master
Target - Add u-blox C029 target
2016-09-14 10:35:22 +01:00
Russ Butler 8447843c68 Fix error handling when thread cannot be created
Update the Thread::start function to gracefully handle the failed
creation of a thread when there are no TCBs left. This patch does
the following:
1. Set memory handles to NULL after free to prevent double free
2. Post to the release semaphore so anything that tries to join this
    thread will join immediately
3. Remove dead return path since the new operator should never
    return NULL (it should trap instead)
2016-09-13 15:53:19 -05:00
Russ Butler 9e4a479794 Add prefix to mark cmsis_os functions as private
Add a leading underscore to give an indication that the new cmsis_os
API functions are not official.
2016-09-13 15:53:17 -05:00
Russ Butler 1041904914 Turn on stack init so stack usage is correct
Initialize stack memory since this is required for stack metrics to
work.
2016-09-13 15:52:08 -05:00
Russ Butler 6fd9154d75 Add task terminate hook
Add an RTX hook which gets called when a thread terminates. Add
the function Thread::attach_terminate_hook() to allow users to attach
a hook to this event at runtime.
2016-09-13 12:59:05 -05:00
Russ Butler c319296692 Add RTX API to report stack usage
Add the function osThreadGetInfo to allow various Thread information
to be queried.  This includes stack size and maximum stack usage among
other things.

Note - for Cortex-A devices the worst case stack usage is not
available.
2016-09-13 12:58:57 -05:00
Russ Butler ad24b7d982 Add RTX API to enumerate running threads
Add the functions osThreadsEnumStart, osThreadEnumNext and
osThreadEnumFree to allow enumeration of running threads. Protect
thread creation, thread exit and thread termination with a mutex
so threads are not created or destroyed while an enumeration is
ongoing.
2016-09-12 17:08:36 -05:00
andreas.larsson 173486fac0 Added u-blox C029 target 2016-09-12 13:41:38 +02:00
jeromecoutant 2d2a4bcf4b 8K RAM target is too small for RTOS support 2016-09-12 11:49:43 +02:00
Sam Grove 582da03312 Merge pull request #2589 from OpenNuvoton/ccli8
[NUC472] Fix heap configuration error with armcc
2016-09-10 13:08:47 -05:00