Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools: Switch from elf2uf2 to modern picotool #21269

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

AnnsAnns
Copy link
Contributor

@AnnsAnns AnnsAnns commented Mar 5, 2025

Contribution description

The Pi Pico 2 requires a more modern version of elf2uf2 called picotool, in a first effort to get the Raspberry Pi Pico 2 to be compatible with Riot I thus needed to update it.

While this PR is intended to allow me to work on the Pi Pico 2, picotool also offers advantages for the Pico 1 such as easier device detection, loading/flashing and the ability to easily verify the integrity of a file after loading it onto the device. I have incorporated these advantages into the existing workflow so hopefully the flashing process should have become easier for everyone 😄

Testing procedure

I verified it working with examples using the pi pico 1, the expected outcome is that the user should not experience any differences while flashing (aside from the tool being different)

Issues/PRs references

@AnnsAnns AnnsAnns requested review from aabadie and jia200x as code owners March 5, 2025 14:14
@github-actions github-actions bot added Area: doc Area: Documentation Area: build system Area: Build system Area: tools Area: Supplementary tools Area: boards Area: Board ports Area: cpu Area: CPU/MCU ports labels Mar 5, 2025
@AnnsAnns AnnsAnns changed the title Picotool DRAFT: Tools: Switch from elf2uf2 to modern picotool Mar 5, 2025
@AnnsAnns AnnsAnns marked this pull request as draft March 5, 2025 14:20
picotool: start elf2uf2 migration

picotool: Replace elf2uf2 usage with picotool

picotool: Fix incorrect filename for flash utility

picotool: fix compilation when arm g++ is installed

picotool: picotool-ify flash process

picotool: Adjust documentation to new workflow
@AnnsAnns
Copy link
Contributor Author

AnnsAnns commented Mar 6, 2025

I have tested this working properly on a Pi Pico 1 now. I am not too confident in my understanding of the RIOT packages makefile system so I am happy to hear feedback 😄

@AnnsAnns AnnsAnns marked this pull request as ready for review March 6, 2025 11:11
@crasbe
Copy link
Contributor

crasbe commented Mar 6, 2025

Wouldn't it be easier to use the precompiled binaries of picotool instead of compiling it on demand: https://github.com/raspberrypi/pico-sdk-tools/releases ?

@AnnsAnns
Copy link
Contributor Author

AnnsAnns commented Mar 6, 2025

Given the way elf2uf2 worked and looking into other packages + the documentation I would have assumed that the preference is to avoid binaries when possible

@AnnsAnns AnnsAnns changed the title DRAFT: Tools: Switch from elf2uf2 to modern picotool Tools: Switch from elf2uf2 to modern picotool Mar 6, 2025
@crasbe
Copy link
Contributor

crasbe commented Mar 13, 2025

I gave this a try now and unfortunately there seems to be an issue with the CMake configuration of the picotool that others have run into as well: https://www.reddit.com/r/embedded/comments/1els7zl/armnoneeabig_not_working/

Build log:
RIOT/tests/sys/shell$ BOARD=rpi-pico make flash -j12
Building application "tests_shell" for "rpi-pico" with CPU "rpx0xx".

[INFO] picotool not found - fetching it from GitHub now
CC= CFLAGS= make -C /home/chris/riot-picotool/RIOT/dist/tools/picotool
make -C /home/chris/riot-picotool/RIOT/dist/tools//picosdk
echo "[INFO] compiling picotool from source now"
[INFO] compiling picotool from source now
cd /home/chris/riot-picotool/RIOT/dist/tools/picotool/source && cmake -B build -S . -DPICO_SDK_PATH=../../../picosdk/picosdk -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
"make" -C /home/chris/riot-picotool/RIOT/pkg/cmsis/ 
...
"make" -C /home/chris/riot-picotool/RIOT/sys/ztimer
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - 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/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
.//usr/local/share/picotool/
   text	   data	    bss	    dec	    hex	filename
  19088	    168	  18892	  38148	   9504	/home/chris/riot-picotool/RIOT/tests/sys/shell/bin/rpi-pico/tests_shell.elf
