Skip to content

picotool built by SDK has no USB capability #1827

@ali1234

Description

@ali1234

To reproduce put the following files in a directory next to the pico-sdk:

CMakeLists.txt: (Note the custom target which runs picotool.)

cmake_minimum_required(VERSION 3.16)

include(../pico-sdk/pico_sdk_init.cmake)

project(testola)

pico_sdk_init()

add_executable(testola main.cpp)

# Link with the pico stdlib
target_link_libraries(testola pico_stdlib)

# Create map/bin/hex/uf2 files
pico_add_extra_outputs(testola)

add_custom_target (flash picotool load -f ${PROJECT_NAME}.uf2 && picotool reboot DEPENDS ${PROJECT_NAME})

main.cpp:

int main() {;}

Run: mkdir build && cd build && cmake .. && make && make flash

Expected result:
The built uf2 is loaded to the connected pico over USB.

Actual result:

ERROR: Unknown command: load

COMMANDS:
    info        Display information from the target device(s) or file.
                Without any arguments, this will display basic information for all connected RP2040 devices in BOOTSEL mode
    config      Display or change program configuration settings from the target device(s) or file.
    encrypt     Encrypt the program.
    seal        Add final metadata to a binary, optionally including a hash and/or signature.
    link        Link multiple binaries into one block loop.
    otp         Commands related to the RP2350 OTP (One-Time-Programmable) Memory
    partition   Commands related to RP2350 Partition Tables
    uf2         Commands related to UF2 creation and status
    version     Display picotool version
    coprodis    Post-process coprocessor instructions in disassembly files.
    help        Show general help or help for a specific command

Use "picotool help <cmd>" for more info

This happens because the picotool build could not find libusb, even though I have libusb-1.0-0-dev and pkg-config installed (on Linux):

[11/108] Performing configure step for 'picotoolBuild'
Not searching for unused variables given on the command line.
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
.//home/al/Source/Pico/testola/cmake-build-debug/_deps/picotool/
-- Using the single-header code from /home/al/Source/Pico/testola/cmake-build-debug/_deps/picotool-src/lib/nlohmann_json/single_include/
CMake Deprecation Warning at /home/al/Source/Pico/pico-sdk/lib/mbedtls/CMakeLists.txt:23 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Found Python3: /usr/bin/python3.12 (found version "3.12.3") found components: Interpreter
-- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS
-- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS - Success
libUSB is not found - no USB support will be built
-- Configuring done (1.6s)
-- Generating done (0.1s)
-- Build files have been written to: /home/al/Source/Pico/testola/cmake-build-debug/_deps/picotool-build

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions