Skip to content

Migrate ThreadX RTOS to Bazel build system#501

Draft
SuhashiniNaik wants to merge 1 commit into
eclipse-openbsw:mainfrom
esrlabs:cr-1104276
Draft

Migrate ThreadX RTOS to Bazel build system#501
SuhashiniNaik wants to merge 1 commit into
eclipse-openbsw:mainfrom
esrlabs:cr-1104276

Conversation

@SuhashiniNaik

@SuhashiniNaik SuhashiniNaik commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Migrate ThreadX RTOS to Bazel build system

New BUILD files:

  • libs/3rdparty/threadx: Core ThreadX library with label_flags for
    port, port_impl, os_hooks and core_configuration selection
  • libs/bsw/asyncThreadX: async_threadx, async_threadx_impl and
    threadx_configuration targets with threadx_core_configuration
    label_flag
  • platforms/s32k1xx/3rdparty/threadx: Cortex-M4 port implementation and port headers for s32k148
  • platforms/posix/3rdparty/threadx: Linux port implementation and
    port headers for POSIX
  • executables/referenceApp/platforms/s32k148evb/main: threadx_os_hooks
  • executables/referenceApp/platforms/s32k148evb/threadXCoreConfiguration
  • executables/referenceApp/platforms/posix/threadXCoreConfiguration

Modified BUILD files:

  • libs/bsw/async: Added support_threadx branch to async_platform_default
  • platforms/s32k1xx/bsp/bspInterruptsImpl: Added threadx RTOS headers
    and wired into bsp_interrupts_impl_rtos_hdrs alias
  • platforms/posix/bsp/bspInterruptsImpl: Added threadx variant

Key Bazel patterns used:

    • label_flag + alias + select() for platform/RTOS-specific selection
  • target_compatible_with to restrict platform-specific targets
  • async_threadx_impl and async_freertos_impl marked incompatible for
    opposite RTOS configs to prevent build failures in bazel build //...
  • Circular dependency threadX -> osHooks -> asyncThreadX -> threadX
    broken by depending on threadx_headers instead of threadx

Added --config=s32k148_threadx to .bazelrc combining s32k148 platform
and threadx RTOS flag.

New BUILD files:
- libs/3rdparty/threadx: Core ThreadX library with label_flags for
  port, port_impl, os_hooks and core_configuration selection
- libs/bsw/asyncThreadX: async_threadx, async_threadx_impl and
  threadx_configuration targets with threadx_core_configuration
  label_flag
- platforms/s32k1xx/3rdparty/threadx: Cortex-M4 port implementation and port headers for s32k148
- platforms/posix/3rdparty/threadx: Linux port implementation and
  port headers for POSIX
- executables/referenceApp/platforms/s32k148evb/main: threadx_os_hooks
- executables/referenceApp/platforms/s32k148evb/threadXCoreConfiguration
- executables/referenceApp/platforms/posix/threadXCoreConfiguration

Modified BUILD files:
- libs/bsw/async: Added support_threadx branch to async_platform_default
- platforms/s32k1xx/bsp/bspInterruptsImpl: Added threadx RTOS headers
  and wired into bsp_interrupts_impl_rtos_hdrs alias
- platforms/posix/bsp/bspInterruptsImpl: Added threadx variant

Key Bazel patterns used:
- - label_flag + alias + select() for platform/RTOS-specific selection
- target_compatible_with to restrict platform-specific targets
- async_threadx_impl and async_freertos_impl marked incompatible for
  opposite RTOS configs to prevent build failures in bazel build //...
- Circular dependency threadX -> osHooks -> asyncThreadX -> threadX
  broken by depending on threadx_headers instead of threadx

Added --config=s32k148_threadx to .bazelrc combining s32k148 platform
and threadx RTOS flag. Suggest adding this as a CI step:
  bazel build --config=s32k148_threadx
@SuhashiniNaik SuhashiniNaik marked this pull request as draft June 30, 2026 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant