Skip to content

Compilation error when get_pico_sdk is commented out in CMakeLists.txt #230

@Ariel-Inacio

Description

@Ariel-Inacio

By default in this repository, line 28 of the Firmware/RP2040/CMakeLists.txt file is commented out:

# get_pico_sdk(${EXTERNAL_DIR} ${PICOSDK_VERSION_TAG})

When this line remains commented, the CMake configuration fails. I would like to know if there is a specific reason for this line to be disabled by default (such as potential instability).

Observed Behavior (Error Log)

With the line commented out, CMake fails to locate the SDK initialization file and subsequently fails the compiler check:

D:\...\ cmake -G "Ninja" -DOGXM_BOARD=PI_PICO2W ..
[...]
CMake Error at CMakeLists.txt:306 (include):
include could not find requested file:
  /pico_sdk_init.cmake
-- The C compiler identification is GNU 15.2.1
[...]
-- Check for working C compiler: .../arm-none-eabi-gcc.exe - broken
[...]
C:/.../arm-none-eabi/bin/ld.exe: unrecognized option '--major-image-version'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Successful Build (After uncommenting)

If I uncomment line 28, the project configures and compiles correctly:

D:\...\ cmake -G "Ninja" -DOGXM_BOARD=PI_PICO2W ..
[...]
Using PICO_SDK_PATH from environment: .../Firmware/external/pico-sdk
Target board (PICO_BOARD) is 'pico2_w'.
Pico Platform (PICO_PLATFORM) is 'rp2350-arm-s'.
Configuring toolchain based on PICO_COMPILER 'pico_arm_cortex_m33_gcc'
[...]
-- Configuring done (5.7s)
-- Generating done (0.6s)
-- Build files have been written to: .../build_pico2w

Environment

  • Build System: CMake + Ninja
  • Toolchain: GNU Arm Embedded Toolchain 15.2.1
  • Target: RP2350 / PI_PICO2W

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions