RTX_Config.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. /*
  2. * Copyright (c) 2013-2018 ARM Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the License); you may
  7. * not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  14. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. *
  18. * -----------------------------------------------------------------------------
  19. *
  20. * $Revision: V5.3.0
  21. *
  22. * Project: CMSIS-RTOS RTX
  23. * Title: RTX Configuration definitions
  24. *
  25. * -----------------------------------------------------------------------------
  26. */
  27. #ifndef RTX_CONFIG_H_
  28. #define RTX_CONFIG_H_
  29. #ifdef _RTE_
  30. #include "RTE_Components.h"
  31. #ifdef RTE_RTX_CONFIG_H
  32. #include RTE_RTX_CONFIG_H
  33. #endif
  34. #endif
  35. //-------- <<< Use Configuration Wizard in Context Menu >>> --------------------
  36. // <h>System Configuration
  37. // =======================
  38. // <o>Global Dynamic Memory size [bytes] <0-1073741824:8>
  39. // <i> Defines the combined global dynamic memory size.
  40. // <i> Default: 4096
  41. #ifndef OS_DYNAMIC_MEM_SIZE
  42. #define OS_DYNAMIC_MEM_SIZE 4096
  43. #endif
  44. // <o>Kernel Tick Frequency [Hz] <1-1000000>
  45. // <i> Defines base time unit for delays and timeouts.
  46. // <i> Default: 1000 (1ms tick)
  47. #ifndef OS_TICK_FREQ
  48. #define OS_TICK_FREQ 1000
  49. #endif
  50. // <e>Round-Robin Thread switching
  51. // <i> Enables Round-Robin Thread switching.
  52. #ifndef OS_ROBIN_ENABLE
  53. #define OS_ROBIN_ENABLE 1
  54. #endif
  55. // <o>Round-Robin Timeout <1-1000>
  56. // <i> Defines how many ticks a thread will execute before a thread switch.
  57. // <i> Default: 5
  58. #ifndef OS_ROBIN_TIMEOUT
  59. #define OS_ROBIN_TIMEOUT 5
  60. #endif
  61. // </e>
  62. // <o>ISR FIFO Queue
  63. // <4=> 4 entries <8=> 8 entries <12=> 12 entries <16=> 16 entries
  64. // <24=> 24 entries <32=> 32 entries <48=> 48 entries <64=> 64 entries
  65. // <96=> 96 entries <128=> 128 entries <196=> 196 entries <256=> 256 entries
  66. // <i> RTOS Functions called from ISR store requests to this buffer.
  67. // <i> Default: 16 entries
  68. #ifndef OS_ISR_FIFO_QUEUE
  69. #define OS_ISR_FIFO_QUEUE 16
  70. #endif
  71. // <h>Event Recording
  72. // <i> Configures events recording.
  73. // <q>Memory Management
  74. // <i> Enables Memory Management events recording.
  75. #ifndef OS_EVR_MEMORY
  76. #define OS_EVR_MEMORY 1
  77. #endif
  78. // <q>Kernel
  79. // <i> Enables Kernel events recording.
  80. #ifndef OS_EVR_KERNEL
  81. #define OS_EVR_KERNEL 1
  82. #endif
  83. // <q>Thread
  84. // <i> Enables Thread events recording.
  85. #ifndef OS_EVR_THREAD
  86. #define OS_EVR_THREAD 1
  87. #endif
  88. // <q>Timer
  89. // <i> Enables Timer events recording.
  90. #ifndef OS_EVR_TIMER
  91. #define OS_EVR_TIMER 1
  92. #endif
  93. // <q>Event Flags
  94. // <i> Enables Event Flags events recording.
  95. #ifndef OS_EVR_EVFLAGS
  96. #define OS_EVR_EVFLAGS 1
  97. #endif
  98. // <q>Mutex
  99. // <i> Enables Mutex events recording.
  100. #ifndef OS_EVR_MUTEX
  101. #define OS_EVR_MUTEX 1
  102. #endif
  103. // <q>Semaphore
  104. // <i> Enables Semaphore events recording.
  105. #ifndef OS_EVR_SEMAPHORE
  106. #define OS_EVR_SEMAPHORE 1
  107. #endif
  108. // <q>Memory Pool
  109. // <i> Enables Memory Pool events recording.
  110. #ifndef OS_EVR_MEMPOOL
  111. #define OS_EVR_MEMPOOL 1
  112. #endif
  113. // <q>Message Queue
  114. // <i> Enables Message Queue events recording.
  115. #ifndef OS_EVR_MSGQUEUE
  116. #define OS_EVR_MSGQUEUE 1
  117. #endif
  118. // </h>
  119. // <q>Object Memory usage counters
  120. // <i> Enables object memory usage counters.
  121. #ifndef OS_OBJ_MEM_USAGE
  122. #define OS_OBJ_MEM_USAGE 0
  123. #endif
  124. // </h>
  125. // <h>Thread Configuration
  126. // =======================
  127. // <e>Object specific Memory allocation
  128. // <i> Enables object specific memory allocation.
  129. #ifndef OS_THREAD_OBJ_MEM
  130. #define OS_THREAD_OBJ_MEM 0
  131. #endif
  132. // <o>Number of user Threads <1-1000>
  133. // <i> Defines maximum number of user threads that can be active at the same time.
  134. // <i> Applies to user threads with system provided memory for control blocks.
  135. #ifndef OS_THREAD_NUM
  136. #define OS_THREAD_NUM 1
  137. #endif
  138. // <o>Number of user Threads with default Stack size <0-1000>
  139. // <i> Defines maximum number of user threads with default stack size.
  140. // <i> Applies to user threads with zero stack size specified.
  141. #ifndef OS_THREAD_DEF_STACK_NUM
  142. #define OS_THREAD_DEF_STACK_NUM 0
  143. #endif
  144. // <o>Total Stack size [bytes] for user Threads with user-provided Stack size <0-1073741824:8>
  145. // <i> Defines the combined stack size for user threads with user-provided stack size.
  146. // <i> Applies to user threads with user-provided stack size and system provided memory for stack.
  147. // <i> Default: 0
  148. #ifndef OS_THREAD_USER_STACK_SIZE
  149. #define OS_THREAD_USER_STACK_SIZE 0
  150. #endif
  151. // </e>
  152. // <o>Default Thread Stack size [bytes] <96-1073741824:8>
  153. // <i> Defines stack size for threads with zero stack size specified.
  154. // <i> Default: 200
  155. #ifndef OS_STACK_SIZE
  156. #define OS_STACK_SIZE 200
  157. #endif
  158. // <o>Idle Thread Stack size [bytes] <72-1073741824:8>
  159. // <i> Defines stack size for Idle thread.
  160. // <i> Default: 200
  161. #ifndef OS_IDLE_THREAD_STACK_SIZE
  162. #define OS_IDLE_THREAD_STACK_SIZE 200
  163. #endif
  164. // <o>Idle Thread TrustZone Module Identifier
  165. // <i> Defines TrustZone Thread Context Management Identifier.
  166. // <i> Applies only to cores with TrustZone technology.
  167. // <i> Default: 0 (not used)
  168. #ifndef OS_IDLE_THREAD_TZ_MOD_ID
  169. #define OS_IDLE_THREAD_TZ_MOD_ID 0
  170. #endif
  171. // <q>Stack overrun checking
  172. // <i> Enable stack overrun checks at thread switch.
  173. // <i> Enabling this option increases slightly the execution time of a thread switch.
  174. #ifndef OS_STACK_CHECK
  175. #define OS_STACK_CHECK 1
  176. #endif
  177. // <q>Stack usage watermark
  178. // <i> Initialize thread stack with watermark pattern for analyzing stack usage.
  179. // <i> Enabling this option increases significantly the execution time of thread creation.
  180. #ifndef OS_STACK_WATERMARK
  181. #define OS_STACK_WATERMARK 0
  182. #endif
  183. // <o>Processor mode for Thread execution
  184. // <0=> Unprivileged mode
  185. // <1=> Privileged mode
  186. // <i> Default: Privileged mode
  187. #ifndef OS_PRIVILEGE_MODE
  188. #define OS_PRIVILEGE_MODE 1
  189. #endif
  190. // </h>
  191. // <h>Timer Configuration
  192. // ======================
  193. // <e>Object specific Memory allocation
  194. // <i> Enables object specific memory allocation.
  195. #ifndef OS_TIMER_OBJ_MEM
  196. #define OS_TIMER_OBJ_MEM 0
  197. #endif
  198. // <o>Number of Timer objects <1-1000>
  199. // <i> Defines maximum number of objects that can be active at the same time.
  200. // <i> Applies to objects with system provided memory for control blocks.
  201. #ifndef OS_TIMER_NUM
  202. #define OS_TIMER_NUM 1
  203. #endif
  204. // </e>
  205. // <o>Timer Thread Priority
  206. // <8=> Low
  207. // <16=> Below Normal <24=> Normal <32=> Above Normal
  208. // <40=> High
  209. // <48=> Realtime
  210. // <i> Defines priority for timer thread
  211. // <i> Default: High
  212. #ifndef OS_TIMER_THREAD_PRIO
  213. #define OS_TIMER_THREAD_PRIO 40
  214. #endif
  215. // <o>Timer Thread Stack size [bytes] <0-1073741824:8>
  216. // <i> Defines stack size for Timer thread.
  217. // <i> May be set to 0 when timers are not used.
  218. // <i> Default: 200
  219. #ifndef OS_TIMER_THREAD_STACK_SIZE
  220. #define OS_TIMER_THREAD_STACK_SIZE 200
  221. #endif
  222. // <o>Timer Thread TrustZone Module Identifier
  223. // <i> Defines TrustZone Thread Context Management Identifier.
  224. // <i> Applies only to cores with TrustZone technology.
  225. // <i> Default: 0 (not used)
  226. #ifndef OS_TIMER_THREAD_TZ_MOD_ID
  227. #define OS_TIMER_THREAD_TZ_MOD_ID 0
  228. #endif
  229. // <o>Timer Callback Queue entries <0-256>
  230. // <i> Number of concurrent active timer callback functions.
  231. // <i> May be set to 0 when timers are not used.
  232. // <i> Default: 4
  233. #ifndef OS_TIMER_CB_QUEUE
  234. #define OS_TIMER_CB_QUEUE 4
  235. #endif
  236. // </h>
  237. // <h>Event Flags Configuration
  238. // ============================
  239. // <e>Object specific Memory allocation
  240. // <i> Enables object specific memory allocation.
  241. #ifndef OS_EVFLAGS_OBJ_MEM
  242. #define OS_EVFLAGS_OBJ_MEM 0
  243. #endif
  244. // <o>Number of Event Flags objects <1-1000>
  245. // <i> Defines maximum number of objects that can be active at the same time.
  246. // <i> Applies to objects with system provided memory for control blocks.
  247. #ifndef OS_EVFLAGS_NUM
  248. #define OS_EVFLAGS_NUM 1
  249. #endif
  250. // </e>
  251. // </h>
  252. // <h>Mutex Configuration
  253. // ======================
  254. // <e>Object specific Memory allocation
  255. // <i> Enables object specific memory allocation.
  256. #ifndef OS_MUTEX_OBJ_MEM
  257. #define OS_MUTEX_OBJ_MEM 0
  258. #endif
  259. // <o>Number of Mutex objects <1-1000>
  260. // <i> Defines maximum number of objects that can be active at the same time.
  261. // <i> Applies to objects with system provided memory for control blocks.
  262. #ifndef OS_MUTEX_NUM
  263. #define OS_MUTEX_NUM 1
  264. #endif
  265. // </e>
  266. // </h>
  267. // <h>Semaphore Configuration
  268. // ==========================
  269. // <e>Object specific Memory allocation
  270. // <i> Enables object specific memory allocation.
  271. #ifndef OS_SEMAPHORE_OBJ_MEM
  272. #define OS_SEMAPHORE_OBJ_MEM 0
  273. #endif
  274. // <o>Number of Semaphore objects <1-1000>
  275. // <i> Defines maximum number of objects that can be active at the same time.
  276. // <i> Applies to objects with system provided memory for control blocks.
  277. #ifndef OS_SEMAPHORE_NUM
  278. #define OS_SEMAPHORE_NUM 1
  279. #endif
  280. // </e>
  281. // </h>
  282. // <h>Memory Pool Configuration
  283. // ============================
  284. // <e>Object specific Memory allocation
  285. // <i> Enables object specific memory allocation.
  286. #ifndef OS_MEMPOOL_OBJ_MEM
  287. #define OS_MEMPOOL_OBJ_MEM 0
  288. #endif
  289. // <o>Number of Memory Pool objects <1-1000>
  290. // <i> Defines maximum number of objects that can be active at the same time.
  291. // <i> Applies to objects with system provided memory for control blocks.
  292. #ifndef OS_MEMPOOL_NUM
  293. #define OS_MEMPOOL_NUM 1
  294. #endif
  295. // <o>Data Storage Memory size [bytes] <0-1073741824:8>
  296. // <i> Defines the combined data storage memory size.
  297. // <i> Applies to objects with system provided memory for data storage.
  298. // <i> Default: 0
  299. #ifndef OS_MEMPOOL_DATA_SIZE
  300. #define OS_MEMPOOL_DATA_SIZE 0
  301. #endif
  302. // </e>
  303. // </h>
  304. // <h>Message Queue Configuration
  305. // ==============================
  306. // <e>Object specific Memory allocation
  307. // <i> Enables object specific memory allocation.
  308. #ifndef OS_MSGQUEUE_OBJ_MEM
  309. #define OS_MSGQUEUE_OBJ_MEM 0
  310. #endif
  311. // <o>Number of Message Queue objects <1-1000>
  312. // <i> Defines maximum number of objects that can be active at the same time.
  313. // <i> Applies to objects with system provided memory for control blocks.
  314. #ifndef OS_MSGQUEUE_NUM
  315. #define OS_MSGQUEUE_NUM 1
  316. #endif
  317. // <o>Data Storage Memory size [bytes] <0-1073741824:8>
  318. // <i> Defines the combined data storage memory size.
  319. // <i> Applies to objects with system provided memory for data storage.
  320. // <i> Default: 0
  321. #ifndef OS_MSGQUEUE_DATA_SIZE
  322. #define OS_MSGQUEUE_DATA_SIZE 0
  323. #endif
  324. // </e>
  325. // </h>
  326. // Number of Threads which use standard C/C++ library libspace
  327. // (when thread specific memory allocation is not used).
  328. #if (OS_THREAD_OBJ_MEM == 0)
  329. #define OS_THREAD_LIBSPACE_NUM 4
  330. #else
  331. #define OS_THREAD_LIBSPACE_NUM OS_THREAD_NUM
  332. #endif
  333. //------------- <<< end of configuration section >>> ---------------------------
  334. #endif // RTX_CONFIG_H_