-- Using the single-header code from /home/chris/riot-picotool/RIOT/dist/tools/picotool/source/lib/nlohmann_json/single_include/
lib/mbedtls submodule needs to be initialized for bintool hashing/signing
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") 
-- Checking for module 'libusb-1.0'
--   No package 'libusb-1.0' found
-- Could NOT find LIBUSB (missing: LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR) 
mbedtls not found - no signing/hashing support will be built
libUSB is not found - no USB support will be built
-- Configuring done
-- Generating done
-- Build files have been written to: /home/chris/riot-picotool/RIOT/dist/tools/picotool/source/build
cd /home/chris/riot-picotool/RIOT/dist/tools/picotool/source/build && make
[  6%] Creating directories for 'flash_id'
[  6%] Creating directories for 'xip_ram_perms'
[  6%] Creating directories for 'otp_header_parser'
[  9%] Building CXX object errors/CMakeFiles/errors.dir/errors.cpp.o
[ 13%] No download step for 'flash_id'
[ 13%] No download step for 'xip_ram_perms'
[ 15%] No download step for 'otp_header_parser'
[ 18%] No update step for 'xip_ram_perms'
[ 20%] No update step for 'flash_id'
[ 22%] No update step for 'otp_header_parser'
[ 25%] No patch step for 'flash_id'
[ 27%] No patch step for 'xip_ram_perms'
[ 29%] No patch step for 'otp_header_parser'
[ 31%] Performing configure step for 'flash_id'
[ 34%] Performing configure step for 'xip_ram_perms'
[ 36%] Performing configure step for 'otp_header_parser'
-- The C compiler identification is GNU 11.4.0
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 10.3.1
-- Detecting CXX compiler ABI info
-- The CXX compiler identification is GNU 10.3.1
-- The CXX compiler identification is GNU 10.3.1
-- The ASM compiler identification is GNU
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- Found assembler: /usr/bin/cc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /usr/bin/arm-none-eabi-g++
[ 38%] Linking CXX static library liberrors.a
-- Detecting C compiler ABI info - done
-- Detecting C compiler ABI info - done
[ 38%] Built target errors
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - 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
[ 40%] Building CXX object elf/CMakeFiles/elf.dir/elf_file.cpp.o
-- Check for working CXX compiler: /usr/bin/arm-none-eabi-g++ - broken
CMake Error at /usr/share/cmake-3.25/Modules/CMakeTestCXXCompiler.cmake:63 (message):
  The C++ compiler

    "/usr/bin/arm-none-eabi-g++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/chris/riot-picotool/RIOT/dist/tools/picotool/source/build/otp_header_parser/CMakeFiles/CMakeScratch/TryCompile-cy51sh
    
    Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_94d75/fast && gmake[5]: Verzeichnis „/home/chris/riot-picotool/RIOT/dist/tools/picotool/source/build/otp_header_parser/CMakeFiles/CMakeScratch/TryCompile-cy51sh“ wird betreten
    /usr/bin/gmake  -f CMakeFiles/cmTC_94d75.dir/build.make CMakeFiles/cmTC_94d75.dir/build
    gmake[6]: Verzeichnis „/home/chris/riot-picotool/RIOT/dist/tools/picotool/source/build/otp_header_parser/CMakeFiles/CMakeScratch/TryCompile-cy51sh“ wird betreten
    Building CXX object CMakeFiles/cmTC_94d75.dir/testCXXCompiler.cxx.o
    /usr/bin/arm-none-eabi-g++    -o CMakeFiles/cmTC_94d75.dir/testCXXCompiler.cxx.o -c /home/chris/riot-picotool/RIOT/dist/tools/picotool/source/build/otp_header_parser/CMakeFiles/CMakeScratch/TryCompile-cy51sh/testCXXCompiler.cxx
    Linking CXX executable cmTC_94d75
    /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_94d75.dir/link.txt --verbose=1
    /usr/bin/arm-none-eabi-g++ CMakeFiles/cmTC_94d75.dir/testCXXCompiler.cxx.o -o cmTC_94d75 
    /usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/lib/libc.a(lib_a-exit.o): in function `exit':
    /build/newlib-pB30de/newlib-3.3.0/build/arm-none-eabi/newlib/libc/stdlib/../../../../../newlib/libc/stdlib/exit.c:64: undefined reference to `_exit'
    collect2: error: ld returned 1 exit status
    gmake[6]: *** [CMakeFiles/cmTC_94d75.dir/build.make:99: cmTC_94d75] Fehler 1
    gmake[6]: Verzeichnis „/home/chris/riot-picotool/RIOT/dist/tools/picotool/source/build/otp_header_parser/CMakeFiles/CMakeScratch/TryCompile-cy51sh“ wird verlassen
    gmake[5]: *** [Makefile:127: cmTC_94d75/fast] Fehler 2
    gmake[5]: Verzeichnis „/home/chris/riot-picotool/RIOT/dist/tools/picotool/source/build/otp_header_parser/CMakeFiles/CMakeScratch/TryCompile-cy51sh“ wird verlassen
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (PROJECT)


