Some progress with getting a USB device recognised.
As a work around I copied the working Blink project and edited the main.c and CMakeLists.txt to reflect the Hello World USB example.
( As noted above Cmake was failing to find nmake in some instances. I am not clear where the directive for finding nmake should be or if that is needed.) - hence the workaround by cloning.
Working 'Hello World' on PICO W
CMakeLists.txtmain.cThe USB device enumerates correctly in Windows and appears as a COM port however there is also an 'Other Device' this one is called 'Reset' and has the relevant HID and PID !!
Small steps but no I2C Scanner as yet.
Ted
As a work around I copied the working Blink project and edited the main.c and CMakeLists.txt to reflect the Hello World USB example.
( As noted above Cmake was failing to find nmake in some instances. I am not clear where the directive for finding nmake should be or if that is needed.) - hence the workaround by cloning.
Working 'Hello World' on PICO W
CMakeLists.txt
Code:
cmake_minimum_required(VERSION 3.12)set(PICO_BOARD pico_w)include(pico_sdk_import.cmake)project(hello_w C CXX ASM)pico_sdk_init()if (TARGET tinyusb_device) add_executable(hello_w main.c ) # pull in common dependencies target_link_libraries(hello_w pico_stdlib pico_cyw43_arch_none) # enable usb output, disable uart output pico_enable_stdio_usb(hello_w 1) pico_enable_stdio_uart(hello_w 0) # create map/bin/hex/uf2 file etc. pico_add_extra_outputs(hello_w) # add url via pico_set_program_url # example_auto_set_url(hello_w)elseif(PICO_ON_DEVICE) message(WARNING "not building hello_w because TinyUSB submodule is not initialized in the SDK")endif()
Code:
/** * Copyright (c) 2020 Raspberry Pi (Trading) Ltd. * * SPDX-License-Identifier: BSD-3-Clause */#include <stdio.h>#include "pico/stdlib.h"#include "pico/cyw43_arch.h"int main() { stdio_init_all(); while (true) { printf("Hello, world!\n"); sleep_ms(1000); }}
Small steps but no I2C Scanner as yet.
Ted
Statistics: Posted by tfcroft4 — Wed Jan 31, 2024 9:59 pm