This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

UNABLE TO GENERATE PRIVATE KEY

Hi,

I am following a tutorial in order to learn the procedure for DFU OTA . I installed the nrfutil but still unable to generate the private key.

I have tried several commands like :

nrfutil.exe keys generate private.key

nrfutil.exe keys generate priv.pem

but it did not work

I think i am using the latest version . 5.0.0

I am getting such errors : TypeError: write() argument must be str, not bytes
NameError: name 'raw_input' is not defined

Please suggest.
Could I be in wrong directory while writing these commands ?
C:\Users\ArshdeepMalik>nrfutil.exe keys generate private.key

Thanks much!

Parents Reply Children
  • Hi.

    How did you generate the DFU.zip file? What command did you run?

    Could you please explain every step you took from start until you generated the DFU.zip file :-)

    Best regards,

    Andreas

  • Yes Of course. 

    A1. Generate your own private key : Generated 

    A2. Generate your public key based on your private key : Generated

    B1. Compile the uECC library : Compiled, looks like this :

    Then went inside folder \nRF5_SDK_15.0.0_a53641a\external\micro-ecc\nrf52nf_keil\armgcc and typed make.

    B2. Copy the public_key.c file : copied the public_key.c file here \nRF5_SDK_15.0.0_a53641a\examples\dfu\secure_bootloader and built the example successfully.

    Then created a zip folder in Desktop, DFU.zip . Copied the hex file from example SDK ble_app_blinky_pca10056_s140.hex into DFU.zip folder and also copied the private.key in the same folder. 

    Then tried to send this DFU.zip folder using nrfConnect app. 

    Thanks, 

  • Hi

    arshdeep said:
    Then created a zip folder in Desktop, DFU.zip . Copied the hex file from example SDK ble_app_blinky_pca10056_s140.hex into DFU.zip folder and also copied the private.key in the same folder. 

     Which command did you use in CMD? :-)

    You have to use nrfutil to generate a DFU packet.

    Best regards,

    Andreas

  • Thanks Andreas, I was able to generate the zip folder using the nrfutil but now i am running into 2 new issue ->

    1) After uploading the DFU.zip folder to nrf52840 DK from nrf Connect app, it does not run my application and kind of erases everything from board. The upload goes till 100% and seems like it did upload it successfully. 

    2) After I upload the DFU.zip folder, every time i try to flash another program using SES,  it keeps on going in DFU mode. I am unable to exit from DFU mode. 

    Please Suggest . 

    Regards, 

  • Hi.

    Could you please post the nrfutil command that you used to generate the DFU packet? :-)

    Best regards,

    Andreas

Related