raspberrypi / pico-vscode

The official VS Code extension for Raspberry Pi Pico development. It includes several features to simplify project creation and deployment.
https://marketplace.visualstudio.com/items?itemName=raspberry-pi.raspberry-pi-pico
Mozilla Public License 2.0
125 stars 14 forks source link

Not adding all of SDK paths ? #116

Closed Stubblet closed 6 days ago

Stubblet commented 1 week ago

I am working on a clock for the picoW - building on the ntp example. I generated the new project using the plugin - ran "Configure CMake" and then "Compile Project" Board set to PICOW SDK 2..0 Toolchain 13.1 It does not seem to add the multicore include dir to the include path:

ninja: Entering directory `D:\git\VSCode-Progamming\ntp_clock_v2\ntpClock/build' [13/84] Building C object CMakeFiles/ntpClock.dir/ntpClock.c.obj FAILED: CMakeFiles/ntpClock.dir/ntpClock.c.obj C:\Users\Andre.pico-sdk\toolchain\13_3_Rel1\bin\arm-none-eabi-gcc.exe -DCFG_TUSB_DEBUG=0 -DCFG_TUSB_MCU=OPT_MCU_RP2040 -DCFG_TUSB_OS=OPT_OS_PICO -DLIB_PICO_ATOMIC=1 -DLIB_PICO_BIT_OPS=1 -DLIB_PICO_BIT_OPS_PICO=1 -DLIB_PICO_CLIB_INTERFACE=1 -DLIB_PICO_CRT0=1 -DLIB_PICO_CXX_OPTIONS=1 -DLIB_PICO_DIVIDER=1 -DLIB_PICO_DIVIDER_HARDWARE=1 -DLIB_PICO_DOUBLE=1 -DLIB_PICO_DOUBLE_PICO=1 -DLIB_PICO_FIX_RP2040_USB_DEVICE_ENUMERATION=1 -DLIB_PICO_FLOAT=1 -DLIB_PICO_FLOAT_PICO=1 -DLIB_PICO_INT64_OPS=1 -DLIB_PICO_INT64_OPS_PICO=1 -DLIB_PICO_MALLOC=1 -DLIB_PICO_MEM_OPS=1 -DLIB_PICO_MEM_OPS_PICO=1 -DLIB_PICO_NEWLIB_INTERFACE=1 -DLIB_PICO_PLATFORM=1 -DLIB_PICO_PLATFORM_COMPILER=1 -DLIB_PICO_PLATFORM_PANIC=1 -DLIB_PICO_PLATFORM_SECTIONS=1 -DLIB_PICO_PRINTF=1 -DLIB_PICO_PRINTF_PICO=1 -DLIB_PICO_RUNTIME=1 -DLIB_PICO_RUNTIME_INIT=1 -DLIB_PICO_STANDARD_BINARY_INFO=1 -DLIB_PICO_STANDARD_LINK=1 -DLIB_PICO_STDIO=1 -DLIB_PICO_STDIO_USB=1 -DLIB_PICO_STDLIB=1 -DLIB_PICO_SYNC=1 -DLIB_PICO_SYNC_CRITICAL_SECTION=1 -DLIB_PICO_SYNC_MUTEX=1 -DLIB_PICO_SYNC_SEM=1 -DLIB_PICO_TIME=1 -DLIB_PICO_TIME_ADAPTER=1 -DLIB_PICO_UNIQUE_ID=1 -DLIB_PICO_UTIL=1 -DPICO_32BIT=1 -DPICO_BOARD=\"pico_w\" -DPICO_BUILD=1 -DPICO_CMAKE_BUILD_TYPE=\"Release\" -DPICO_COPY_TO_RAM=0 -DPICO_CXX_ENABLE_EXCEPTIONS=0 -DPICO_NO_FLASH=0 -DPICO_NO_HARDWARE=0 -DPICO_ON_DEVICE=1 -DPICO_PROGRAM_NAME=\"ntpClock\" -DPICO_PROGRAM_VERSION_STRING=\"0.1\" -DPICO_RP2040=1 -DPICO_RP2040_USB_DEVICE_UFRAME_FIX=1 -DPICO_TARGET_NAME=\"ntpClock\" -DPICO_USE_BLOCKED_RAM=0 -ID:/git/VSCode-Progamming/ntp_clock_v2/ntpClock -ID:/git/VSCode-Progamming/ntp_clock_v2/ntpClock/.. -IC:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/pico_atomic/include -IC:/Users/Andre/.pico-sdk/sdk/2.0.0/lib/tinyusb/src -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/common/pico_stdlib_headers/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/hardware_gpio/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/common/pico_base_headers/include -isystem D:/git/VSCode-Progamming/ntp_clock_v2/ntpClock/build/generated/pico_base -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/boards/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2040/pico_platform/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2040/hardware_regs/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/hardware_base/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/pico_platform_compiler/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/pico_platform_panic/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/pico_platform_sections/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2040/hardware_structs/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/common/hardware_claim/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/hardware_sync/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/hardware_sync_spin_lock/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/hardware_irq/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/hardware_uart/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/hardware_resets/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/hardware_clocks/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/hardware_pll/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/hardware_vreg/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/hardware_watchdog/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/hardware_ticks/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/hardware_xosc/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/hardware_divider/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/common/pico_time/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/hardware_timer/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/common/pico_sync/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/common/pico_util/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/pico_time_adapter/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/pico_runtime/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/pico_runtime_init/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/common/pico_bit_ops_headers/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/common/pico_divider_headers/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/pico_double/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/pico_float/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/pico_malloc/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/common/pico_binary_info/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/pico_printf/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/pico_stdio/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/pico_stdio_usb/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/pico_unique_id/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/hardware_flash/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/pico_bootrom/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/common/boot_picoboot_headers/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/hardware_boot_lock/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/common/pico_usb_reset_interface_headers/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/pico_int64_ops/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/pico_mem_ops/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2040/boot_stage2/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/common/boot_picobin_headers/include -isystem C:/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/pico_fix/rp2040_usb_device_enumeration/include -mcpu=cortex-m0plus -mthumb -g -O3 -DNDEBUG -std=gnu11 -ffunction-sections -fdata-sections -MD -MT CMakeFiles/ntpClock.dir/ntpClock.c.obj -MF CMakeFiles\ntpClock.dir\ntpClock.c.obj.d -o CMakeFiles/ntpClock.dir/ntpClock.c.obj -c D:/git/VSCode-Progamming/ntp_clock_v2/ntpClock/ntpClock.c D:/git/VSCode-Progamming/ntp_clockv2/ntpClock/ntpClock.c:8:10: fatal error: pico/multicore.h: No such file or directory 8 | #include "pico/multicore.h" | ^~~~~~ compilation terminated. [30/84] Building C object CMakeFiles/ntpClock.dir/C/Users/Andre/.pico-sdk/sdk/2.0.0/src/rp2_common/hardware_clocks/clocks.c.obj ninja: build stopped: subcommand failed.

Bizarrely taking the same approach with the multicore example does not show this error - but it fails further along (raised elsewhere)

It seems to be inconsistent in the way it generates the code between creating an empty project and using an example

Thoughts ?

Andrew

will-v-pi commented 1 week ago

Did you add the pico_multicore library in your CMakeLists.txt (like the example does)?

# Add pico_multicore which is required for multicore functionality
target_link_libraries(hello_multicore
        pico_stdlib
        pico_multicore)
Stubblet commented 1 week ago

Ouch - sometimes you just don't see the wood for the trees - noob mistake on my part.

Thanks for the quick response.