cosmos / ledger-cosmos-obsolete

Ledger Nano S support for Tendermint/Cosmos
Apache License 2.0
42 stars 29 forks source link

Can't load user firmware #99

Closed alessio closed 5 years ago

alessio commented 5 years ago

Whilst I could build and upload the validator app successfully, nanocli.sh uload failed to load the user app:

$ ./nanocli.sh uload
make: Entering directory '/tmp/build/ledger-cosmos/src/ledger-user'
TARGET_NAME=TARGET_NANOS TARGET_ID=0x31100003
BOLOS_ENV=/opt/bolos
BOLOS_ENV=/opt/bolos
python -m ledgerblue.loadApp --appFlags 0x00 --delete --tlv --targetId 0x31100003 --delete --fileName bin/app.hex --appName "COSMOS" --appVersion 1.0.1 --dataSize `cat debug/app.map |grep _nvram_data_size | tr -s ' ' | cut -f2 -d' '` `ICONHEX=\`python /tmp/build/ledger-cosmos/src/ledger-user/deps/nanos-secure-sdk/icon.py /tmp/build/ledger-cosmos/src/ledger-user/icon.gif hexbitmaponly 2>/dev/null\` ; [ ! -z "$ICONHEX" ] && echo "--icon $ICONHEX"`  --path "44'/118'"
Generated random root public key : 047a22c86beb9cc1d8a256ce8a5a319f285baeceb71c46548fa0c6dc3598b4a0958520d27778dce17ae5d42c29cdfdb680de4adf6b7aa9abc976561128759dd00c
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/alessio/.local/lib/python2.7/site-packages/ledgerblue/loadApp.py", line 176, in <module>
    secret = getDeployedSecretV2(dongle, bytearray.fromhex(args.rootPrivateKey), args.targetId)
  File "/home/alessio/.local/lib/python2.7/site-packages/ledgerblue/deployed.py", line 91, in getDeployedSecretV2
    dongle.exchange(apdu)
  File "/home/alessio/.local/lib/python2.7/site-packages/ledgerblue/comm.py", line 135, in exchange
    raise CommException("Invalid status %04x (%s)" % (sw, possibleCause), sw, response)
ledgerblue.commException.CommException: Exception : Invalid status 6e00 (Unknown reason)
Makefile:108: recipe for target 'load' failed
make: *** [load] Error 1
make: Leaving directory '/tmp/build/ledger-cosmos/src/ledger-user'

The device's firmware is 1.5.5.

Thanks for considering.

jleni commented 5 years ago

Hi @alessio You can install the user app directly from Ledger's app store (Ledger Live). You will need to remember enabling "developer mode" in settings.

While Ledger released for firmware 1.5.5 by injecting the new SDK via an environment variable, the source code in this repo still needs to refresh the SDK. I will do it later today.

In the new version of the SDK that matches 1.5.5, the TARGET_ID has changed from 0x31100003 to 0x31100004 and that is why you have this error.

alessio commented 5 years ago

Thanks!

jleni commented 5 years ago

I will reopen so I dont forget to update the SDK :)