-- Configuring incomplete, errors occurred!
See also "/home/chris/riot-picotool/RIOT/dist/tools/picotool/source/build/otp_header_parser/CMakeFiles/CMakeOutput.log".
See also "/home/chris/riot-picotool/RIOT/dist/tools/picotool/source/build/otp_header_parser/CMakeFiles/CMakeError.log".
make[4]: *** [CMakeFiles/otp_header_parser.dir/build.make:91: otp_header_parser/src/otp_header_parser-stamp/otp_header_parser-configure] Fehler 1
make[3]: *** [CMakeFiles/Makefile2:407: CMakeFiles/otp_header_parser.dir/all] Fehler 2
make[3]: *** Auf noch nicht beendete Prozesse wird gewartet …
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /usr/bin/arm-none-eabi-g++
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /usr/bin/arm-none-eabi-g++
-- Check for working CXX compiler: /usr/bin/arm-none-eabi-g++ - broken
-- Check for working CXX compiler: /usr/bin/arm-none-eabi-g++ - broken
CMake Error at /usr/share/cmake-3.25/Modules/CMakeTestCXXCompiler.cmake:63 (message):
  The C++ compiler

    "/usr/bin/arm-none-eabi-g++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/chris/riot-picotool/RIOT/dist/tools/picotool/source/build/picoboot_flash_id/CMakeFiles/CMakeScratch/TryCompile-1pU4Xt
    
    Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_c35a8/fast && gmake[5]: Verzeichnis „/home/chris/riot-picotool/RIOT/dist/tools/picotool/source/build/picoboot_flash_id/CMakeFiles/CMakeScratch/TryCompile-1pU4Xt“ wird betreten
    /usr/bin/gmake  -f CMakeFiles/cmTC_c35a8.dir/build.make CMakeFiles/cmTC_c35a8.dir/build
    gmake[6]: Verzeichnis „/home/chris/riot-picotool/RIOT/dist/tools/picotool/source/build/picoboot_flash_id/CMakeFiles/CMakeScratch/TryCompile-1pU4Xt“ wird betreten
    Building CXX object CMakeFiles/cmTC_c35a8.dir/testCXXCompiler.cxx.o
    /usr/bin/arm-none-eabi-g++    -o CMakeFiles/cmTC_c35a8.dir/testCXXCompiler.cxx.o -c /home/chris/riot-picotool/RIOT/dist/tools/picotool/source/build/picoboot_flash_id/CMakeFiles/CMakeScratch/TryCompile-1pU4Xt/testCXXCompiler.cxx
    Linking CXX executable cmTC_c35a8
    /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_c35a8.dir/link.txt --verbose=1
    /usr/bin/arm-none-eabi-g++ CMakeFiles/cmTC_c35a8.dir/testCXXCompiler.cxx.o -o cmTC_c35a8 
    /usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/lib/libc.a(lib_a-exit.o): in function `exit':
    /build/newlib-pB30de/newlib-3.3.0/build/arm-none-eabi/newlib/libc/stdlib/../../../../../newlib/libc/stdlib/exit.c:64: undefined reference to `_exit'
    collect2: error: ld returned 1 exit status
    gmake[6]: *** [CMakeFiles/cmTC_c35a8.dir/build.make:99: cmTC_c35a8] Fehler 1
    gmake[6]: Verzeichnis „/home/chris/riot-picotool/RIOT/dist/tools/picotool/source/build/picoboot_flash_id/CMakeFiles/CMakeScratch/TryCompile-1pU4Xt“ wird verlassen
    gmake[5]: *** [Makefile:127: cmTC_c35a8/fast] Fehler 2
    gmake[5]: Verzeichnis „/home/chris/riot-picotool/RIOT/dist/tools/picotool/source/build/picoboot_flash_id/CMakeFiles/CMakeScratch/TryCompile-1pU4Xt“ wird verlassen
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:29 (project)


