Closed Laborratte5 closed 1 year ago
What is the output of nitropy nk3 list
?
And what happens if you try to run the update again?
nitropy nk3 list
returns the following:
Command line tool to interact with Nitrokey devices 0.4.37
:: 'Nitrokey 3' keys
/dev/hidraw0: Nitrokey 3 Bootloader (LPC55) 37D69462A9E4CF518B0F959C541F856D
It seems that restarting the update does something. (I was certain that I tried that but seems like I didn't) Maybe it works this time. I will post the results as soon as the update is finished
After the update finished the same error appeared. However this time the update took over 8h which is twice as much is it took the first time. Also the log contains debug messages for every few bytes written. (Which the first one didn't)
It looks like this is an issue with the bootloader provided by NXP. Can you please try to reproduce the problem using the official NXP tools? If it also happens with these tools, we’ll have to forward this issue to NXP.
$ pipx install spsdk
$ spsdk blhost --usb 0x20a0:0x42dd get-property 1
Response status = 0 (0x0) Success.
Response word 1 = 1258487808 (0x4b030000)
Current Version = K3.0.0
$ cd /tmp
$ nitropy nk3 fetch-update --version v1.4.0 .
$ sha256sum firmware-nk3-v1.4.0.zip
d77286a8f1544214ceed29beec0c9bc6a27da12a099f50c8a8c0af943e210c35 firmware-nk3-v1.4.0.zip
$ unzip firmware-nk3-v1.4.0.zip
$ sha256sum --check sha256sums
$ spsdk blhost --usb 0x20a0:0x42dd receive-sb-file firmware-nk3xn-lpc55-v1.4.0.sb2
$ spsdk blhost --usb 0x20a0:0x42dd reset
This seems to have worked.
I just realized because I used a new virtual environment I used spsdk, version 1.10-1
whereas nitropy uses spsdk, version 1.7.1
nitropy nk3 test
now returns:
Command line tool to interact with Nitrokey devices 0.4.37
Found 1 Nitrokey 3 device(s):
- Nitrokey 3 at /dev/hidraw1
Running tests for Nitrokey 3 at /dev/hidraw1
[1/4] uuid UUID query SUCCESS 37D69462A9E4CF518B0F959C541F856D
[2/4] version Firmware version query SUCCESS v1.4.0
[3/4] status Device status FAILURE init error: EXTERNAL_FLASH_ERROR (0x4)
Please press the touch button on the device ...
Please press the touch button on the device ...
[4/4] fido2 FIDO2 SUCCESS
4 tests, 3 successful, 0 skipped, 1 failed
Summary: 1 device(s) tested, 0 successful, 1 failed
Critical error:
Test failed for 1 device(s)
But I am unsure whether this is a related Issue or a different. Let me know if I should open a new Issue instead. And thanks for your help so far
Hmm, interesting. Can you try to repeat the update with nitropy
to check if still fails?
Depending on the firmware version you were running before the update, the External Flash error could be caused by a migration. In that case, it should disappear after a power cycle. If you run nk3 test
again, does it still show the error?
If you run nk3 test again, does it still show the error?
A power cycle did solve the issue.
Can you try to repeat the update with nitropy to check if still fails?
The update still fails using nitropy
. After that the UUID query of nitropy nk3 test
fails again with MBoot: Connection issue -> Device not opened
,
like it did the first time
nitropy nk3 update
log: nitropy.log.57l8bsh8.log
nitropy nk3 test
log: nitropy.log.j3zh_bcv.log
I also tried your instructions again and this time it also failed with:
ERROR:spsdk.mboot.interfaces.usb:Cannot read from HID device, error=0 (39405177ms since start, usb.py:243)
ERROR:spsdk.mboot.mcuboot:RX: No Response, Timeout Error ! (39405178ms since start, mcuboot.py:227)
Moreover I think there is a correlation between the time to finish the update an the success. This time it also took roughly 10h to finish and fail.
After some more testing I think the issue has something to do either with my (computer)hardware (not the nitrokey) or my operating system, because on a different Computer with a different Operating System (MX Linux in this case) 3/3 times the update succeeded in a matter of seconds.
If I discover something new that may help others I will add it to this issue. For now I'll close this issue as it seems like the problem has nothing to do with pynitrokey.
Nontheless thank you very much for your help
I got a similar error as mentioned here but as pointed out by robin-nitrokey it seems to be unrelated to the original issue so I'm opening this one. I ran
nitropy nk3 update --version v1.4.0
to update the firmware. The update reached 100% and then the following error occured:This is the error log:
Unfortunately I think this killed my device, as
nitropy nk3 test
now also returns some MBoot error:I do have the udev rules installed.