Skip to content

Commit 07aad3c

Browse files
committed
CMSIS/RTX: Adapt Mbed OS to CMSIS/RTX device support scheme
1 parent 287121f commit 07aad3c

File tree

5 files changed

+52
-26
lines changed

5 files changed

+52
-26
lines changed

cmsis/RTE_Components.h

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,7 @@
1818

1919
#define CMSIS_device_header <cmsis.h>
2020

21-
#ifndef MBED_CONF_TZ_PROCESS_STACK_SIZE
22-
#define MBED_CONF_TZ_PROCESS_STACK_SIZE 512
23-
#endif
24-
#ifndef MBED_CONF_TZ_PROCESS_STACK_SLOTS
25-
#define MBED_CONF_TZ_PROCESS_STACK_SLOTS 8
26-
#endif
27-
28-
#define TZ_PROCESS_STACK_SLOTS MBED_CONF_TZ_PROCESS_STACK_SLOTS
29-
#define TZ_PROCESS_STACK_SIZE MBED_CONF_TZ_PROCESS_STACK_SIZE
21+
#include "mbed_rtx_conf.h"
22+
#include "mbed_cmsis_conf.h"
3023

3124
#endif
32-
33-

cmsis/mbed_cmsis_conf.h

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2006-2012 ARM Limited
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
* SOFTWARE.
21+
*/
22+
#ifndef MBED_CMSIS_CONF_H
23+
#define MBED_CMSIS_CONF_H
24+
25+
#ifndef MBED_CONF_TZ_PROCESS_STACK_SIZE
26+
#define MBED_CONF_TZ_PROCESS_STACK_SIZE 512
27+
#endif
28+
#ifndef MBED_CONF_TZ_PROCESS_STACK_SLOTS
29+
#define MBED_CONF_TZ_PROCESS_STACK_SLOTS 8
30+
#endif
31+
32+
#define TZ_PROCESS_STACK_SLOTS MBED_CONF_TZ_PROCESS_STACK_SLOTS
33+
#define TZ_PROCESS_STACK_SIZE MBED_CONF_TZ_PROCESS_STACK_SIZE
34+
35+
#endif /* MBED_CMSIS_CONF_H */

tools/profiles/debug.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"-ffunction-sections", "-fdata-sections", "-funsigned-char",
77
"-MMD", "-fno-delete-null-pointer-checks",
88
"-fomit-frame-pointer", "-O0", "-g3", "-DMBED_DEBUG",
9-
"-DMBED_TRAP_ERRORS_ENABLED=1"],
9+
"-DMBED_TRAP_ERRORS_ENABLED=1", "-D_RTE_"],
1010
"asm": ["-x", "assembler-with-cpp"],
1111
"c": ["-std=gnu99"],
1212
"cxx": ["-std=gnu++98", "-fno-rtti", "-Wvla"],
@@ -19,7 +19,7 @@
1919
"common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-g", "-O0",
2020
"-Wno-armcc-pragma-push-pop", "-Wno-armcc-pragma-anon-unions",
2121
"-DMULADDC_CANNOT_USE_R7", "-fdata-sections",
22-
"-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)="],
22+
"-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)=", "-D_RTE_"],
2323
"asm": [],
2424
"c": ["-D__ASSERT_MSG", "-std=gnu99"],
2525
"cxx": ["-fno-rtti", "-std=gnu++98"],
@@ -30,7 +30,7 @@
3030
"common": ["-c", "--gnu", "-Otime", "--split_sections",
3131
"--apcs=interwork", "--brief_diagnostics", "--restrict",
3232
"--multibyte_chars", "-O0", "-g", "-DMBED_DEBUG",
33-
"-DMBED_TRAP_ERRORS_ENABLED=1"],
33+
"-DMBED_TRAP_ERRORS_ENABLED=1", "-D_RTE_"],
3434
"asm": [],
3535
"c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"],
3636
"cxx": ["--cpp", "--no_rtti", "--no_vla"],
@@ -41,7 +41,7 @@
4141
"--apcs=interwork", "--brief_diagnostics", "--restrict",
4242
"--multibyte_chars", "-O0", "-D__MICROLIB", "-g",
4343
"--library_type=microlib", "-DMBED_RTOS_SINGLE_THREAD", "-DMBED_DEBUG",
44-
"-DMBED_TRAP_ERRORS_ENABLED=1"],
44+
"-DMBED_TRAP_ERRORS_ENABLED=1", "-D_RTE_"],
4545
"asm": [],
4646
"c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"],
4747
"cxx": ["--cpp", "--no_rtti", "--no_vla"],
@@ -51,7 +51,7 @@
5151
"common": [
5252
"--no_wrap_diagnostics", "-e",
5353
"--diag_suppress=Pa050,Pa084,Pa093,Pa082", "-On", "-r", "-DMBED_DEBUG",
54-
"-DMBED_TRAP_ERRORS_ENABLED=1", "--enable_restrict"],
54+
"-DMBED_TRAP_ERRORS_ENABLED=1", "--enable_restrict", "-D_RTE_"],
5555
"asm": [],
5656
"c": ["--vla"],
5757
"cxx": ["--guard_calls", "--no_static_destruction"],