CMake Error at /usr/share/cmake-3.25/Modules/CMakeTestCXXCompiler.cmake:63 (message):
  The C++ compiler

    "/usr/bin/arm-none-eabi-g++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/chris/riot-picotool/RIOT/dist/tools/picotool/source/build/xip_ram_perms/CMakeFiles/CMakeScratch/TryCompile-dXt7hb
    
    Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_c4460/fast && gmake[5]: Verzeichnis „/home/chris/riot-picotool/RIOT/dist/tools/picotool/source/build/xip_ram_perms/CMakeFiles/CMakeScratch/TryCompile-dXt7hb“ wird betreten
    /usr/bin/gmake  -f CMakeFiles/cmTC_c4460.dir/build.make CMakeFiles/cmTC_c4460.dir/build
    gmake[6]: Verzeichnis „/home/chris/riot-picotool/RIOT/dist/tools/picotool/source/build/xip_ram_perms/CMakeFiles/CMakeScratch/TryCompile-dXt7hb“ wird betreten
    Building CXX object CMakeFiles/cmTC_c4460.dir/testCXXCompiler.cxx.o
    /usr/bin/arm-none-eabi-g++    -o CMakeFiles/cmTC_c4460.dir/testCXXCompiler.cxx.o -c /home/chris/riot-picotool/RIOT/dist/tools/picotool/source/build/xip_ram_perms/CMakeFiles/CMakeScratch/TryCompile-dXt7hb/testCXXCompiler.cxx
    Linking CXX executable cmTC_c4460
    /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_c4460.dir/link.txt --verbose=1
    /usr/bin/arm-none-eabi-g++ CMakeFiles/cmTC_c4460.dir/testCXXCompiler.cxx.o -o cmTC_c4460 
    /usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/lib/libc.a(lib_a-exit.o): in function `exit':
    /build/newlib-pB30de/newlib-3.3.0/build/arm-none-eabi/newlib/libc/stdlib/../../../../../newlib/libc/stdlib/exit.c:64: undefined reference to `_exit'
    collect2: error: ld returned 1 exit status
    gmake[6]: *** [CMakeFiles/cmTC_c4460.dir/build.make:99: cmTC_c4460] Fehler 1
    gmake[6]: Verzeichnis „/home/chris/riot-picotool/RIOT/dist/tools/picotool/source/build/xip_ram_perms/CMakeFiles/CMakeScratch/TryCompile-dXt7hb“ wird verlassen
    gmake[5]: *** [Makefile:127: cmTC_c4460/fast] Fehler 2
    gmake[5]: Verzeichnis „/home/chris/riot-picotool/RIOT/dist/tools/picotool/source/build/xip_ram_perms/CMakeFiles/CMakeScratch/TryCompile-dXt7hb“ wird verlassen
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:46 (project)


