Commit Graph

110 Commits (014c5f46f52588f5b8b1b0de1eb73e12406c0b51)

Author SHA1 Message Date
Toyomasa Watarai 014c5f46f5 [RTOS] Add Nucleo STM32L152RE platform
* Add RTOS support for Nucleo STM32L152RE
* Add RTOS tests for the target
* Add RTOS build for build travis
2015-05-14 13:05:57 +09:00
raulMrello a73ee5c3d6 Updated Thread.cpp|.h to support signal clear 2015-05-04 09:35:58 +02:00
Martin Kojtal 7c1fba2cda Merge pull request #1074 from dbestm/master
[NUCLEO_F3xxRx][RTOS]enhance source and test
2015-04-27 09:42:20 +01:00
Christoph Plank 82b7d9d3f7 Added RTOS support for TEENSY3_1 target 2015-04-18 17:00:57 +02:00
Christoph Plank bd1bfb5c4b Fixed RTOS support for Cortex-M4 without FPU 2015-04-18 17:00:57 +02:00
Jeremy Brodt 5ada69b73d [MAX32600MBED] Adding MAX32600MBED platform. 2015-04-14 10:00:23 -05:00
Jun-Ru Chang f211a680b4 [RTOS] fix compilation warning
pragma push/pop/Ospace are only supported by ARM compiler. Change
predefined marco from __arm__ to __CC_ARM. Warning messages are
shown as below.

[Warning] rt_CMSIS.c@1867: 1866:0: warning: ignoring #pragma push
[-Wunknown-pragmas] ignoring #pragma Ospace  [-Wunknown-pragmas]
[Warning] rt_CMSIS.c@1884: 1866:0: warning: ignoring #pragma push
[-Wunknown-pragmas] ignoring #pragma pop  [-Wunknown-pragmas]

Change-Id: Ife657b710d694449b30dc4b3150cd49c883fc080
Signed-off-by: Jun-Ru Chang <jrjang@gmail.com>
2015-04-10 10:56:55 +08:00
dbestm 1684127708 Merge branch 'master' of https://github.com/mbedmicro/mbed 2015-04-08 11:39:06 +02:00
Martin Kojtal 071f4d0e44 Merge pull request #1003 from jeremybrodt/maxwsnenv
Adding MAXWSNENV platform.
2015-04-08 08:31:46 +02:00
Toyomasa Watarai 41d37b5f2d [RTOS] Add workaround for internal fault
* Add #pragma Ospace to prevent internal fault of armcc 5.04 and 5.05
* Reported by
http://developer.mbed.org/questions/5003/Compiling-latest-github-with-ARM-DS5-fai/
2015-04-08 14:42:17 +09:00
Jeremy Brodt 3f7718cec4 Adding MAXWSNENV platform. 2015-04-07 13:39:09 -05:00
dbestm 48f9602e8a [NUCLEO_F302R8] Fix wrong clock define used by RTX 2015-04-01 15:04:14 +02:00
Masao Hamanaka 095a943958 Increase main thread stack size.
When the user makes a program , it is often continue to add the process to the main thread .
For this reason, increase main thread stack size.
2015-03-23 19:56:55 +09:00
dominus97 4e86cf6273 Removed the comment 2015-03-09 18:41:12 +01:00
dominus97 e636215665 Added support for Nucleo F303RE
The OS_TASKCNT is set to 6, could be more.
The OS_SCHEDULERSTKSIZE is set to 112, could also be more.
The OS_CLOCK is set to 72000000 which matches the description on https://developer.mbed.org/platforms/ST-Nucleo-F303RE/

Cheers
2015-03-07 22:33:48 +01:00
dominus97 5e1716f63f Added support for Nucleo F303RE
I am not sure if it's the right SP, but the basic blink code works.
What does the SP stand for? Stack pointer?

Also, if you could tell me where to look for the correct address, I would.
I looked in the reference manual and the programming manual that STM provides, with no luck.

