<div dir="ltr"><div>Hi Szczepan (hopefully correctly spelled)<br><br></div>I tried to upgrade with the prebuilt bin file, after doing the make clean, ./configure and new make for gnuk and regnual on the 16.10 machine. It seems to fail for me, just as the other times I tried (with RTM1 firmware):<br><br>    Device: <br>        Vendor: Nitrokey<br>       Product: Nitrokey Start<br>        Serial: FSIJ-1.0.4-52FF7106<br>      Revision: release/1.0.4-6-g739e00e<br>        Config: NITROKEY_START:dfu=no:debug=no:pinpad=no:certdo=yes:keygen=yes<br>           Sys: 1.0<br><br><br>    $ python2 ./upgrade_by_passwd.py -f  ../regnual/regnual.bin ~/tmp/nitrokey-start-firmware-1.0.4-1a.bin <br>    ../regnual/regnual.bin: 4388<br>    /home/remy/tmp/nitrokey-start-firmware-1.0.4-1a.bin: 58368<br>    CRC32: a4811640<br><br>    Device: <br>    Configuration: 1<br>    Interface: 0<br>    20001400:20004a00<br>    Downloading flash upgrade program...<br>    start 20001400<br>    end   20002500<br>    Run flash upgrade program...<br>    Waiting for device to appear:<br>    - Wait 1 seconds...<br>    - Wait 1 seconds...<br>    - Wait 1 seconds...<br>    - Wait 1 seconds...<br>    ^CTraceback (most recent call last):<br>      File "./upgrade_by_passwd.py", line 134, in <module><br>        main(wait_e, keyno, passwd, data_regnual, data_upgrade[4096:])<br>      File "./upgrade_by_passwd.py", line 75, in main<br>        time.sleep(wait_e)<br>    KeyboardInterrupt<br><br><br>    Device: <br>        Vendor: Nitrokey<br>       Product: Nitrokey Start<br>        Serial: FSIJ-1.0.4-52FF7106<br>      Revision: release/1.0.4-6-g739e00e<br>        Config: NITROKEY_START:dfu=no:debug=no:pinpad=no:certdo=yes:keygen=yes<br>           Sys: 1.0<br><br><br>    $ python2 ./upgrade_by_passwd.py -f  ../regnual/regnual.bin ~/tmp/nitrokey-start-firmware-1.0.4-1a.bin <br>    ../regnual/regnual.bin: 4388<br>    /home/remy/tmp/nitrokey-start-firmware-1.0.4-1a.bin: 58368<br>    CRC32: a4811640<br><br>    Device: <br>    Configuration: 1<br>    Interface: 0<br>    20001400:20004a00<br>    Downloading flash upgrade program...<br>    start 20001400<br>    end   20002500<br>    Run flash upgrade program...<br>    Waiting for device to appear:<br>    - Wait 1 seconds...<br>    - Wait 1 seconds...<br>    - Wait 1 seconds...<br>    - Wait 1 seconds...<br>    - Wait 1 seconds...<br>    - Wait 1 seconds...<br>    - Wait 1 seconds...<br>    - Wait 1 seconds...<br>    ^CTraceback (most recent call last):<br>      File "./upgrade_by_passwd.py", line 134, in <module><br>        main(wait_e, keyno, passwd, data_regnual, data_upgrade[4096:])<br>      File "./upgrade_by_passwd.py", line 75, in main<br>        time.sleep(wait_e)<br>    KeyboardInterrupt<br><br><br>Upgrading to RTM2:<br><br>    $ python2 ./upgrade_by_passwd.py -f  ../regnual/regnual.bin ../../nitrokey-start-firmware/prebuilt/RTM.2/gnuk.bin <br>    ../regnual/regnual.bin: 4388<br>    ../../nitrokey-start-firmware/prebuilt/RTM.2/gnuk.bin: 53248<br>    CRC32: a4811640<br><br>    Device: <br>    Configuration: 1<br>    Interface: 0<br>    20001400:20004a00<br>    Downloading flash upgrade program...<br>    start 20001400<br>    end   20002500<br>    Run flash upgrade program...<br>    Waiting for device to appear:<br>    - Wait 1 seconds...<br>    - Wait 1 seconds...<br>    - Wait 1 seconds...<br>    - Wait 1 seconds...<br>    - Wait 1 seconds...<br>    - Wait 1 seconds...<br>    - Wait 1 seconds...<br>    - Wait 1 seconds...<br>    - Wait 1 seconds...<br>    ^CTraceback (most recent call last):<br>      File "./upgrade_by_passwd.py", line 134, in <module><br>        main(wait_e, keyno, passwd, data_regnual, data_upgrade[4096:])<br>      File "./upgrade_by_passwd.py", line 75, in main<br>        time.sleep(wait_e)<br>    KeyboardInterrupt<br><br><br>On 1.2.2:<br><br><br>    $ python2 usb_strings.py <br>    Device: <br>        Vendor: Nitrokey<br>       Product: Nitrokey Start<br>        Serial: FSIJ-1.2.2-87042430<br>      Revision: release/1.0.2-471-g1a76ab5-modified<br>        Config: NITROKEY_START:dfu=no:debug=no:pinpad=no:certdo=no<br>           Sys: 3.0<br><br><br>It works:<br><br>    $ python2 ./upgrade_by_passwd.py -f  ../regnual/regnual.bin ../src/build/gnuk.bin <br>    ../regnual/regnual.bin: 4388<br>    ../src/build/gnuk.bin: 110592<br>    CRC32: a4811640<br><br>    Device: <br>    Configuration: 1<br>    Interface: 0<br>    20002800:20005000<br>    Downloading flash upgrade program...<br>    start 20002800<br>    end   20003900<br>    Run flash upgrade program...<br>    Waiting for device to appear:<br>    - Wait 1 seconds...<br>    Device: <br>    08001000:08020000<br>    Downloading the program<br>    start 08001000<br>    end   0801b000<br>    Resetting device<br>    Update procedure finished<br><br><br>    $ python2 usb_strings.py <br>    Device: <br>        Vendor: Nitrokey<br>       Product: Nitrokey Start<br>        Serial: FSIJ-1.2.2-87042430<br>      Revision: release/1.0.2-471-g1a76ab5-modified<br>        Config: NITROKEY_START:dfu=no:debug=no:pinpad=no:certdo=no<br>           Sys: 3.0<br><br><br><br>From 1.2.2 to RTM1:<br><br>    $ python2 ./upgrade_by_passwd.py -f  ../regnual/regnual.bin ../../nitrokey-start-firmware/prebuilt/RTM.1/nitrokey-start-firmware-1.0.4-1a.bin<br>    ../regnual/regnual.bin: 4388<br>    ../../nitrokey-start-firmware/prebuilt/RTM.1/nitrokey-start-firmware-1.0.4-1a.bin: 58368<br>    CRC32: a4811640<br><br>    Device: <br>    Configuration: 1<br>    Interface: 0<br>    20002800:20005000<br>    Downloading flash upgrade program...<br>    start 20002800<br>    end   20003900<br>    Run flash upgrade program...<br>    Waiting for device to appear:<br>    - Wait 1 seconds...<br>    Device: <br>    08001000:08020000<br>    Downloading the program<br>    start 08001000<br>    end   0800e400<br>    Resetting device<br>    Update procedure finished<br><br><br>However, afterwards the green light stays on and dmesg says this:<br><br>    [Tue Jan  3 19:37:11 2017] usb 1-1.1: device descriptor read/64, error -32<br>    [Tue Jan  3 19:37:11 2017] usb 1-1.1: new full-speed USB device number 37 using ehci-pci<br>    [Tue Jan  3 19:37:11 2017] usb 1-1.1: device not accepting address 37, error -32<br>    [Tue Jan  3 19:37:12 2017] usb 1-1.1: new full-speed USB device number 38 using ehci-pci<br>    [Tue Jan  3 19:37:12 2017] usb 1-1.1: device not accepting address 38, error -32<br>    [Tue Jan  3 19:37:12 2017] usb 1-1-port1: unable to enumerate USB device<br><br><br>    $ python2 usb_strings.py <br><br><br>Back on RTM1:<br><br>    $ python2 usb_strings.py <br>    Device: <br>        Vendor: Nitrokey<br>       Product: Nitrokey Start<br>        Serial: FSIJ-1.0.4-52FF7106<br>      Revision: <br>        Config: NITROKEY_START:dfu=no:debug=no:pinpad=no:certdo=no:keygen=no<br>           Sys: 1.0<br><br><br>    $ python2 ./upgrade_by_passwd.py -f  ../regnual/regnual.bin ../src/build/gnuk.bin<br>    ../regnual/regnual.bin: 4388<br>    ../src/build/gnuk.bin: 110592<br>    CRC32: a4811640<br><br>    Device: <br>    Configuration: 1<br>    Interface: 0<br>    20001400:20004a00<br>    Downloading flash upgrade program...<br>    start 20001400<br>    end   20002500<br>    Run flash upgrade program...<br>    Waiting for device to appear:<br>    - Wait 1 seconds...<br>    - Wait 1 seconds...<br>    - Wait 1 seconds...<br>    - Wait 1 seconds...<br>    - Wait 1 seconds...<br>    - Wait 1 seconds...<br>    - Wait 1 seconds...<br>    - Wait 1 seconds...<br>    - Wait 1 seconds...<br>    ^CTraceback (most recent call last):<br>      File "./upgrade_by_passwd.py", line 134, in <module><br>        main(wait_e, keyno, passwd, data_regnual, data_upgrade[4096:])<br>      File "./upgrade_by_passwd.py", line 75, in main<br>        time.sleep(wait_e)<br>    KeyboardInterrupt<br><br><br>So it seems to still fail, even with the bin files instead of the HEX.<br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><br><br><a href="https://raymii.org" target="_blank">https://raymii.org</a><br></div></div>
<br><div class="gmail_quote">On Thu, Dec 29, 2016 at 12:27 PM, Szczepan Zalega | Nitrokey <span dir="ltr"><<a href="mailto:szczepan@nitrokey.com" target="_blank">szczepan@nitrokey.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Remy!<br>
<br>
I have noticed that you have used .hex file for regnual update. The tool<br>
does not understand this format and in consequence it sends ASCII<br>
hexdump representation directly to device, which obviously will not<br>
work. This was the cause of the update issues mentioned in previous<br>
email. The stm32flash tool handles both .bin and .hex.<br>
<br>
Just for testing purposes I have converted the firmware you have<br>
received to binary [3] with srecord tools (not checked it though):<br>
<br>
```<br>
 srec_cat nitrokey-start-firmware-1.0.4-<wbr>1a.hex -intel -offset<br>
-0x08000000 -o nitrokey-start-firmware-1.0.4-<wbr>1a.bin -binary<br>
<br>
```<br>
<br>
Have you tried upgrading using regnual with prebuilt binaries? [2]<br>
<br>
As for compiling firmware for first release on Ubuntu 16.10, I have done<br>
the same successfully on Virtualbox with image downloaded from OSBoxes<br>
(to make it fully reproducible) - full log attached [1]. Please try the<br>
compilation on a clean repository.<br>
<br>
Additionally regnual tool might need recompilation (make clean; make) on<br>
each ./configure run since it uses files generated with it.<br>
<br>
SHA sum for downloaded Ubuntu image from OSBoxes:<br>
$ sha512sum Ubuntu_16.10_Yakkety-VB-64bit.<wbr>7z<br>
fa16b1fc694679a7e470030eddc3fc<wbr>1e842e94e6cb62ac5ea3f346a2ccbc<wbr>39b8c909395655b3134a189021e8c0<wbr>2fdd001fb2fe544f012e18dffb14e3<wbr>69a79a6e<br>
 Ubuntu_16.10_Yakkety-VB-64bit.<wbr>7z<br>