tools/profiles/develop.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"-fmessage-length=0", "-fno-exceptions", "-fno-builtin",
66
"-ffunction-sections", "-fdata-sections", "-funsigned-char",
77
"-MMD", "-fno-delete-null-pointer-checks",
8-
"-fomit-frame-pointer", "-Os", "-g1"],
8+
"-fomit-frame-pointer", "-Os", "-g1", "-D_RTE_"],
99
"asm": ["-x", "assembler-with-cpp"],
1010
"c": ["-std=gnu99"],
1111
"cxx": ["-std=gnu++98", "-fno-rtti", "-Wvla"],
@@ -18,7 +18,7 @@
1818
"common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-Os",
1919
"-Wno-armcc-pragma-push-pop", "-Wno-armcc-pragma-anon-unions",
2020
"-DMULADDC_CANNOT_USE_R7", "-fdata-sections",
21-
"-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)="],
21+
"-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)=", "-D_RTE_"],
2222
"asm": [],
2323
"c": ["-D__ASSERT_MSG", "-std=gnu99"],
2424
"cxx": ["-fno-rtti", "-std=gnu++98"],
@@ -27,7 +27,7 @@
2727
"ARM": {
2828
"common": ["-c", "--gnu", "-Otime", "--split_sections",
2929
"--apcs=interwork", "--brief_diagnostics", "--restrict",
30-
"--multibyte_chars", "-O3"],
30+
"--multibyte_chars", "-O3", "-D_RTE_"],
3131
"asm": [],
3232
"c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"],
3333
"cxx": ["--cpp", "--no_rtti", "--no_vla"],
@@ -37,7 +37,7 @@
3737
"common": ["-c", "--gnu", "-Otime", "--split_sections",
3838
"--apcs=interwork", "--brief_diagnostics", "--restrict",
3939
"--multibyte_chars", "-O3", "-D__MICROLIB",
40-
"--library_type=microlib", "-DMBED_RTOS_SINGLE_THREAD"],
40+
"--library_type=microlib", "-DMBED_RTOS_SINGLE_THREAD", "-D_RTE_"],
4141
"asm": [],
4242
"c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"],
4343
"cxx": ["--cpp", "--no_rtti", "--no_vla"],
@@ -46,7 +46,7 @@
4646
"IAR": {
4747
"common": [
4848
"--no_wrap_diagnostics", "-e",
49-
"--diag_suppress=Pa050,Pa084,Pa093,Pa082", "-Oh", "--enable_restrict"],
49+
"--diag_suppress=Pa050,Pa084,Pa093,Pa082", "-Oh", "--enable_restrict", "-D_RTE_"],
5050
"asm": [],
5151
"c": ["--vla"],
5252
"cxx": ["--guard_calls", "--no_static_destruction"],

tools/profiles/release.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"-fmessage-length=0", "-fno-exceptions", "-fno-builtin",
66
"-ffunction-sections", "-fdata-sections", "-funsigned-char",
77
"-MMD", "-fno-delete-null-pointer-checks",
8-
"-fomit-frame-pointer", "-Os", "-DNDEBUG", "-g1"],
8+
"-fomit-frame-pointer", "-Os", "-DNDEBUG", "-g1", "-D_RTE_"],
99
"asm": ["-x", "assembler-with-cpp"],
1010
"c": ["-std=gnu99"],
1111
"cxx": ["-std=gnu++98", "-fno-rtti", "-Wvla"],
@@ -18,7 +18,7 @@
1818
"common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-Oz",
1919
"-Wno-armcc-pragma-push-pop", "-Wno-armcc-pragma-anon-unions",
2020
"-DMULADDC_CANNOT_USE_R7", "-fdata-sections",
21-
"-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)="],
21+
"-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)=", "-D_RTE_"],
2222
"asm": [],
2323
"c": ["-D__ASSERT_MSG", "-std=gnu99"],
2424
"cxx": ["-fno-rtti", "-std=gnu++98"],
@@ -27,7 +27,7 @@
2727
"ARM": {
2828
"common": ["-c", "--gnu", "-Ospace", "--split_sections",
2929
"--apcs=interwork", "--brief_diagnostics", "--restrict",
30-
"--multibyte_chars", "-O3", "-DNDEBUG"],
30+
"--multibyte_chars", "-O3", "-DNDEBUG", "-D_RTE_"],
3131
"asm": [],
3232
"c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"],
3333
"cxx": ["--cpp", "--no_rtti", "--no_vla"],
@@ -37,7 +37,7 @@
3737
"common": ["-c", "--gnu", "-Ospace", "--split_sections",
3838
"--apcs=interwork", "--brief_diagnostics", "--restrict",
3939
"--multibyte_chars", "-O3", "-D__MICROLIB",
40-
"--library_type=microlib", "-DMBED_RTOS_SINGLE_THREAD", "-DNDEBUG"],
40+
"--library_type=microlib", "-DMBED_RTOS_SINGLE_THREAD", "-DNDEBUG", "-D_RTE_"],
4141
"asm": [],
4242
"c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"],
4343
"cxx": ["--cpp", "--no_rtti", "--no_vla"],
@@ -46,7 +46,7 @@
4646
"IAR": {
4747
"common": [
4848
"--no_wrap_diagnostics", "-e",
49-
"--diag_suppress=Pa050,Pa084,Pa093,Pa082", "-Ohz", "-DNDEBUG", "--enable_restrict"],
49+
"--diag_suppress=Pa050,Pa084,Pa093,Pa082", "-Ohz", "-DNDEBUG", "--enable_restrict", "-D_RTE_"],
5050
"asm": [],
5151
"c": ["--vla"],
5252
"cxx": ["--guard_calls", "--no_static_destruction"],

0 commit comments

Comments
 (0)