Cheers
2015-03-07 22:13:37 +01:00
Viller Hsiao bb0246f04a Remove trailing whitespace in RTX 2015-03-06 16:16:58 +08:00
Masao Hamanaka c46f5b894b Modify to support GCC. (CMSIS-RTOS RTX for Cortex-A9) 2015-02-26 16:31:58 +09:00
Masao Hamanaka 02cba63476 Increase private thread num. 2015-02-20 17:36:11 +09:00
0xc0170 ccfbdf497b Fix issue #902 - disable RTOS for NRF51822.
To enable, systick needs to be replaced by RTC for this target,
as systick is not implemented.
2015-02-12 09:11:22 +00:00
Anders Lindvall dcc53f4bda Fixed target issues for TARGET_LPC4088_DM
- Removed target alias from the EXPORT_MAP in targets.py as it didn't work
- Added copies of the LPC4088 target exporters
- Fixed flag issue in the gcc toolchain
- Changed defines in eth USBDevice, rpt and rtos to handle
  TARGET_LPC4088_DM
2015-02-08 11:56:39 +01:00
nitin.bhaskar.27.09@gmail.com 81a364c6e9 Extended RTOS support for LPC4330 Target 2015-01-28 20:57:37 +05:30
Adam Green 35d1ffd787 Correct warning when assigning HEAP_START to stack_pointer
This fixes issue #856 reported by @neilt6.

I tested on mbedLPC1768 and mbedLPC11U24 using the GCC_ARM toolchain.
2015-01-21 18:52:24 -08:00
Masao Hamanaka 596d0e9b78 Commit upstream changes.
Commit upstream changes that is "Merge pull request #833"
2015-01-09 13:54:55 +09:00
Masao Hamanaka d469fdf79e Increase STACK size of thread. 2015-01-07 19:09:50 +09:00
ohagendorf 11c2a5b888 error correction rebas and build_travis extension
travis_build ok
all tests for nucleo_f0xx and nucleo_f3xx ok
2015-01-05 23:59:58 +01:00
ohagendorf f5c3b18d75 [NUCLEO_F091RC] adding exporter (gcc_arm, coide), enable rtos
- Adding exporter for CoIDE and GCC_ARM
- Adding target to RTOS lib
2015-01-05 22:55:18 +01:00
ohagendorf 5ebdb92e78 [NUCLEO_F072RB] adding target to rtos lib
Every test (DTCT_1, EXAMPLE_1, MBED_xx, RTOS_x) is OK.
2015-01-05 22:43:52 +01:00
Martin Kojtal 914dd37b11 Merge pull request #818 from ohagendorf/stm32l053_rtos
DISCO/NUCLEO_L053xx - adding to RTOS, corrections for all tests, [DISCO_L053] exporter to µVision
2015-01-05 08:08:00 +01:00
Martin Kojtal 47ac39b3fd Merge pull request #812 from perkristian/master
RTOS: Fix stack alignment
2015-01-05 08:01:09 +01:00
Martin Kojtal fdc60ac217 Merge pull request #827 from adamgreen/rtxNoStackCheckForMainThread
RTOS: Main thread should not write MAGIC_WORD to stack
2015-01-05 07:50:23 +01:00
Adam Green 461403989c RTX: Main thread should not write MAGIC_WORD to stack
This is a fix for issue #285.  This fix is similar to that proposed by
@oresths in the original issue.

There is code in rt_init_stack() which compares the task_id against the
value of 1 before writing MAGIC_WORD to the bottom of the stack.  This
is supposed to stop the write from occurring for the main thread but
svcThreadCreate() doesn't initialize the P_TCB's task_id field until
after rt_init_stack() is executed.  If any dynamic memory allocation
has occurred before the main thread is started (from the standard C
startup code) then this write could overwrite data in that allocation.

This change:
* moves the task_id initialization in svcThreadCreate() to happen
  before the call to rt_init_context() is made.
* cleans up some comments in svcThreadCreate() which appear to
  reference older versions of the code which would automatically
  allocate stack memory if size == 0.
* still keeps the call to rt_dispatch() occurring after the call to
  rt_init_context() so that the task is not dispatched to the
  scheduler until the task fields have been populated.

I stepped through the rt_init_stack() code on my mbedLPC1768 after this
change was made to make sure that the write of MAGIC_WORD is now
skipped.
-----------------------------------------------------------------------
(gdb) break HAL_CM.c:95
Breakpoint 1 at 0x482c: file ../../external/mbed/libraries/rtos/rtx/TARGET_CORTEX_M/HAL_CM.c, line 95.
(gdb) c
Continuing.
Note: automatically using hardware breakpoints for read-only addresses.

Breakpoint 1, rt_init_stack (p_TCB=0x10000774 <os_idle_TCB>, task_body=0x4899 <os_idle_demon>)
    at ../../external/mbed/libraries/rtos/rtx/TARGET_CORTEX_M/HAL_CM.c:95
