Kconfig 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. menu "RT-Thread Components"
  2. config RT_USING_COMPONENTS_INIT
  3. bool
  4. default n
  5. help
  6. Enable automatic component initialization framework.
  7. When enabled, components marked with INIT_EXPORT() macros will be
  8. automatically initialized during system startup in proper order.
  9. Initialization levels (in order):
  10. - INIT_BOARD_EXPORT: Board-level initialization (pins, clocks)
  11. - INIT_PREV_EXPORT: Early driver initialization
  12. - INIT_DEVICE_EXPORT: Device driver initialization
  13. - INIT_COMPONENT_EXPORT: Component initialization
  14. - INIT_ENV_EXPORT: Environment initialization
  15. - INIT_APP_EXPORT: Application initialization
  16. Benefits:
  17. - Automatic dependency ordering
  18. - Cleaner code (no manual init function calls)
  19. - Consistent initialization across components
  20. Note: Most RT-Thread components rely on this. Usually enabled automatically
  21. by build system.
  22. config RT_USING_USER_MAIN
  23. bool
  24. default n
  25. help
  26. Use user-defined main() function as entry point.
  27. When enabled, RT-Thread creates a main thread that calls your main() function,
  28. allowing traditional C programming style entry point.
  29. Without this option: You must manually create threads from application
  30. With this option: Your main() function runs in a dedicated main thread
  31. The main thread:
  32. - Runs after system initialization
  33. - Has configurable stack size and priority
  34. - Can use RT-Thread APIs like any other thread
  35. - Can create additional threads
  36. Enable this for easier application development and familiar entry point.
  37. if RT_USING_USER_MAIN
  38. config RT_MAIN_THREAD_STACK_SIZE
  39. int "Set main thread stack size"
  40. default 6144 if ARCH_CPU_64BIT
  41. default 2048
  42. help
  43. Stack size in bytes for the main thread.
  44. Default values:
  45. - 64-bit architectures: 6144 bytes (6KB)
  46. - 32-bit architectures: 2048 bytes (2KB)
  47. Increase if:
  48. - Deep recursion in main()
  49. - Large local variables
  50. - Stack overflow in main thread
  51. - Complex initialization requiring more stack
  52. Decrease for memory-constrained systems if main() is simple.
  53. Note: Each thread's stack is separate. This only affects main thread.
  54. config RT_MAIN_THREAD_PRIORITY
  55. int "Set main thread priority"
  56. default 4 if RT_THREAD_PRIORITY_8
  57. default 10 if RT_THREAD_PRIORITY_32
  58. default 85 if RT_THREAD_PRIORITY_256
  59. help
  60. Priority of the main thread (lower number = higher priority).
  61. Default values scale with priority levels:
  62. - 8 levels: Priority 4 (middle-low priority)
  63. - 32 levels: Priority 10 (medium priority)
  64. - 256 levels: Priority 85 (medium-low priority)
  65. Lower values (higher priority) if:
  66. - Main thread needs to preempt other tasks
  67. - Time-critical initialization in main()
  68. Higher values (lower priority) if:
  69. - Main thread is just coordination/monitoring
  70. - Other threads need priority over main
  71. Note: Priority 0 is highest, maximum is configured by RT_THREAD_PRIORITY_MAX.
  72. endif
  73. config RT_USING_LEGACY
  74. bool "Support legacy version for compatibility"
  75. default n
  76. help
  77. Enable compatibility layer for legacy RT-Thread versions.
  78. Provides deprecated APIs and compatibility shims for older code,
  79. allowing gradual migration to newer RT-Thread versions.
  80. Includes:
  81. - Deprecated API wrappers
  82. - Legacy component interfaces
  83. - Backward-compatible behavior
  84. Enable if:
  85. - Porting code from older RT-Thread versions
  86. - Using third-party libraries requiring legacy APIs
  87. - Gradual migration strategy
  88. Disable for:
  89. - New projects (use modern APIs)
  90. - Smaller code size
  91. - Better performance (no compatibility overhead)
  92. Note: Legacy support may be removed in future versions.
  93. Plan to migrate to current APIs.
  94. if RT_USING_CONSOLE
  95. rsource "finsh/Kconfig"
  96. endif
  97. if !RT_USING_NANO
  98. rsource "dfs/Kconfig"
  99. rsource "fal/Kconfig"
  100. rsource "drivers/Kconfig"
  101. rsource "libc/Kconfig"
  102. rsource "net/Kconfig"
  103. rsource "mprotect/Kconfig"
  104. rsource "utilities/Kconfig"
  105. endif
  106. if ARCH_MM_MMU
  107. rsource "mm/Kconfig"
  108. endif
  109. if RT_USING_SMART
  110. rsource "lwp/Kconfig"
  111. endif
  112. rsource "legacy/Kconfig"
  113. rsource "rust/Kconfig"
  114. endmenu