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

SDK • Hello World USB is not working on SDK 2.1.0

$
0
0
Hi, I am new to the Pico and was following the getting started guide. I got stuck on section 5.4 seeing the console output STDIO USB. The problem is that after I program the Pico there is absolutely nothing showing up in Windows device manager. It is as if I did not plug the board in. I then proceeded to program the Pico with a compiled file from https://rptl.io/pico-hello-usb . This worked; leading me to believe there is something wrong with my VS Code setup. When I used the "Switch SDK" to 2.0.0
sdk.jpg
the board was recognized by the device manager and a COM port was assigned and everything worked ok. I have compared the CMAKE file of both and other than version numbers they look the same. This problem is repeatable. Has anybody else experienced this with SDK 2.1.0?

Code:

#include <stdio.h>#include "pico/stdlib.h"int main(){    stdio_init_all();    while (true) {        printf("Hello, world!\n");        sleep_ms(1000);    }}

CMakeLists.txt

Code:

# Generated Cmake Pico project filecmake_minimum_required(VERSION 3.13)set(CMAKE_C_STANDARD 11)set(CMAKE_CXX_STANDARD 17)set(CMAKE_EXPORT_COMPILE_COMMANDS ON)# Initialise pico_sdk from installed location# (note this can come from environment, CMake cache etc)# == DO NOT EDIT THE FOLLOWING LINES for the Raspberry Pi Pico VS Code Extension to work ==if(WIN32)    set(USERHOME $ENV{USERPROFILE})else()    set(USERHOME $ENV{HOME})endif()set(sdkVersion 2.1.0)set(toolchainVersion 13_3_Rel1)set(picotoolVersion 2.1.0)set(picoVscode ${USERHOME}/.pico-sdk/cmake/pico-vscode.cmake)if (EXISTS ${picoVscode})    include(${picoVscode})endif()# ====================================================================================set(PICO_BOARD pico CACHE STRING "Board type")# Pull in Raspberry Pi Pico SDK (must be before project)include(pico_sdk_import.cmake)project(usbConsole C CXX ASM)# Initialise the Raspberry Pi Pico SDKpico_sdk_init()# Add executable. Default name is the project name, version 0.1add_executable(usbConsole usbConsole.cpp )pico_set_program_name(usbConsole "usbConsole")pico_set_program_version(usbConsole "0.1")# Modify the below lines to enable/disable output over UART/USBpico_enable_stdio_usb(usbConsole 1)pico_enable_stdio_uart(usbConsole 0)# Add the standard library to the buildtarget_link_libraries(usbConsole        pico_stdlib)# Add the standard include files to the buildtarget_include_directories(usbConsole PRIVATE  ${CMAKE_CURRENT_LIST_DIR})pico_add_extra_outputs(usbConsole)

Statistics: Posted by logixell — Wed Jan 22, 2025 7:15 pm — Replies 0 — Views 17



Viewing all articles
Browse latest Browse all 4660

Trending Articles