XIAO RP2350 pico-hsm-tool.py initialize failed #113

Closed
opened 2025-12-03 05:50:04 +08:00 by RyanX8 · 3 comments

First of all a amazing Project the Pico Keys. Thank you for putting so much work into this. I downloaded the file from the website and transferred it to the RP2350 as usual. Unfortunately, I am experiencing an issue where I am unable to initialize the Pico HSM with the pico-hsm-tool.py script.

I use:
Python 3.13.7
pico_hsm_seeed_xiao_rp2350-5.6-eddsa1.uf2
Seeed Studio XIAO RP2350

Installed in Venv:
pip install pycvc (Version 1.5.0)
pip install pypicohsm (Version 2.0.2)

python3 tools/pico-hsm-tool.py --pin 648219 initialize --so-pin 57621880
Pico HSM Tool v2.4
Author: Pol Henarejos
Report bugs to https://github.com/polhenarejos/pico-hsm/issues


Traceback (most recent call last):
  File "/home/user/Desktop/pico-hsm/tools/pico-hsm-tool.py", line 591, in <module>
    run()
    ~~~^^
  File "/home/user/Desktop/pico-hsm/tools/pico-hsm-tool.py", line 588, in run
    main(args)
    ~~~~^^^^^^
  File "/home/user/Desktop/pico-hsm/tools/pico-hsm-tool.py", line 556, in main
    picohsm = PicoHSM(args.pin, slot=args.slot)
  File "/home/user/Desktop/pico-hsm_venv/lib/python3.13/site-packages/picohsm/PicoHSM.py", line 86, in __init__
    self.select_applet()
    ~~~~~~~~~~~~~~~~~~^^
  File "/home/user/Desktop/pico-hsm_venv/lib/python3.13/site-packages/picohsm/PicoHSM.py", line 95, in select_applet
    return self.__card.select_applet(rescue=rescue)
           ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
TypeError: PicoKey.select_applet() got an unexpected keyword argument 'rescue'

But I think I can find the Pico Key:

opensc-tool -an
Using reader with a card: Yubico YubiKey OTP+FIDO+CCID [PicoFIDO HID Interface] (F7DE2D71F5986D60) 00 00
3b:fe:19:00:00:89:32:fe:45:80:31:81:54:48:53:4d:41:63:90:11:30:81:02:fa
SmartCard-HSM version 5.6

Another two Question:

  • I cannot set the LED GPIO, or rather, it does not work. In Commisioner, I cannot find the Pico HSM via WebUSB (Chrome on Linux&MacOS) at all, and when I use one as a Pico FIDO, setting the GPIO to 22, which is the correct pin according to the diagram I found, does not work ?
  • I want to generate an AES key but don't quite understand how to get libsc-hsm-pkcs11.so ?
First of all a amazing Project the Pico Keys. Thank you for putting so much work into this. I downloaded the file from the website and transferred it to the RP2350 as usual. Unfortunately, I am experiencing an issue where I am unable to initialize the Pico HSM with the pico-hsm-tool.py script. I use: Python 3.13.7 pico_hsm_seeed_xiao_rp2350-5.6-eddsa1.uf2 Seeed Studio XIAO RP2350 Installed in Venv: pip install pycvc (Version 1.5.0) pip install pypicohsm (Version 2.0.2) ``` python3 tools/pico-hsm-tool.py --pin 648219 initialize --so-pin 57621880 Pico HSM Tool v2.4 Author: Pol Henarejos Report bugs to https://github.com/polhenarejos/pico-hsm/issues Traceback (most recent call last): File "/home/user/Desktop/pico-hsm/tools/pico-hsm-tool.py", line 591, in <module> run() ~~~^^ File "/home/user/Desktop/pico-hsm/tools/pico-hsm-tool.py", line 588, in run main(args) ~~~~^^^^^^ File "/home/user/Desktop/pico-hsm/tools/pico-hsm-tool.py", line 556, in main picohsm = PicoHSM(args.pin, slot=args.slot) File "/home/user/Desktop/pico-hsm_venv/lib/python3.13/site-packages/picohsm/PicoHSM.py", line 86, in __init__ self.select_applet() ~~~~~~~~~~~~~~~~~~^^ File "/home/user/Desktop/pico-hsm_venv/lib/python3.13/site-packages/picohsm/PicoHSM.py", line 95, in select_applet return self.__card.select_applet(rescue=rescue) ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^ TypeError: PicoKey.select_applet() got an unexpected keyword argument 'rescue' ``` But I think I can find the Pico Key: ``` opensc-tool -an Using reader with a card: Yubico YubiKey OTP+FIDO+CCID [PicoFIDO HID Interface] (F7DE2D71F5986D60) 00 00 3b:fe:19:00:00:89:32:fe:45:80:31:81:54:48:53:4d:41:63:90:11:30:81:02:fa SmartCard-HSM version 5.6 ``` Another two Question: - I cannot set the LED GPIO, or rather, it does not work. In Commisioner, I cannot find the Pico HSM via WebUSB (Chrome on Linux&MacOS) at all, and when I use one as a Pico FIDO, setting the GPIO to 22, which is the correct pin according to the diagram I found, does not work ? - I want to generate an AES key but don't quite understand how to get libsc-hsm-pkcs11.so ?

Hi!
I just had the same issue and could solve it by installing a matching version of pypicohsm like this:
pip install git+https://github.com/polhenarejos/pypicohsm.git

Hi! I just had the same issue and could solve it by installing a matching version of pypicohsm like this: `pip install git+https://github.com/polhenarejos/pypicohsm.git`

Thanks that was really the Problem!

Open questions:

  • Why does Pico Commissioner not work on a Mac/Windows/Linux (Chrome) when I try to use webusb, even with an RP Pico 2W where it always worked before? Does webusb work for you, and is the issue on my end?
  • Has anyone managed to get either of the two possible LEDs on a Seeed Studio XIAO RP2350 to work? It's quite clear from the official instructions: https://wiki.seeedstudio.com/xiao-rp2350-c-cpp-sdk/#example-2-rgb-blink
  • Is there a complete guide to pico-hsm-tool.py on how to use “Supports AES encryption and decryption in ECB, CBC, CFB, OFB, XTS, CTR, GCM, and CCM modes, with customizable IV/nonce and additional authenticated data (AAD).”
Thanks that was really the Problem! Open questions: - Why does Pico Commissioner not work on a Mac/Windows/Linux (Chrome) when I try to use webusb, even with an RP Pico 2W where it always worked before? Does webusb work for you, and is the issue on my end? - Has anyone managed to get either of the two possible LEDs on a Seeed Studio XIAO RP2350 to work? It's quite clear from the official instructions: https://wiki.seeedstudio.com/xiao-rp2350-c-cpp-sdk/#example-2-rgb-blink - Is there a complete guide to pico-hsm-tool.py on how to use “Supports AES encryption and decryption in ECB, CBC, CFB, OFB, XTS, CTR, GCM, and CCM modes, with customizable IV/nonce and additional authenticated data (AAD).”
  • WebUSB is always painful due to permissions, drivers or whatsoever. I am working with a desktop app that will circumvent this using a rescue interface, always detectable.
  • I give support to official boards recognized in the Pico SDK. You are always free to submit a PR o build your own firmware.
  • https://www.picokeys.com/2022/07/10/aes/ but the support for AES in PKCS#11 is very limited. Usually python pico-hsm-tool.py cipher --help is always a good starting point.
- WebUSB is always painful due to permissions, drivers or whatsoever. I am working with a desktop app that will circumvent this using a rescue interface, always detectable. - I give support to official boards recognized in the Pico SDK. You are always free to submit a PR o build your own firmware. - https://www.picokeys.com/2022/07/10/aes/ but the support for AES in PKCS#11 is very limited. Usually `python pico-hsm-tool.py cipher --help` is always a good starting point.
Sign in to join this conversation.