-- Configuring incomplete, errors occurred!
See also "/home/chris/riot-picotool/RIOT/dist/tools/picotool/source/build/picoboot_flash_id/CMakeFiles/CMakeOutput.log".
See also "/home/chris/riot-picotool/RIOT/dist/tools/picotool/source/build/picoboot_flash_id/CMakeFiles/CMakeError.log".
-- Configuring incomplete, errors occurred!
See also "/home/chris/riot-picotool/RIOT/dist/tools/picotool/source/build/xip_ram_perms/CMakeFiles/CMakeOutput.log".
See also "/home/chris/riot-picotool/RIOT/dist/tools/picotool/source/build/xip_ram_perms/CMakeFiles/CMakeError.log".
make[4]: *** [CMakeFiles/flash_id.dir/build.make:91: picoboot_flash_id/src/flash_id-stamp/flash_id-configure] Fehler 1
make[3]: *** [CMakeFiles/Makefile2:381: CMakeFiles/flash_id.dir/all] Fehler 2
make[4]: *** [CMakeFiles/xip_ram_perms.dir/build.make:91: xip_ram_perms/src/xip_ram_perms-stamp/xip_ram_perms-configure] Fehler 1
make[3]: *** [CMakeFiles/Makefile2:355: CMakeFiles/xip_ram_perms.dir/all] Fehler 2
[ 43%] Linking CXX static library libelf.a
[ 43%] Built target elf
make[2]: *** [Makefile:136: all] Fehler 2
make[1]: *** [Makefile:27: /home/chris/riot-picotool/RIOT/dist/tools/picotool/picotool] Fehler 2
make: *** [/home/chris/riot-picotool/RIOT/makefiles/tools/targets.inc.mk:71: /home/chris/riot-picotool/RIOT/dist/tools/picotool/picotool] Fehler 2

This seems to be an issue with MBedTLS using the wrong compiler, but I couldn't really pinpoint the issue and how to solve it.

I wondered if it would be possible to check for libusb-1.0-0-dev in the Makefile of the RIOT package, because picotool will still build without it installed, but none of the USB features will work. That might cause some weird issues.

@AnnsAnns
Copy link
Contributor Author

I can confirm that this also happened for me but after tinkering a bit with the Makefile it didn't happen again, I'll investigate if I can reproduce it again, thank you for testing it, I thought this was a local one-off issue

@crasbe
Copy link
Contributor

crasbe commented Mar 13, 2025

Furthermore it would be good to add @ in front of many commands so that the makefile does not print the command.

For example:

- echo "[INFO] compiling picotool from source now"
+ @echo "[INFO] compiling picotool from source now"

@AnnsAnns
Copy link
Contributor Author

Thank you for the review, I will adjust the PR based on your suggestions as soon as I can

@crasbe crasbe added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Mar 27, 2025
@AnnsAnns
Copy link
Contributor Author

Was able to verify it flashing and building for the raspberry pi pico 2

@riot-ci
Copy link

riot-ci commented Mar 27, 2025

Murdock results

✔️ PASSED

9dc39be fix: proper clean syntax

Success Failures Total Runtime
10287 0 10287 10m:31s

Artifacts

@crasbe
Copy link
Contributor

crasbe commented Mar 27, 2025

The patch for the CMakeLists.txt does not appear to work, the LibUSB error message is not shown and the build is not aborted.
I'll have to look into it why it doesn't work.

The red warning message is also not shown because of the indentations in the picotool.sh (the static test also complains about it).

chris@ThinkPias:~/RIOTstuff/riot-picotool/RIOT$ BOARD=rpi-pico make -C tests/sys/shell flash
make: Verzeichnis „/home/chris/RIOTstuff/riot-picotool/RIOT/tests/sys/shell“ wird betreten
Building application "tests_shell" for "rpi-pico" with CPU "rpx0xx".

