This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Entering DFU mode switches port number

When switching the dongle into DFU mode, it changes the serial port number when running in windows. 

Both the bootloader and the application sets up the USB and calls the app_usbd_serial_num_generate();

As I read the doc I expected the usb to keep its port number when going into dfu mode. Is this a windows 

feature or am I doing something wrong ? 

/Jimmy

Parents Reply Children
  • I built the secure bootsample with the board type changed and added my own public key then run the following:

    ```

    nrfutil pkg generate --hw-version 52 --sd-req 0 --application-version 4 --application ./ZigBee/nRF52840/pca10059/mbr/ses/Output/Release/Exe/test_zigbee_coordinator_pca10059.hex --key-file ./SecureBootloader/test_nordic_bootloader_priv.pem --app-boot-validation VALIDATE_GENERATED_SHA256 test_usb_fw.zip

    nrfutil pkg generate --hw-version 52 --sd-req 0 --bootloader-version 2 --bootloader ./SecureBootloader/pca10056_usb/ses/Output/Release/Exe/test_secure_bootloader_usb_mbr_pca10056.hex --key-file ./SecureBootloader/test_nordic_bootloader_priv.pem --app-boot-validation VALIDATE_GENERATED_SHA256 test_bootloader_usb_fw.zip

    nrfutil settings generate --family NRF52840 --application ./ZigBee/nRF52840/pca10059/mbr/ses/Output/Release/Exe/test_zigbee_coordinator_pca10059.hex  --application-version 3 --bootloader-version 2 --bl-settings-version 2 --app-boot-validation VALIDATE_GENERATED_SHA256 --key-file ./SecureBootloader/test_nordic_bootloader_priv.pem bootload_setting.hex

    ```

    How do I get the bootloader_setting.hex on to the nrf 52840 Dongel ? the documentation refers to nrfproj but that only works if I have a debugger. 

    This is what I get if I ignore the settings file and flash the file directly.

    ```

    nrfutil dfu usb-serial -pkg ./test_bootloader_usb_fw.zip -p /dev/ttyS11
    2019-02-22 09:32:41,671 Using board at serial port: /dev/ttyS11
    Traceback (most recent call last):
      File "/usr/local/bin/nrfutil", line 11, in <module>
        load_entry_point('nrfutil==5.0.0', 'console_scripts', 'nrfutil')()
      File "/home/kappen/.local/lib/python2.7/site-packages/click/core.py", line 764, in __call__
        return self.main(*args, **kwargs)
      File "/home/kappen/.local/lib/python2.7/site-packages/click/core.py", line 717, in main
        rv = self.invoke(ctx)
      File "/home/kappen/.local/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/home/kappen/.local/lib/python2.7/site-packages/click/core.py", line 1137, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/home/kappen/.local/lib/python2.7/site-packages/click/core.py", line 956, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "/home/kappen/.local/lib/python2.7/site-packages/click/core.py", line 555, in invoke
        return callback(*args, **kwargs)
      File "/usr/local/lib/python2.7/dist-packages/nrfutil-5.0.0-py2.7.egg/nordicsemi/__main__.py", line 989, in usb_serial
        do_serial(package, port, connect_delay, flow_control, packet_receipt_notification, baud_rate, serial_number, False)
      File "/usr/local/lib/python2.7/dist-packages/nrfutil-5.0.0-py2.7.egg/nordicsemi/__main__.py", line 952, in do_serial
        dfu.dfu_send_images()
      File "/usr/local/lib/python2.7/dist-packages/nrfutil-5.0.0-py2.7.egg/nordicsemi/dfu/dfu.py", line 125, in dfu_send_images
        self._dfu_send_image(self.manifest.bootloader)
      File "/usr/local/lib/python2.7/dist-packages/nrfutil-5.0.0-py2.7.egg/nordicsemi/dfu/dfu.py", line 97, in _dfu_send_image
        self.dfu_transport.send_init_packet(data)
      File "/usr/local/lib/python2.7/dist-packages/nrfutil-5.0.0-py2.7.egg/nordicsemi/dfu/dfu_transport_serial.py", line 256, in send_init_packet
        self.__execute()
      File "/usr/local/lib/python2.7/dist-packages/nrfutil-5.0.0-py2.7.egg/nordicsemi/dfu/dfu_transport_serial.py", line 416, in __execute
        self.__get_response(DfuTransportSerial.OP_CODE['Execute'])
      File "/usr/local/lib/python2.7/dist-packages/nrfutil-5.0.0-py2.7.egg/nordicsemi/dfu/dfu_transport_serial.py", line 500, in __get_response
        get_dict_key(DfuTransport.RES_CODE, resp[2])))
    pc_ble_driver_py.exceptions.NordicSemiException: Response Code InvalidObject

    ```

    Flashing thrue nRF Connect gives error message

    DFU failed: Error message for known extended error code for DFU target: The init packet does not contain a signature. This bootloader requires DFU updates to be signed.

  • Hi Jimmy, 

    the nRF52840 Dongle is preprogrammed with the Open Bootloader with DFU example, which requires a signed image 

    The private key that the public key in the preprogrammed Open Bootloader on the dongle is not distributed. So in order to update the bootloader on the nRF52840 Dongle you actually do need a programmer. 

    Best regards

    Bjørn

  • Ok, thanks at least I know that it should not work.It works on the DK so ill assume it will work....

Related