Quantcast
Viewing latest article 2
Browse Latest Browse All 4877

SDK • Re: No USB stdio after adding SPI

Why do you use "test_project" in project(), but "SPI_test" elsewhere in the CMakeLists? I'll admit to not knowing much about cmake but I've always used the same project name throughout.

This is how I would have the CMakeLists.txt:

Code:

cmake_minimum_required(VERSION 3.13)include(pico_sdk_import.cmake)project(SPI_test C CXX ASM)set(CMAKE_C_STANDARD 11)set(CMAKE_CXX_STANDARD 17)pico_sdk_init()add_executable(    ${PROJECT_NAME}    SPI_test.c)target_link_libraries(${PROJECT_NAME}    pico_stdlib    hardware_spi)target_include_directories(${PROJECT_NAME} PRIVATE$(CMAKE_CURRENT_LIST_DIR))pico_enable_stdio_usb(${PROJECT_NAME} 1)pico_enable_stdio_uart(${PROJECT_NAME} 1)pico_add_extra_outputs(${PROJECT_NAME})

Statistics: Posted by Mike**K — Sun Apr 13, 2025 5:27 pm



Viewing latest article 2
Browse Latest Browse All 4877

Trending Articles