Commit Graph

152 Commits (17ed9e9777b328810ca891e0cafd11528a6bab6a)

Author SHA1 Message Date
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
Sam Grove c1ee7fb494 Merge pull request #2504 from ohagendorf/disco_f769_ii
[Disco_F769NI] adding new target
2016-09-10 07:16:21 -05:00
Sam Grove 14f5647d62 Merge pull request #2643 from c1728p9/fix_thread_self_termination
Fix thread self termination
2016-09-09 18:01:38 -05:00
Sam Grove 3bb149cab2 Merge pull request #2549 from geky/thread-clarification
Clean up confusion with deprecated constructors and callbacks in thread-spawning functions
2016-09-09 17:58:13 -05:00
ohagendorf 54adfe10c0 [disco_f769ni] adding rtos lib 2016-09-09 14:18:16 +02:00
Sam Grove 57ebf8bdad Merge pull request #2548 from jamike/NUCLEO_F303ZE
Nucleof303ze
2016-09-09 01:48:13 +02:00
Sam Grove a6b27319ec Merge pull request #2496 from geky/callback-cv
Add cv-qualifiers to Callback and deprecate combinatorial explody functions
2016-09-09 01:45:25 +02:00
Russ Butler b49d7e4fb4 Properly handle a thread which terminates itself
In Thread::terminate() release the join semaphore before terminating
the thread. This allows the join semaphore to be properly signaled in
the case where a thread is terminating itself.
2016-09-07 17:21:25 -05:00
Michel Jaouen aae0b921db [NUCLEO_F303ZE] Add RTOS support 2016-09-05 09:09:42 +02:00
ccli8 0194135bf3 [NUC472] Fix heap configuration error with armcc
In rtos/rtx/TARGET_CORTEX_M/RTX_CM_lib.h, Image$$ARM_LIB_HEAP$$Base/Image$$ARM_LIB_HEAP$$Length will cause zero memory allocation.
Fix it with Image$$ARM_LIB_HEAP$$ZI$$Base/Image$$ARM_LIB_HEAP$$ZI$$Length. This is to place heap at external SRAM.
2016-08-31 14:32:13 +08:00
Tony Wu 934ac09d69 STM32F4 - Fix STM32F407VG target name
The target name of STM32F407VG should be TARGET_STM32F407VG,
rather than TARGET_F407VG.

Signed-off-by: Tony Wu <tung7970@gmail.com>
2016-08-29 20:52:11 +08:00
Sam Grove ea56684fff Merge pull request #2531 from radhika-raghavendran/master
ncs36510 from ON Semiconductor
2016-08-27 07:31:39 -05:00
Christopher Haster 022f821d0c Rewrote thread deprecation notices to help migration
User feedback indicated that the previous deprecation notices
were confusing and mislead migration from the old style of thread
spawning.

The deprecation notices were updated to emphasize the replacement
functions, and examples of correct usage were added in the doxygen.
2016-08-26 12:50:13 -05:00
Alessandro Angelino b98227c939 K64F: Revert to hardcoded stack pointer in RTX 2016-08-26 17:19:04 +01:00
Christopher Haster 45d25ed493 Added support for cv-qualifiers in Callback class
Additionally, the following changes were don to avoid combinatorial
explosion in function overloads as a result of adding cv-qualifiers:
- Added convenience function for inferred type
- Deprecated callback overloads qhere cv-qualifiers are not scalable

Supported overloads:
callback(void (*f)(A...));
callback(const Callback<R(A...)> &);
callback(T *t,                void (*f)(T*, A...));
callback(const T *t,          void (*f)(const T*, A...));
callback(volatile T *t,       void (*f)(volatile T*, A...));
callback(const volatile T *t, void (*f)(const volatile T*, A...));
callback(T *t,                void (T::*f)(A...));
callback(const T *t,          void (T::*f)(A...) const);
callback(volatile T *t,       void (T::*f)(A...) volatile);
callback(const volatile T *t, void (T::*f)(A...) const volatile);
2016-08-26 09:40:22 -05:00
Sam Grove 030261f2c4 Merge pull request #2544 from tung7970/master
Fix implicit declaration of function 'atexit'
2016-08-26 09:30:19 -05:00
Sam Grove daf4b1c6b1 Merge pull request #2528 from jeremybrodt/max32620
[MAX32620HSP] Initial release.
2016-08-26 09:25:33 -05:00
Radhika b75379f353 Adding NCS36510 support in mbed-os5.1 2016-08-26 12:00:54 +05:30