Kconfig 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  1. menu "RT-Thread Kernel"
  2. config RT_NAME_MAX
  3. int "The maximal size of kernel object name"
  4. range 2 64
  5. default 8
  6. help
  7. Each kernel object, such as thread, timer, semaphore etc, has a name,
  8. the RT_NAME_MAX is the maximal size of this object name.
  9. config RT_USING_ARCH_DATA_TYPE
  10. bool "Use the data types defined in ARCH_CPU"
  11. default n
  12. help
  13. For the data type like, `rt_uint8/int8_t, rt_uint16/int16_t, rt_uint32/int32_t`,
  14. BSP can define these basic data types in ARCH_CPU level.
  15. Please re-define these data types in rtconfig_project.h file.
  16. config RT_USING_NANO
  17. bool "Enable RT-Thread Nano"
  18. default n
  19. help
  20. RT-Thread Nano is a very small size and refined hard real-time kernel,
  21. which is suited for the extremely resource-constrained MCU system.
  22. config RT_USING_SMART
  23. bool "Enable RT-Thread Smart (microkernel on kernel/userland)"
  24. default n
  25. select RT_USING_LWP
  26. select RT_USING_DFS
  27. select RT_USING_POSIX_CLOCKTIME
  28. select RT_USING_DEVICE
  29. select RT_USING_NULL
  30. select RT_USING_ZERO
  31. select RT_USING_RANDOM
  32. select RT_USING_RTC
  33. select RT_USING_POSIX_TIMER
  34. select RT_USING_POSIX_CLOCK
  35. select RT_USING_POSIX_FS
  36. select RT_USING_POSIX_TERMIOS
  37. select RT_USING_KTIME
  38. select RT_USING_STDC_ATOMIC
  39. select RT_USING_SYSTEM_WORKQUEUE
  40. select RT_USING_CPU_USAGE_TRACER
  41. select RT_USING_SCHED_THREAD_CTX
  42. depends on ARCH_ARM_CORTEX_M || ARCH_ARM_ARM9 || ARCH_ARM_CORTEX_A || ARCH_ARMV8 || ARCH_RISCV64
  43. depends on !RT_USING_NANO
  44. help
  45. RT-Thread Smart is a microkernel based operating system on RT-Thread.
  46. config RT_USING_AMP
  47. bool "Enable AMP (Asymmetric Multi-Processing)"
  48. default n
  49. if RT_USING_AMP
  50. choice
  51. prompt "Select the AMP role"
  52. default RT_AMP_SLAVE
  53. config RT_AMP_MASTER
  54. bool "amp role MASTER"
  55. config RT_AMP_SLAVE
  56. bool "amp role SLAVE"
  57. endchoice
  58. endif
  59. config RT_USING_SMP
  60. bool "Enable SMP (Symmetric multiprocessing)"
  61. default n
  62. help
  63. This option should be selected by machines which have an SMP-
  64. capable CPU.
  65. The only effect of this option is to make the SMP-related
  66. options available to the user for configuration.
  67. config RT_CPUS_NR
  68. int "Number of CPUs"
  69. default 1
  70. range 1 1 if !RT_USING_SMP && !RT_USING_AMP
  71. help
  72. Number of CPUs in the system
  73. config RT_ALIGN_SIZE
  74. int "Alignment size for CPU architecture data access"
  75. default 8
  76. help
  77. Alignment size for CPU architecture data access
  78. choice
  79. prompt "The maximal level value of priority of thread"
  80. default RT_THREAD_PRIORITY_32
  81. config RT_THREAD_PRIORITY_8
  82. bool "8"
  83. config RT_THREAD_PRIORITY_32
  84. bool "32"
  85. config RT_THREAD_PRIORITY_256
  86. bool "256"
  87. endchoice
  88. config RT_THREAD_PRIORITY_MAX
  89. int
  90. default 8 if RT_THREAD_PRIORITY_8
  91. default 32 if RT_THREAD_PRIORITY_32
  92. default 256 if RT_THREAD_PRIORITY_256
  93. config RT_TICK_PER_SECOND
  94. int "Tick frequency, Hz"
  95. range 10 1000
  96. default 1000
  97. help
  98. System's tick frequency, Hz.
  99. config RT_USING_OVERFLOW_CHECK
  100. bool "Using stack overflow checking"
  101. default y if RT_USING_DEBUG
  102. help
  103. Enable thread stack overflow checking. The stack overflow is checking when
  104. each thread switch.
  105. config RT_USING_HOOK
  106. bool "Enable system hook"
  107. default y
  108. select RT_USING_IDLE_HOOK
  109. help
  110. Enable the hook function when system running, such as idle thread hook,
  111. thread context switch etc.
  112. if RT_USING_HOOK
  113. config RT_HOOK_USING_FUNC_PTR
  114. bool "Using function pointers as system hook"
  115. default y
  116. endif
  117. config RT_USING_HOOKLIST
  118. bool "Enable hook list"
  119. default n
  120. help
  121. Enable the hook list feature for rt-thread packages. With this, they can
  122. plug in to the system on run-time.
  123. config RT_USING_IDLE_HOOK
  124. bool "Enable IDLE Task hook"
  125. default y if RT_USING_HOOK
  126. if RT_USING_IDLE_HOOK
  127. config RT_IDLE_HOOK_LIST_SIZE
  128. int "The max size of idle hook list"
  129. default 4
  130. range 1 16
  131. help
  132. The system has a hook list. This is the hook list size.
  133. endif
  134. config IDLE_THREAD_STACK_SIZE
  135. int "The stack size of idle thread"
  136. default 1024 if ARCH_CPU_64BIT
  137. default 256
  138. config SYSTEM_THREAD_STACK_SIZE
  139. int "The stack size of system thread (for defunct etc.)"
  140. depends on RT_USING_SMP
  141. default IDLE_THREAD_STACK_SIZE
  142. config RT_USING_TIMER_SOFT
  143. bool "Enable software timer with a timer thread"
  144. default y
  145. help
  146. the timeout function context of soft-timer is under a high priority timer
  147. thread.
  148. if RT_USING_TIMER_SOFT
  149. config RT_TIMER_THREAD_PRIO
  150. int "The priority level value of timer thread"
  151. default 4
  152. config RT_TIMER_THREAD_STACK_SIZE
  153. int "The stack size of timer thread"
  154. default 2048 if ARCH_CPU_64BIT
  155. default 512
  156. config RT_USING_TIMER_ALL_SOFT
  157. bool "Set all timer as soft timer"
  158. default n
  159. endif
  160. config RT_USING_CPU_USAGE_TRACER
  161. select RT_USING_HOOK
  162. bool "Enable cpu usage tracing"
  163. help
  164. Enable cpu usage tracer for application like top.
  165. default y if RT_USING_SMART
  166. default n
  167. menu "kservice options"
  168. config RT_USING_TINY_FFS
  169. bool "Enable kservice to use tiny finding first bit set method"
  170. default n
  171. endmenu
  172. menu "klibc options"
  173. config RT_KLIBC_USING_STDLIB
  174. bool "Enable klibc to use standard C library"
  175. default n
  176. if RT_KLIBC_USING_STDLIB
  177. config RT_KLIBC_USING_STDLIB_MEMORY
  178. bool "Use stdlib memory functions to replace (faster, but not safe)"
  179. default n
  180. help
  181. e.g. use memcpy to replace rt_memcpy
  182. endif
  183. config RT_KLIBC_USING_TINY_SIZE
  184. bool "Enable tiny size of klibc"
  185. default n
  186. menu "rt_vsnprintf options"
  187. config RT_KLIBC_USING_VSNPRINTF_STANDARD
  188. bool "standard rt_vsnprintf version"
  189. default y if ARCH_CPU_64BIT
  190. default n
  191. help
  192. Standard version of rt_vsnprintf, which is full function but higher stack usage.
  193. config RT_KLIBC_USING_VSNPRINTF_LONGLONG
  194. bool "Enable rt_vsnprintf function to support long-long format"
  195. default y if RT_KLIBC_USING_VSNPRINTF_STANDARD
  196. default n
  197. help
  198. Support for the long long integral types (with the ll, z and t length modifiers for specifiers
  199. %d,%i,%o,%x,%X,%u, and with the %p specifier). Note: 'L' (long double) is not supported.
  200. if RT_KLIBC_USING_VSNPRINTF_STANDARD
  201. config RT_KLIBC_USING_VSNPRINTF_DECIMAL_SPECIFIERS
  202. bool "Support decimal notation floating point conversion specifiers (%f, %F)"
  203. default y
  204. help
  205. Support for the decimal notation floating point conversion specifiers (%f, %F)
  206. config RT_KLIBC_USING_VSNPRINTF_EXPONENTIAL_SPECIFIERS
  207. bool "Support exponential notation floating point conversion specifiers (%e, %g, %E, %G)"
  208. default y
  209. help
  210. Support for the exponential notation floating point conversion specifiers (%e, %g, %E, %G)
  211. config RT_KLIBC_USING_VSNPRINTF_WRITEBACK_SPECIFIER
  212. bool "Support length write-back specifier (%n)"
  213. default y
  214. help
  215. Support for the length write-back specifier (%n)
  216. config RT_KLIBC_USING_VSNPRINTF_CHECK_NUL_IN_FORMAT_SPECIFIER
  217. bool "safety check: no NULL end string"
  218. default y if RT_USING_DEBUG
  219. default n
  220. help
  221. Be extra-safe, and don't assume format specifiers are completed correctly
  222. before the format string end.
  223. config RT_KLIBC_USING_VSNPRINTF_MSVC_STYLE_INTEGER_SPECIFIERS
  224. bool "Support MSVC style integer specifiers"
  225. default n
  226. help
  227. the integer format specifiers used in Microsoft's Visual C++ (MSVC) compiler.
  228. These specifiers, like %I64d for 64-bit integers, deviate slightly from the standard
  229. C format specifiers and are specific to MSVC. They allow for controlled formatting of
  230. integers in printf()-like functions, accommodating different integer sizes and ensuring
  231. compatibility with MSVC's environment. It's important to note that these specifiers might
  232. not be recognized or function in other compilers due to their MSVC-specific nature.
  233. config RT_KLIBC_USING_VSNPRINTF_INTEGER_BUFFER_SIZE
  234. int "'ntoa' conversion buffer size"
  235. default 32
  236. help
  237. 'ntoa' conversion buffer size, this must be big enough to hold one converted
  238. numeric number including padded zeros (dynamically created on stack)
  239. config RT_KLIBC_USING_VSNPRINTF_DECIMAL_BUFFER_SIZE
  240. int "printing individual decimal numbers buffer size"
  241. default 32
  242. help
  243. size of the fixed (on-stack) buffer for printing individual decimal numbers.
  244. this must be big enough to hold one converted floating-point value including
  245. padded zeros.
  246. config RT_KLIBC_USING_VSNPRINTF_FLOAT_PRECISION
  247. int "floating point conversion specifiers"
  248. default 6
  249. help
  250. Default precision for the floating point conversion specifiers (the C standard sets this at 6)
  251. config RT_KLIBC_USING_VSNPRINTF_MAX_INTEGRAL_DIGITS_FOR_DECIMAL
  252. int "integral nums printed as float in rt_vsnprint"
  253. default 9
  254. help
  255. According to the C languages standard, printf() and related functions must be able to print any
  256. integral number in floating-point notation, regardless of length, when using the %f specifier -
  257. possibly hundreds of characters, potentially overflowing your buffers. In this implementation,
  258. all values beyond this threshold are switched to exponential notation.
  259. config RT_KLIBC_USING_VSNPRINTF_LOG10_TAYLOR_TERMS
  260. int "the number of terms in a Taylor series expansion of log_10(x)"
  261. default 4
  262. range 2 99
  263. help
  264. The number of terms in a Taylor series expansion of log_10(x) to
  265. use for approximation - including the power-zero term (i.e. the
  266. value at the point of expansion).
  267. endif
  268. endmenu # rt_vsnprintf options
  269. endmenu # klibc options
  270. menuconfig RT_USING_DEBUG
  271. bool "Enable debugging features"
  272. default y
  273. if RT_USING_DEBUG
  274. config RT_DEBUGING_ASSERT
  275. bool "Enable assertion debugging"
  276. default y
  277. config RT_DEBUGING_COLOR
  278. bool "Enable color debugging log"
  279. default y
  280. config RT_DEBUGING_CONTEXT
  281. bool "Enable debugging of environment and context check"
  282. default y
  283. config RT_DEBUGING_AUTO_INIT
  284. bool "Enable debugging of components automatic initialization"
  285. default n
  286. config RT_DEBUGING_PAGE_LEAK
  287. bool "Enable page leaking tracer"
  288. depends on ARCH_MM_MMU
  289. default n
  290. config RT_DEBUGING_SPINLOCK
  291. bool "Enable spinlock debugging"
  292. depends on RT_USING_SMP
  293. default n
  294. config RT_DEBUGING_CRITICAL
  295. bool "Enable critical level tracing"
  296. depends on RT_USING_SMP
  297. default y if RT_USING_SMART
  298. default n
  299. endif
  300. config RT_USING_CI_ACTION
  301. default n
  302. help
  303. Identify that the environment is CI Action.
  304. menu "Inter-Thread communication"
  305. config RT_USING_SEMAPHORE
  306. bool "Enable semaphore"
  307. default y
  308. config RT_USING_MUTEX
  309. bool "Enable mutex"
  310. default y
  311. config RT_USING_EVENT
  312. bool "Enable event flag"
  313. default y
  314. config RT_USING_MAILBOX
  315. bool "Enable mailbox"
  316. default y
  317. config RT_USING_MESSAGEQUEUE
  318. bool "Enable message queue"
  319. default y
  320. config RT_USING_MESSAGEQUEUE_PRIORITY
  321. bool "Enable message queue priority"
  322. depends on RT_USING_MESSAGEQUEUE
  323. default n
  324. config RT_USING_SIGNALS
  325. bool "Enable signals"
  326. select RT_USING_MEMPOOL
  327. default n
  328. help
  329. A signal is an asynchronous notification sent to a specific thread
  330. in order to notify it of an event that occurred.
  331. endmenu
  332. menu "Memory Management"
  333. config RT_PAGE_MAX_ORDER
  334. int "Max order of pages allocatable by page allocator"
  335. default 11
  336. depends on ARCH_MM_MMU
  337. help
  338. For example, A value of 11 means the maximum chunk of contiguous memory
  339. allocatable by page system is 2^(11 + ARCH_PAGE_BITS - 1) Bytes.
  340. Large memory requirement can consume all system resource, and should
  341. consider reserved memory instead to enhance system endurance.
  342. Max order should at least satisfied usage by huge page.
  343. config RT_USING_MEMPOOL
  344. bool "Using memory pool"
  345. default y
  346. help
  347. Using static memory fixed partition
  348. config RT_USING_SMALL_MEM
  349. bool "Using Small Memory Algorithm"
  350. default n
  351. help
  352. Using Small Memory Algorithm
  353. config RT_USING_SLAB
  354. bool "Using SLAB Memory Algorithm"
  355. default n
  356. help
  357. The slab allocator of RT-Thread is a memory allocation algorithm
  358. optimizedfor embedded systems based on the slab allocator
  359. implemented by Matthew Dillon, founder of dragonfly BSD.
  360. The original slab algorithm is an efficient kernel memory
  361. allocation algorithm introduced by Jeff bonwick for
  362. Solaris Operating System.
  363. menuconfig RT_USING_MEMHEAP
  364. bool "Using memheap Memory Algorithm"
  365. default n
  366. if RT_USING_MEMHEAP
  367. choice
  368. prompt "Memheap memory allocation mode"
  369. default RT_MEMHEAP_FAST_MODE
  370. config RT_MEMHEAP_FAST_MODE
  371. bool "fast mode"
  372. help
  373. Speed priority mode.
  374. As long as the memory block size meets the requirements, the search ends immediately.
  375. config RT_MEMHEAP_BEST_MODE
  376. bool "best mode"
  377. help
  378. Best size first.
  379. The search does not end until the memory block of the most appropriate size is found
  380. endchoice
  381. endif
  382. choice
  383. prompt "System Heap Memory Management"
  384. default RT_USING_SMALL_MEM_AS_HEAP
  385. config RT_USING_SMALL_MEM_AS_HEAP
  386. bool "Small Memory Algorithm"
  387. select RT_USING_SMALL_MEM
  388. config RT_USING_MEMHEAP_AS_HEAP
  389. bool "Use memheap objects as heap"
  390. select RT_USING_MEMHEAP
  391. if RT_USING_MEMHEAP_AS_HEAP
  392. config RT_USING_MEMHEAP_AUTO_BINDING
  393. bool "Use all of memheap objects as heap"
  394. default y
  395. endif
  396. config RT_USING_SLAB_AS_HEAP
  397. bool "SLAB Algorithm for large memory"
  398. select RT_USING_SLAB
  399. config RT_USING_USERHEAP
  400. bool "Use user heap"
  401. help
  402. If this option is selected, please implement these functions:
  403. rt_malloc(), rt_malloc_sethook()
  404. rt_free(), rt_free_sethook()
  405. rt_calloc(), rt_realloc()
  406. rt_memory_info()
  407. rt_system_heap_init()
  408. config RT_USING_NOHEAP
  409. bool "Disable Heap"
  410. endchoice
  411. config RT_USING_MEMTRACE
  412. bool "Enable memory trace"
  413. default n
  414. help
  415. When enable RT_USING_MEMTRACE with shell, developer can call cmd:
  416. 1. memtrace
  417. to dump memory block information.
  418. 2. memcheck
  419. to check memory block to avoid memory overwritten.
  420. And developer also can call memcheck() in each of scheduling
  421. to check memory block to find which thread has wrongly modified
  422. memory.
  423. config RT_USING_HEAP_ISR
  424. bool "Using heap in ISR"
  425. default n
  426. help
  427. When this option is enabled, the critical zone will be protected with disable interrupt.
  428. config RT_USING_HEAP
  429. bool
  430. default n if RT_USING_NOHEAP
  431. default y if RT_USING_SMALL_MEM
  432. default y if RT_USING_SLAB
  433. default y if RT_USING_MEMHEAP_AS_HEAP
  434. default y if RT_USING_USERHEAP
  435. endmenu
  436. config RT_USING_DEVICE
  437. bool "Using device object"
  438. depends on !RT_USING_NANO
  439. default y
  440. config RT_USING_DEVICE_OPS
  441. bool "Using ops for each device object"
  442. depends on RT_USING_DEVICE
  443. default n
  444. config RT_USING_INTERRUPT_INFO
  445. bool "Enable additional interrupt trace information"
  446. default n
  447. help
  448. Add name and counter information for interrupt trace.
  449. config RT_USING_THREADSAFE_PRINTF
  450. bool "Enable thread safe kernel print service"
  451. default y if RT_USING_SMP && RT_USING_SMART
  452. config RT_USING_CONSOLE
  453. bool "Using console for rt_kprintf"
  454. default y
  455. if RT_USING_CONSOLE
  456. config RT_CONSOLEBUF_SIZE
  457. int "the buffer size for console log printf"
  458. default 256 if RT_USING_UTEST
  459. default 128
  460. config RT_CONSOLE_DEVICE_NAME
  461. string "the device name for console"
  462. default "uart1"
  463. endif
  464. config RT_VER_NUM
  465. hex
  466. default 0x50200
  467. help
  468. RT-Thread version number
  469. config RT_USING_STDC_ATOMIC
  470. bool "Use atomic implemented in stdatomic.h"
  471. default n
  472. config RT_BACKTRACE_LEVEL_MAX_NR
  473. int "Max number of backtrace level"
  474. default 32
  475. endmenu