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

SDK • Re: VS Code Pico Extension: Switching to RISC-V Architecture

$
0
0
I'm not sure why that wouldn't be working, compiling that project with the extension using your CMakeLists.txt works fine for me. Could you double check the ~/.pico-sdk/cmake/pico-vscode.cmake file does exist (the extension should create it when it installs CMake)? Also, make sure you're reloading the window after switching from Arm to Risc-V.
~/.pico-sdk/cmake/pico-vscode.cmake file does exist.

I cloned git@github.com:carlk3/no-OS-FatFS-SD-SDIO-SPI-RPi-Pico.git to a fresh directory and tried again, but it still fails.
It looks like the Pico SDK is picking up your system compiler instead of the one specified by the extension in CMakeLists.txt, but I'm not sure what could be causing that. You could try uninstalling your system arm-none-eabi-gcc and seeing if the extension picks the correct compiler without it?
I went to VS code "View"/"Command Palette" and did "Reset CMake Tools Extension State (for troubleshooting)" and got:
Screenshot from 2024-12-09 11-11-13.png
(I have previously done the [Scan for kits].) Is "Pico" the right choice? If I choose that, I get:

Code:

[proc] Executing command: /home/carlk/.pico-sdk/cmake/v3.29.9/bin/cmake --version[proc] Executing command: /home/carlk/.pico-sdk/cmake/v3.29.9/bin/cmake -E capabilities[kit] Successfully loaded 3 kits from /home/carlk/snap/code/176/.local/share/CMakeTools/cmake-tools-kits.json[kit] Successfully loaded 1 kits from /home/carlk/pi/pico/no-OS-FatFS-SD-SDIO-SPI-RPi-Pico/examples/command_line/.vscode/cmake-kits.json[variant] Loaded new set of variants[main] Configuring project: command_line [proc] Executing command: /home/carlk/.pico-sdk/cmake/v3.29.9/bin/cmake -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_C_COMPILER:FILEPATH=/home/carlk/.pico-sdk/toolchain/RISCV_RPI_2_0_0_5/bin/riscv32-unknown-elf-gcc -DCMAKE_CXX_COMPILER:FILEPATH=/home/carlk/.pico-sdk/toolchain/RISCV_RPI_2_0_0_5/bin/riscv32-unknown-elf-g++ -DPython3_EXECUTABLE:STRING=/bin/python3 --no-warn-unused-cli -S/home/carlk/pi/pico/no-OS-FatFS-SD-SDIO-SPI-RPi-Pico/examples/command_line -B/home/carlk/pi/pico/no-OS-FatFS-SD-SDIO-SPI-RPi-Pico/examples/command_line/build -G Ninja[cmake] PICO_SDK_PATH is /home/carlk/.pico-sdk/sdk/2.0.0[cmake] Not searching for unused variables given on the command line.[cmake] Target board (PICO_BOARD) is 'pico2'.[cmake] Using board configuration from /home/carlk/.pico-sdk/sdk/2.0.0/src/boards/include/boards/pico2.h[cmake] Pico Platform (PICO_PLATFORM) is 'rp2350-riscv'.[cmake] Defaulting compiler (PICO_COMPILER) to 'pico_riscv_gcc' since not specified.[cmake] Configuring toolchain based on PICO_COMPILER 'pico_riscv_gcc'[cmake] CMake Warning at /home/carlk/.pico-sdk/sdk/2.0.0/cmake/preload/toolchains/util/find_compiler.cmake:22 (message):[cmake]   PICO_TOOLCHAIN_PATH specified (/home/carlk/.pico-sdk/toolchain/13_2_Rel1),[cmake]   but not found there[cmake] Call Stack (most recent call first):[cmake]   /home/carlk/.pico-sdk/sdk/2.0.0/cmake/preload/toolchains/util/find_compiler.cmake:39 (pico_find_compiler)[cmake]   /home/carlk/.pico-sdk/sdk/2.0.0/cmake/preload/toolchains/util/pico_arm_gcc_common.cmake:25 (pico_find_compiler_with_triples)[cmake]   /home/carlk/.pico-sdk/sdk/2.0.0/cmake/preload/toolchains/pico_riscv_gcc.cmake:7 (include)[cmake]   /home/carlk/.pico-sdk/cmake/v3.29.9/share/cmake-3.29/Modules/CMakeDetermineSystem.cmake:146 (include)[cmake]   CMakeLists.txt:36 (project)[cmake] [cmake] [cmake] CMake Error at /home/carlk/.pico-sdk/sdk/2.0.0/cmake/preload/toolchains/util/find_compiler.cmake:29 (message):[cmake]   Compiler 'riscv32-unknown-elf-gcc / riscv32-corev-elf-gcc' not found, you[cmake]   can specify search path with "PICO_TOOLCHAIN_PATH".[cmake] Call Stack (most recent call first):[cmake]   /home/carlk/.pico-sdk/sdk/2.0.0/cmake/preload/toolchains/util/find_compiler.cmake:39 (pico_find_compiler)[cmake]   /home/carlk/.pico-sdk/sdk/2.0.0/cmake/preload/toolchains/util/pico_arm_gcc_common.cmake:25 (pico_find_compiler_with_triples)[cmake]   /home/carlk/.pico-sdk/sdk/2.0.0/cmake/preload/toolchains/pico_riscv_gcc.cmake:7 (include)[cmake]   /home/carlk/.pico-sdk/cmake/v3.29.9/share/cmake-3.29/Modules/CMakeDetermineSystem.cmake:146 (include)[cmake]   CMakeLists.txt:36 (project)[cmake] [cmake] [cmake] CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.[cmake] CMake Error: CMAKE_ASM_COMPILER not set, after EnableLanguage[cmake] -- Configuring incomplete, errors occurred![proc] The command: /home/carlk/.pico-sdk/cmake/v3.29.9/bin/cmake -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_C_COMPILER:FILEPATH=/home/carlk/.pico-sdk/toolchain/RISCV_RPI_2_0_0_5/bin/riscv32-unknown-elf-gcc -DCMAKE_CXX_COMPILER:FILEPATH=/home/carlk/.pico-sdk/toolchain/RISCV_RPI_2_0_0_5/bin/riscv32-unknown-elf-g++ -DPython3_EXECUTABLE:STRING=/bin/python3 --no-warn-unused-cli -S/home/carlk/pi/pico/no-OS-FatFS-SD-SDIO-SPI-RPi-Pico/examples/command_line -B/home/carlk/pi/pico/no-OS-FatFS-SD-SDIO-SPI-RPi-Pico/examples/command_line/build -G Ninja exited with code: 1[proc] The command: riscv32-unknown-elf-gcc -v failed with error: Error: spawn riscv32-unknown-elf-gcc ENOENT[proc] The command: riscv32-unknown-elf-g++ -v failed with error: Error: spawn riscv32-unknown-elf-g++ ENOENT[main] Configuring project: command_line [proc] Executing command: /home/carlk/.pico-sdk/cmake/v3.29.9/bin/cmake -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_C_COMPILER:FILEPATH=/home/carlk/.pico-sdk/toolchain/RISCV_RPI_2_0_0_5/bin/riscv32-unknown-elf-gcc -DCMAKE_CXX_COMPILER:FILEPATH=/home/carlk/.pico-sdk/toolchain/RISCV_RPI_2_0_0_5/bin/riscv32-unknown-elf-g++ -DPython3_EXECUTABLE:STRING=/bin/python3 --no-warn-unused-cli -S/home/carlk/pi/pico/no-OS-FatFS-SD-SDIO-SPI-RPi-Pico/examples/command_line -B/home/carlk/pi/pico/no-OS-FatFS-SD-SDIO-SPI-RPi-Pico/examples/command_line/build -G Ninja[cmake] PICO_SDK_PATH is /home/carlk/.pico-sdk/sdk/2.0.0[cmake] Target board (PICO_BOARD) is 'pico2'.[cmake] Using board configuration from /home/carlk/.pico-sdk/sdk/2.0.0/src/boards/include/boards/pico2.h[cmake] Pico Platform (PICO_PLATFORM) is 'rp2350-riscv'.[cmake] Defaulting compiler (PICO_COMPILER) to 'pico_riscv_gcc' since not specified.[cmake] Configuring toolchain based on PICO_COMPILER 'pico_riscv_gcc'[cmake] Not searching for unused variables given on the command line.[cmake] CMake Warning at /home/carlk/.pico-sdk/sdk/2.0.0/cmake/preload/toolchains/util/find_compiler.cmake:22 (message):[cmake]   PICO_TOOLCHAIN_PATH specified (/home/carlk/.pico-sdk/toolchain/13_2_Rel1),[cmake]   but not found there[cmake] Call Stack (most recent call first):[cmake]   /home/carlk/.pico-sdk/sdk/2.0.0/cmake/preload/toolchains/util/find_compiler.cmake:39 (pico_find_compiler)[cmake]   /home/carlk/.pico-sdk/sdk/2.0.0/cmake/preload/toolchains/util/pico_arm_gcc_common.cmake:25 (pico_find_compiler_with_triples)[cmake]   /home/carlk/.pico-sdk/sdk/2.0.0/cmake/preload/toolchains/pico_riscv_gcc.cmake:7 (include)[cmake]   /home/carlk/.pico-sdk/cmake/v3.29.9/share/cmake-3.29/Modules/CMakeDetermineSystem.cmake:146 (include)[cmake]   CMakeLists.txt:36 (project)[cmake] [cmake] [cmake] CMake Error at /home/carlk/.pico-sdk/sdk/2.0.0/cmake/preload/toolchains/util/find_compiler.cmake:29 (message):[cmake]   Compiler 'riscv32-unknown-elf-gcc / riscv32-corev-elf-gcc' not found, you[cmake]   can specify search path with "PICO_TOOLCHAIN_PATH".[cmake] Call Stack (most recent call first):[cmake]   /home/carlk/.pico-sdk/sdk/2.0.0/cmake/preload/toolchains/util/find_compiler.cmake:39 (pico_find_compiler)[cmake]   /home/carlk/.pico-sdk/sdk/2.0.0/cmake/preload/toolchains/util/pico_arm_gcc_common.cmake:25 (pico_find_compiler_with_triples)[cmake]   /home/carlk/.pico-sdk/sdk/2.0.0/cmake/preload/toolchains/pico_riscv_gcc.cmake:7 (include)[cmake]   /home/carlk/.pico-sdk/cmake/v3.29.9/share/cmake-3.29/Modules/CMakeDetermineSystem.cmake:146 (include)[cmake]   CMakeLists.txt:36 (project)[cmake] [cmake] [cmake] CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.[cmake] CMake Error: CMAKE_ASM_COMPILER not set, after EnableLanguage[cmake] -- Configuring incomplete, errors occurred![proc] The command: /home/carlk/.pico-sdk/cmake/v3.29.9/bin/cmake -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_C_COMPILER:FILEPATH=/home/carlk/.pico-sdk/toolchain/RISCV_RPI_2_0_0_5/bin/riscv32-unknown-elf-gcc -DCMAKE_CXX_COMPILER:FILEPATH=/home/carlk/.pico-sdk/toolchain/RISCV_RPI_2_0_0_5/bin/riscv32-unknown-elf-g++ -DPython3_EXECUTABLE:STRING=/bin/python3 --no-warn-unused-cli -S/home/carlk/pi/pico/no-OS-FatFS-SD-SDIO-SPI-RPi-Pico/examples/command_line -B/home/carlk/pi/pico/no-OS-FatFS-SD-SDIO-SPI-RPi-Pico/examples/command_line/build -G Ninja exited with code: 1[proc] The command: riscv32-unknown-elf-gcc -v failed with error: Error: spawn riscv32-unknown-elf-gcc ENOENT[proc] The command: riscv32-unknown-elf-g++ -v failed with error: Error: spawn riscv32-unknown-elf-g++ ENOENT
Is one of those what you're referring to as the "system arm-none-eabi-gcc"?
settings.zip

pico-vscode.zip

Statistics: Posted by carlk3 — Mon Dec 09, 2024 6:28 pm



Viewing all articles
Browse latest Browse all 4988

Trending Articles