Skip to content

Commit aa663ea

Browse files
committed
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 <[email protected]>
1 parent c1c1492 commit aa663ea

File tree

16 files changed

+1499
-403
lines changed

16 files changed

+1499
-403
lines changed

hal/targets.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,7 +1146,7 @@
11461146
"supported_toolchains": ["ARM", "uARM", "GCC_ARM", "IAR"],
11471147
"extra_labels": ["STM", "STM32F4", "STM32F405RG"],
11481148
"is_disk_virtual": true,
1149-
"macros": ["HSE_VALUE=26000000", "OS_CLOCK=48000000", "TRANSACTION_QUEUE_SIZE_SPI=2"],
1149+
"macros": ["HSE_VALUE=26000000", "TRANSACTION_QUEUE_SIZE_SPI=2"],
11501150
"progen": {"target": "mts-mdot-f405rg"},
11511151
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "STDIO_MESSAGES"],
11521152
"release_versions": ["2"]
@@ -1156,7 +1156,7 @@
11561156
"core": "Cortex-M4F",
11571157
"supported_toolchains": ["ARM", "uARM", "GCC_ARM", "IAR"],
11581158
"extra_labels": ["STM", "STM32F4", "STM32F411RE"],
1159-
"macros": ["HSE_VALUE=26000000", "OS_CLOCK=96000000", "USE_PLL_HSE_EXTC=0", "VECT_TAB_OFFSET=0x00010000","TRANSACTION_QUEUE_SIZE_SPI=2"],
1159+
"macros": ["HSE_VALUE=26000000", "USE_PLL_HSE_EXTC=0", "VECT_TAB_OFFSET=0x00010000","TRANSACTION_QUEUE_SIZE_SPI=2"],
11601160
"post_binary_hook": {
11611161
"function": "MTSCode.combine_bins_mts_dot",
11621162
"toolchains": ["GCC_ARM", "ARM_STD", "ARM_MICRO"]
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2016 ARM Limited
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#ifndef MBED_MBED_RTX_H
18+
#define MBED_MBED_RTX_H
19+
20+
#if defined(TARGET_BEETLE)
21+
22+
#ifndef INITIAL_SP
23+
#define INITIAL_SP (0x20020000UL)
24+
#endif
25+
#ifndef OS_TASKCNT
26+
#define OS_TASKCNT 6
27+
#endif
28+
#ifndef OS_MAINSTKSIZE
29+
#define OS_MAINSTKSIZE 112
30+
#endif
31+
#ifndef OS_CLOCK
32+
#define OS_CLOCK 24000000
33+
#endif
34+
35+
#endif
36+
37+
#endif // MBED_MBED_RTX_H
Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2016 ARM Limited
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#ifndef MBED_MBED_RTX_H
18+
#define MBED_MBED_RTX_H
19+
20+
#if defined(TARGET_K20D50M)
21+
22+
#ifndef INITIAL_SP
23+
#define INITIAL_SP (0x10008000UL)
24+
#endif
25+
#ifndef OS_TASKCNT
26+
#define OS_TASKCNT 14
27+
#endif
28+
#ifndef OS_MAINSTKSIZE
29+
#define OS_MAINSTKSIZE 256
30+
#endif
31+
#ifndef OS_CLOCK
32+
#define OS_CLOCK 96000000
33+
#endif
34+
35+
#elif defined(TARGET_TEENSY3_1)
36+
37+
#ifndef INITIAL_SP
38+
#define INITIAL_SP (0x20008000UL)
39+
#endif
40+
#ifndef OS_TASKCNT
41+
#define OS_TASKCNT 14
42+
#endif
43+
#ifndef OS_MAINSTKSIZE
44+
#define OS_MAINSTKSIZE 256
45+
#endif
46+
#ifndef OS_CLOCK
47+
#define OS_CLOCK 96000000
48+
#endif
49+
50+
#elif defined(TARGET_K22F)
51+
52+
#ifndef INITIAL_SP
53+
#define INITIAL_SP (0x20010000UL)
54+
#endif
55+
#ifndef OS_TASKCNT
56+
#define OS_TASKCNT 14
57+
#endif
58+
#ifndef OS_MAINSTKSIZE
59+
#define OS_MAINSTKSIZE 256
60+
#endif
61+
#ifndef OS_CLOCK
62+
#define OS_CLOCK 80000000
63+
#endif
64+
65+
#elif defined(TARGET_K66F)
66+
67+
#ifndef INITIAL_SP
68+
#define INITIAL_SP (0x20030000UL)
69+
#endif
70+
#ifndef OS_TASKCNT
71+
#define OS_TASKCNT 14
72+
#endif
73+
#ifndef OS_MAINSTKSIZE
74+
#define OS_MAINSTKSIZE 256
75+
#endif
76+
#ifndef OS_CLOCK
77+
#define OS_CLOCK 120000000
78+
#endif
79+
80+
#elif defined(TARGET_KL27Z)
81+
82+
#ifndef INITIAL_SP
83+
#define INITIAL_SP (0x20003000UL)
84+
#endif
85+
#ifndef OS_TASKCNT
86+
#define OS_TASKCNT 6
87+
#endif
88+
#ifndef OS_MAINSTKSIZE
89+
#define OS_MAINSTKSIZE 128
90+
#endif
91+
#ifndef OS_CLOCK
92+
#define OS_CLOCK 48000000
93+
#endif
94+
95+
#elif defined(TARGET_KL43Z)
96+
97+
#ifndef INITIAL_SP
98+
#define INITIAL_SP (0x20006000UL)
99+
#endif
100+
#ifndef OS_TASKCNT
101+
#define OS_TASKCNT 14
102+
#endif
103+
#ifndef OS_MAINSTKSIZE
104+
#define OS_MAINSTKSIZE 256
105+
#endif
106+
#ifndef OS_CLOCK
107+
#define OS_CLOCK 48000000
108+
#endif
109+
110+
#elif defined(TARGET_KL05Z)
111+
112+
#ifndef INITIAL_SP
113+
#define INITIAL_SP (0x20000C00UL)
114+
#endif
115+
#ifndef OS_TASKCNT
116+
#define OS_TASKCNT 6
117+
#endif
118+
#ifndef OS_MAINSTKSIZE
119+
#define OS_MAINSTKSIZE 128
120+
#endif
121+
#ifndef OS_CLOCK
122+
#define OS_CLOCK 48000000
123+
#endif
124+
125+
#elif defined(TARGET_KL25Z)
126+
127+
#ifndef INITIAL_SP
128+
#define INITIAL_SP (0x20003000UL)
129+
#endif
130+
#ifndef OS_TASKCNT
131+
#define OS_TASKCNT 6
132+
#endif
133+
#ifndef OS_MAINSTKSIZE
134+
#define OS_MAINSTKSIZE 128
135+
#endif
136+
#ifndef OS_CLOCK
137+
#define OS_CLOCK 48000000
138+
#endif
139+
140+
#elif defined(TARGET_KL26Z)
141+
142+
#ifndef INITIAL_SP
143+
#define INITIAL_SP (0x20003000UL)
144+
#endif
145+
#ifndef OS_TASKCNT
146+
#define OS_TASKCNT 6
147+
#endif
148+
#ifndef OS_MAINSTKSIZE
149+
#define OS_MAINSTKSIZE 128
150+
#endif
151+
#ifndef OS_CLOCK
152+
#define OS_CLOCK 48000000
153+
#endif
154+
155+
#elif defined(TARGET_KL46Z)
156+
157+
#ifndef INITIAL_SP
158+
#define INITIAL_SP (0x20006000UL)
159+
#endif
160+
#ifndef OS_TASKCNT
161+
#define OS_TASKCNT 14
162+
#endif
163+
#ifndef OS_MAINSTKSIZE
164+
#define OS_MAINSTKSIZE 256
165+
#endif
166+
#ifndef OS_CLOCK
167+
#define OS_CLOCK 48000000
168+
#endif
169+
170+
#elif defined(TARGET_K64F)
171+
172+
#ifndef INITIAL_SP
173+
#define INITIAL_SP (0x20030000UL)
174+
#endif
175+
176+
#if defined(__CC_ARM) || defined(__GNUC__)
177+
#define ISR_STACK_SIZE (0x1000)
178+
#endif
179+
180+
#ifndef OS_TASKCNT
181+
#define OS_TASKCNT 14
182+
#endif
183+
#ifndef OS_MAINSTKSIZE
184+
#define OS_MAINSTKSIZE 256
185+
#endif
186+
#ifndef OS_CLOCK
187+
#define OS_CLOCK 120000000
188+
#endif
189+
190+
#endif
191+
192+
#endif // MBED_MBED_RTX_H
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2016 ARM Limited
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#ifndef MBED_MBED_RTX_H
18+
#define MBED_MBED_RTX_H
19+
20+
#if defined(TARGET_MAX32600)
21+
22+
#ifndef INITIAL_SP
23+
#define INITIAL_SP (0x20008000UL)
24+
#endif
25+
#ifndef OS_TASKCNT
26+
#define OS_TASKCNT 14
27+
#endif
28+
#ifndef OS_MAINSTKSIZE
29+
#define OS_MAINSTKSIZE 256
30+
#endif
31+
#ifndef OS_CLOCK
32+
#define OS_CLOCK 24000000
33+
#endif
34+
35+
#elif defined(TARGET_MAX32610)
36+
37+
#ifndef INITIAL_SP
38+
#define INITIAL_SP (0x20008000UL)
39+
#endif
40+
#ifndef OS_TASKCNT
41+
#define OS_TASKCNT 14
42+
#endif
43+
#ifndef OS_MAINSTKSIZE
44+
#define OS_MAINSTKSIZE 256
45+
#endif
46+
#ifndef OS_CLOCK
47+
#define OS_CLOCK 24000000
48+
#endif
49+
50+
#elif defined(TARGET_MAX32620)
51+
52+
#ifndef INITIAL_SP
53+
#define INITIAL_SP (0x20008000UL)
54+
#endif
55+
#ifndef OS_TASKCNT
56+
#define OS_TASKCNT 14
57+
#endif
58+
#ifndef OS_MAINSTKSIZE
59+
#define OS_MAINSTKSIZE 256
60+
#endif
61+
#ifndef OS_CLOCK
62+
#define OS_CLOCK 96000000
63+
#endif
64+
65+
#endif
66+
67+
#endif // MBED_MBED_RTX_H
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2016 ARM Limited
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#ifndef MBED_MBED_RTX_H
18+
#define MBED_MBED_RTX_H
19+
20+
#if defined(TARGET_MCU_NRF51822)
21+
22+
#ifndef INITIAL_SP
23+
# if defined(TARGET_MCU_NORDIC_32K)
24+
# define INITIAL_SP (0x20008000UL)
25+
# elif defined(TARGET_MCU_NORDIC_16K)
26+
# define INITIAL_SP (0x20004000UL)
27+
# endif
28+
#endif
29+
30+
#ifndef OS_TASKCNT
31+
#define OS_TASKCNT 6
32+
#endif
33+
#ifndef OS_MAINSTKSIZE
34+
#define OS_MAINSTKSIZE 512
35+
#endif
36+
#ifndef OS_CLOCK
37+
#define OS_CLOCK 32768
38+
#endif
39+
#ifndef OS_SYSTICK
40+
#define OS_SYSTICK 0
41+
#endif
42+
43+
#elif defined(TARGET_MCU_NRF52832)
44+
45+
#ifndef INITIAL_SP
46+
#define INITIAL_SP (0x20010000UL)
47+
#endif
48+
#ifndef OS_TASKCNT
49+
#define OS_TASKCNT 6
50+
#endif
51+
#ifndef OS_MAINSTKSIZE
52+
#define OS_MAINSTKSIZE 512
53+
#endif
54+
#ifndef OS_CLOCK
55+
#define OS_CLOCK 64000000
56+
#endif
57+
58+
#endif
59+
60+
#endif

0 commit comments

Comments
 (0)