"make" -C /home/chris/RIOTstuff/riot-picotool/RIOT/pkg/cmsis/ 
...
"make" -C /home/chris/RIOTstuff/riot-picotool/RIOT/sys/ztimer
   text	   data	    bss	    dec	    hex	filename
  19084	    168	  18892	  38144	   9500	/home/chris/RIOTstuff/riot-picotool/RIOT/tests/sys/shell/bin/rpi-pico/tests_shell.elf
[INFO] picotool not found - fetching it from GitHub now
CC= CFLAGS= make -C /home/chris/RIOTstuff/riot-picotool/RIOT/dist/tools/picotool
make -C /home/chris/RIOTstuff/riot-picotool/RIOT/dist/tools/picosdk
[INFO] compiling picotool from source now
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - 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/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
.//usr/local/share/picotool/
-- Using the single-header code from /home/chris/RIOTstuff/riot-picotool/RIOT/dist/tools/picotool/source/lib/nlohmann_json/single_include/
-- Found Python3: /usr/bin/python3.10 (found version "3.10.12") found components: Interpreter 
-- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS
-- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS - Success
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) 
-- Could NOT find LIBUSB (missing: LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR) 
libUSB is not found - no USB support will be built
-- Configuring done
-- Generating done
-- Build files have been written to: /home/chris/RIOTstuff/riot-picotool/RIOT/dist/tools/picotool/source/build
...
[100%] Built target picotool
[INFO] picotool successfully fetched!
/home/chris/RIOTstuff/riot-picotool/RIOT/dist/tools/picotool/picotool.sh /home/chris/RIOTstuff/riot-picotool/RIOT/tests/sys/shell/bin/rpi-pico/tests_shell.elf
/home/chris/RIOTstuff/riot-picotool/RIOT/dist/tools/picotool/picotool.sh: 9: run picotool without sudo. See: : not found

[INFO] Converting /home/chris/RIOTstuff/riot-picotool/RIOT/tests/sys/shell/bin/rpi-pico/tests_shell.elf to /home/chris/RIOTstuff/riot-picotool/RIOT/tests/sys/shell/bin/rpi-pico/tests_shell.uf2
[INFO] Loading /home/chris/RIOTstuff/riot-picotool/RIOT/tests/sys/shell/bin/rpi-pico/tests_shell.uf2 onto Pico

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
                RP-series 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
[INFO] Verifying /home/chris/RIOTstuff/riot-picotool/RIOT/tests/sys/shell/bin/rpi-pico/tests_shell.uf2 on Pico

ERROR: Unknown command: verify

COMMANDS:
    info        Display information from the target device(s) or file.
                Without any arguments, this will display basic information for all connected
                RP-series 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
make: *** [/home/chris/RIOTstuff/riot-picotool/RIOT/tests/sys/shell/../../../Makefile.include:846: flash] Fehler 255
make: Verzeichnis „/home/chris/RIOTstuff/riot-picotool/RIOT/tests/sys/shell“ wird verlassen

@AnnsAnns
Copy link
Contributor Author

Tested, is able to flash to rpi pico 1 and 2

Copy link
Contributor

@crasbe crasbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the last change requests, I promise! 😅

@AnnsAnns
Copy link
Contributor Author

Thank you for your thorough review 😄

Copy link
Contributor

@crasbe crasbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to break my promise 😭

@AnnsAnns
Copy link
Contributor Author

Thanks, the double colons makefile syntax definitely feels absolutely wrong, the more I learn about Makefiles the less I understand Makefiles 😆

all: $(CURDIR)/picotool

clean::
rm picotool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
rm picotool
rm picotool

Speaking of Makefile oddities, this has to be a tabulator, spaces don't work.

Copy link
Contributor

@crasbe crasbe Mar 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
rm picotool
rm -f picotool

It would be also good to add the -f option again so that rm won't complain if there is no picotool binary.

I wanted to be "more gentle" with the rm, but that was wrong apparently. Sorry for the wrong suggestion (again).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports Area: build system Area: Build system Area: cpu Area: CPU/MCU ports Area: doc Area: Documentation Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants