Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8026

SDK • Using multiple SDK's

$
0
0
I've been using SDK1.5 with the Pico1 and want to keep that SDK, but I just received a Pico2 so I want to install the latest SDK as well. Can I make this happen easily? Like, can I just have different directories (I use Linux) and specify the SDK in the CMakeLists.txt files? Below is the CMakeLists.txt from one of my projects to show how I currently do things. I have not downloaded SDK2.2 yet.

Code:

# Initialise pico_sdk from installed locationset(PICO_SDK_PATH "/home/mike/pico/pico-sdk")set(PICO_BOARD waveshare_rp2040_zero)set(PICO_PLATFORM rp2040)set(CMAKE_BUILD_TYPE Release)cmake_minimum_required(VERSION 3.13)# Pull in Raspberry Pi Pico SDK (must be before project)include(pico_sdk_import.cmake)project(tlogger C CXX ASM)set(CMAKE_C_STANDARD 11)set(CMAKE_CXX_STANDARD 17)if (PICO_SDK_VERSION_STRING VERSION_LESS "1.4.0")  message(FATAL_ERROR "Raspberry Pi Pico SDK version 1.4.0 (or later) required. Your version is ${PICO_SDK_VERSION_STRING}")endif()# Initialise the Raspberry Pi Pico SDKpico_sdk_init()add_executable(${PROJECT_NAME}                main.c                hw_config.c)add_subdirectory(lib/no-OS-FatFS-SD-SPI-RPi-Pico/FatFs_SPI build)add_subdirectory(ssd1306_library)add_subdirectory(onewire_library)set_property(TARGET ${PROJECT_NAME} APPEND_STRING PROPERTY LINK_FLAGS "-Wl,--print-memory-usage")pico_generate_pio_header(${PROJECT_NAME} ${CMAKE_CURRENT_LIST_DIR}/ws2812.pio)# Add the standard library to the buildtarget_link_libraries(${PROJECT_NAME}        hardware_pio        pico_stdlib        hardware_i2c        hardware_rtc        FatFs_SPI        ssd1306_library        onewire_library)target_compile_options(${PROJECT_NAME} PRIVATE        -Wall -Werror        -Wno-unused-function        -Wno-unused-parameter        -Wno-unused-variable)        pico_enable_stdio_usb(${PROJECT_NAME} 1)pico_enable_stdio_uart(${PROJECT_NAME} 0)pico_add_extra_outputs(${PROJECT_NAME})

Statistics: Posted by Mike**K — Sat Oct 25, 2025 12:19 am



Viewing all articles
Browse latest Browse all 8026

Trending Articles