<br>
<br>
[1] <a href="http://paste.ubuntu.com/23664245/" rel="noreferrer" target="_blank">http://paste.ubuntu.com/<wbr>23664245/</a><br>
[2]<br>
<a href="https://github.com/Nitrokey/nitrokey-start-firmware/tree/gnuk1.2-regnual-fix/prebuilt" rel="noreferrer" target="_blank">https://github.com/Nitrokey/<wbr>nitrokey-start-firmware/tree/<wbr>gnuk1.2-regnual-fix/prebuilt</a><br>
[3]<br>
<a href="https://github.com/Nitrokey/nitrokey-start-firmware/tree/gnuk1.2-regnual-fix/prebuilt/RTM.1" rel="noreferrer" target="_blank">https://github.com/Nitrokey/<wbr>nitrokey-start-firmware/tree/<wbr>gnuk1.2-regnual-fix/prebuilt/<wbr>RTM.1</a><br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
Best regards,<br>
Szczepan<br>
<br>
______________________________<wbr>_________________<br>
gnuk-users mailing list<br>
<a href="mailto:gnuk-users@lists.alioth.debian.org">gnuk-users@lists.alioth.<wbr>debian.org</a><br>
<a href="https://lists.alioth.debian.org/mailman/listinfo/gnuk-users" rel="noreferrer" target="_blank">https://lists.alioth.debian.<wbr>org/mailman/listinfo/gnuk-<wbr>users</a><br>
</div></div></blockquote></div><br></div>