95	  if (p_TCB->task_id != 0x01)
(gdb) p *p_TCB
$1 = {
  cb_type = 0 '\000',
  state = 1 '\001',
  prio = 0 '\000',
  task_id = 255 '\377',
  p_lnk = 0x0 <_reclaim_reent>,
  p_rlnk = 0x0 <_reclaim_reent>,
  p_dlnk = 0x0 <_reclaim_reent>,
  p_blnk = 0x0 <_reclaim_reent>,
  delta_time = 0,
  interval_time = 0,
  events = 0,
  waits = 0,
  msg = 0x0 <_reclaim_reent>,
  stack_frame = 0 '\000',
  reserved = 0 '\000',
  priv_stack = 128,
  tsk_stack = 268437480,
  stack = 0x100007a8 <idle_task_stack>,
  ptask = 0x4899 <os_idle_demon>
}
(gdb) c
Continuing.

Breakpoint 1, rt_init_stack (p_TCB=0x10000120 <os_thread_def_main+16>, task_body=0x620d <__wrap_main()>)
    at ../../external/mbed/libraries/rtos/rtx/TARGET_CORTEX_M/HAL_CM.c:95
95	  if (p_TCB->task_id != 0x01)
(gdb) p *p_TCB
$2 = {
  cb_type = 0 '\000',
  state = 1 '\001',
  prio = 4 '\004',
  task_id = 1 '\001',
  p_lnk = 0x0 <_reclaim_reent>,
  p_rlnk = 0x0 <_reclaim_reent>,
  p_dlnk = 0x0 <_reclaim_reent>,
  p_blnk = 0x0 <_reclaim_reent>,
  delta_time = 0,
  interval_time = 0,
  events = 0,
  waits = 0,
  msg = 0x0 <_reclaim_reent>,
  stack_frame = 0 '\000',
  reserved = 0 '\000',
  priv_stack = 26968,
  tsk_stack = 268467136,
  stack = 0x100012a8,
  ptask = 0x620d <__wrap_main()>
}
(gdb) n
97	}

When the p_TCB for ptask==__wrap_main() is encountered, the task_id
now has a value of 1 and the write of MAGIC_WORD on line 96 is
skipped.
2015-01-02 17:24:48 -08:00
Adam Green d587474778 RTX: Support stacks larger than 64k
This issue was originally reported on the mbed site:
 http://developer.mbed.org/questions/5570/mbed-rtos-memory-utilization/

The cause of the 64k limitation is that even though the user can set a
stack size larger than 64k in the osThreadDef_t::stacksize 32-bit
field, this size is truncated to 16-bit when it is copied to
the priv_stack field in the OS_TCB structure.

This commit corrects that problem by making the OS_TCB::priv_stack
field 32-bit.  Due to word alignment, this introduces another 2 bytes
of padding in the structure which I have made explicit with the
addition of the reserved2 field.

The tsk_stack field which follows priv_stack is referenced directly by
assembly language code responsible for context switching.  This context
switching code used a fixed byte offset, TCB_TSTACK, to access this
tsk_stack field.  I had to update the TCB_TSTACK definition in various
locations from 36 to 40 to account for the extra alignment padding and
increased size of the priv_stack field.

TESTING
* GCC_ARM - mbedLPC1768 and mbedLPC11U24
* Online mbed Compiler - mbedLPC1768 and mbedLPC11U24

NOTES: I had to change assembly language code that was specific to IAR
       but I don't have that toolchain so those changes aren't tested.
       They do however follow the same pattern as the tested GCC
       modifications.
