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

General • pico 2 not showing up as a COM port

$
0
0
Here is my code and cmake

Code:

#include <stdio.h>#include "pico/stdlib.h"int main() {        stdio_init_all();    const uint LED_PIN = 0;     gpio_init(LED_PIN);    gpio_set_dir(LED_PIN, GPIO_OUT);     bool b = true;    while(true)    {                gpio_put(LED_PIN, b);        b = !b;        printf("Hello, world!\n");        sleep_ms(1000);    }    return 0;}

Code:

cmake_minimum_required(VERSION 3.13)set(PICO_BOARD pico2)# pico_sdk_import.cmake is a single file copied from this SDK# note: this must happen before project()include($ENV{PICO_SDK_PATH}/external/pico_sdk_import.cmake)project(my_project)set(CMAKE_C_STANDARD 11)set(CMAKE_CXX_STANDARD 17)# initialize the Raspberry Pi Pico SDKpico_sdk_init()# rest of your projectadd_executable(hello_world    main.cpp)# Add pico_stdlib library which aggregates commonly used featurestarget_link_libraries(hello_world pico_stdlib)pico_enable_stdio_usb(hello_world 1)pico_enable_stdio_uart(hello_world 0)# create map/bin/hex/uf2 file in addition to ELF.pico_add_extra_outputs(hello_world)
it works, I can see the led blinking but there is nothing in serial monitor (only com1). I downloaded micropython uf2 from here and it works as a COM device after that.

I tried two different pico2s. I didn't have such problems with old pico 1s

What am I missing?

Is it because is it trying to use picotool? For some reason while building it is telling downloading picotool but I have nothing as such in my cmake

Statistics: Posted by shultays — Fri Jan 31, 2025 7:35 pm — Replies 3 — Views 78



Viewing all articles
Browse latest Browse all 4794

Trending Articles