Skip to content

Commit ee4b85b

Browse files
Fix NXP MCUXpresso CIFAR link failure (pytorch#24510)
Main-branch counterpart of release/1.6 fix pytorch#24509. Fixes the NXP MCUXpresso failure seen on pytorch#24490; main has the same incomplete CMake target. The [failed job](https://github.com/pytorch/executorch/actions/runs/41601038988/job/125799646998) reaches the final CIFAR firmware link, then fails with `undefined reference to SYS_INFO_PrintAll`. The SDK example calls this helper, but our standalone CMake target omits `examples/eiq_examples/common/sys_info/sys_info.c`. Add that source to the firmware target. The helper also needs `MCUXSDK_VERSION_FULL_STR`, which the SDK's normal build supplies through a generated header. Our standalone target now uses the SDK's `mcux_version.cmake` parser and sets the equivalent compile definition from the checked-out SDK version. ## Verification A focused host CMake build reused the actual example target's source list and include paths, the real SDK helper/header, and the SDK version parser. The board/runtime sources were replaced with empty fixtures and the application with a small C++ caller. The original source list reproduced the unresolved `SYS_INFO_PrintAll` link error. Adding only the helper reproduced the missing `MCUXSDK_VERSION_FULL_STR` compile error. With both changes, the executable linked and printed `MCUX SDK version: 2026.12.00-pvw1`. `git diff --check` passed. The full ARM firmware build and execution on hardware were not run locally; the NXP CI job must validate the complete build. Only the example's CMakeLists.txt changes (eight added lines). The resulting file is byte-identical to the verified release fix in pytorch#24509. Land this on main; pytorch#24509 is the corresponding release/1.6 pick. Prepared with OpenAI Codex.
1 parent 186ca41 commit ee4b85b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎examples/nxp/mcuxpresso/imxrt700/executorch_cifarnet/CMakeLists.txt‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ add_executable(
5858
${SdkRootDirPath}/examples/eiq_examples/executorch_cifarnet/main.cpp
5959
${SdkRootDirPath}/examples/eiq_examples/executorch_cifarnet/RegisterKernels.cpp
6060
${SdkRootDirPath}/examples/eiq_examples/common/timer.c
61+
${SdkRootDirPath}/examples/eiq_examples/common/sys_info/sys_info.c
6162
${SdkRootDirPath}/devices/RT/RT700/MIMXRT798S/startup_MIMXRT798S_cm33_core0.c
6263
${EXECUTORCH_ROOT_DIR}/backends/nxp/runtime/NeutronBackend.cpp
6364
${SdkRootDirPath}/middleware/tfm/tf-m/platform/ext/common/syscalls_stub.c
@@ -83,6 +84,13 @@ add_executable(
8384
${SdkRootDirPath}/components/debug_console_lite/fsl_debug_console.c
8485
)
8586

87+
# sys_info.c needs the version macro supplied by the SDK's normal build system.
88+
include(${SdkRootDirPath}/cmake/extension/mcux_version.cmake)
89+
target_compile_definitions(
90+
${MCUX_SDK_PROJECT_NAME}
91+
PRIVATE "MCUXSDK_VERSION_FULL_STR=\"${MCUXSDK_VERSION_FULL}\""
92+
)
93+
8694
target_include_directories(
8795
${MCUX_SDK_PROJECT_NAME}
8896
PRIVATE

0 commit comments

Comments
 (0)