2015-01-02 13:14:40 -08:00
ohagendorf b9bef6b06e [DISCO/NUCLEO_L053xx] adding to RTOS - part3
Reverting the DEFAULT_STACK_SIZE changes in cmsis.oh.h and adding
changes to RTOS_x tests, to create threads with the neccessary reduced
stack sizes for these targets.
2015-01-02 14:52:39 +01:00
ohagendorf 6fa0730f47 [DISCO/NUCLEO_L053xx] adding to RTOS - part2
Stack sizes has to be reduced because of the limited 8K RAM.
2015-01-02 12:17:34 +01:00
ohagendorf 0ac123d488 [DISCO/NUCLEO_L053xx] adding to RTOS 2015-01-02 12:13:44 +01:00
Per Kristian Gjermshus c59b34f22a Fix stack aligment.
Stack should be 8 byte aligned on ARM.
Fix the automatic correction of the alignment in rt_init_stack,
and make sure that all stacks are aligned by the compiler.
2015-01-02 10:20:36 +01:00
Martin Kojtal 77d645476d Merge pull request #810 from ohagendorf/STM32F3xx_rtos
DISCO/NUCLEO_F3xx - solving RTOS problem
2015-01-02 07:48:54 +01:00
ohagendorf 62a1b8d103 [DISCO/NUCLEO_F334] solving RTOS Problem
Decreasing OS_SCHEDULERSTKSIZE to 112 bytes solves the problem of the
failed test RTOS_3 (Semaphore resource lock).
The test itself was successfull but the final printf failed.
With the reduced stacksize now every test is OK.
2014-12-29 01:34:57 +01:00
ohagendorf 5df957e0d8 [NUCLEO_F302R8]
There exists an inconsistency between official STM schematic of Nucleo
boards and the existing hardware. Each board should have an 8MHz
external clock source. That is not the case. At some boards the solder
jumper is existing and with that the external clock source. At some
other boards the solder jumper is not available. The Nucleo_F302 should
run with 72MHz but that is only possible with an external clock source.
Because of a missing solder jumper it runs only with the internal clock
source, and that's why only with 64MHz.
2014-12-28 22:54:46 +01:00
Masao Hamanaka 0279c2a2ee Modify some settings of OS and Ether
- Change default setting of CMSIS-RTOS RTX for Cortex-A9 to align with Cortex-M.
 - Change the interrupt priority of Ether driver to align with other drivers.
2014-12-18 18:41:33 +09:00
Martin Kojtal a67faf521f Merge pull request #797 from ohagendorf/DISCO_F429_clockcycle
Targets: DISCO_F429ZI - clock frequency additions
2014-12-16 08:01:54 +00:00
Martin Kojtal 1fb5426bf6 Merge pull request #793 from ohagendorf/STMF4xxx_rtos
DISCO_F4xx, NUCLEO_F4xx, MDOT_F4 - fix RTOS problem (init seq)
2014-12-15 09:01:35 +00:00
ohagendorf 2002b797ad [DISCO_F429ZI] changed clock settings
Original STM32Cube F4 driver sets SYSCLK for STM32F429 to 16MHz. This
adds a 168MHz and 180MHz configuration to system_stm32f4xx.c generated
by STM32CubeMX code generator. The rtos clock configuration is changed
too. In singletest.py run everything is OK.
2014-12-15 07:32:53 +01:00
ohagendorf 6f8f626bd6 [DISCO_F4xx][NUCLEO_F4xx][MDOT_F4] solving RTOS problem
- Changing original STM Cube Driver to call _start instead of main to
initialise the rtos when using it. Without using rtos the behavior is
the same as before.
- Adding DISCO_F429 to rtos
- Adding targets to RTOS_xx tests.
- All tests are OK. Tested with Nucleo and Disco boards. Not tested with
MDOT_F4 but that uses the same hal like nucleo_f411.
2014-12-13 22:50:02 +01:00
GustavWi 3062999e97 Separated the c data initialization and c++ to call mbed_sdk_init before c++ data. So that the c variables are updated before the c++ objects are initialized. Had to rename the cmain override in RTX_CM_lib.h to __iar_program_start because there can not be two __cmain overrides in the project. The ewps had to be updated to add the linker command --skip_dynamic_initialization which stalls the c++ data init until __iar_dynamic_initialization which is called right after mbed_sdk_init. 2014-12-10 13:40:17 +01:00
GustavWi 6210f92420 IAR RTOS support M0, M0+ and M4 2014-12-03 12:54:06 +01:00
Masao Hamanaka 495ba6d817 Fixed CMSIS-RTOS RTX build error.
Some files of CMSIS-RTOS RTX for CA9 has an effect on build error.
Confirmed those are unwanted files. Deleted.
2014-11-27 17:12:08 +09:00
Martin Kojtal c3208fe6f4 Merge pull request #736 from GustavWi/iar_mbed
RTOS:  IAR Export for CORTEX M3
2014-11-26 08:57:24 +01:00
GustavWi 092828ce33 Added IAR Export RTOS CORTEX M3 2014-11-24 10:58:08 +01:00