Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
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

DFU USB - Serial port could not be opened

Hello everyone,

I am currently testing the secure bootloader over USB example but I am currently facing an issue when I start a DFU.

2022-03-25 12:13:23,456 Using board at serial port: COM24
2022-03-25 12:13:23,462 Sending Application image.
2022-03-25 12:13:26,970 Serial: Set Packet Receipt Notification 0
2022-03-25 12:13:26,970 SLIP: --> [2, 0, 0]
Traceback (most recent call last):
  File "nordicsemi\dfu\dfu_transport_serial.py", line 123, in send_message
  File "site-packages\serial\serialwin32.py", line 323, in write
serial.serialutil.SerialTimeoutException: Write timeout

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "nordicsemi\__main__.py", line 1537, in <module>
  File "site-packages\click\core.py", line 764, in __call__
  File "site-packages\click\core.py", line 717, in main
  File "site-packages\click\core.py", line 1137, in invoke
  File "site-packages\click\core.py", line 1137, in invoke
  File "site-packages\click\core.py", line 956, in invoke
  File "site-packages\click\core.py", line 555, in invoke
  File "nordicsemi\__main__.py", line 1015, in usb_serial
  File "nordicsemi\__main__.py", line 972, in do_serial
  File "nordicsemi\dfu\dfu.py", line 127, in dfu_send_images
  File "nordicsemi\dfu\dfu.py", line 88, in _dfu_send_image
  File "nordicsemi\dfu\dfu_transport_serial.py", line 216, in open
  File "nordicsemi\dfu\dfu_transport_serial.py", line 359, in __set_prn
  File "nordicsemi\dfu\dfu_transport_serial.py", line 125, in send_message
pc_ble_driver_py.exceptions.NordicSemiException: Writing to serial port failed: Write timeout. If MSD is enabled on the target device, try to disable it ref. https://wiki.segger.com/index.php?title=J-Link-OB_SAM3U

Here is my configuration:

  • Hardware: nRF52840 DK (V0.9.0)
  • nrf Util (6.1.0, exe)
  • SDK 17.0.2

The dev kit is working fine with an other firmware using the USB CDC class example, I can communicate with the board.

I have tried to connect with a terminal but the COM is blocked. Trying to reset the board or the computer won't do anything.

Edit : I have also disabled the MSD, but the result was the same.

  • Bootloader

I used the secure_bootloader_usb_mbr_pca10056_debug example with no modification. I just rebuilt it and renamed it.

  • Generation of the bootloader settings

nrfutil settings generate --family NRF52840 --application nrf52840_myBootloaderUSB.hex --application-version 1 --bootloader-version 1 --bl-settings-version 2 bootloader_setting.hex

  • Generation of the DFU package

nrfutil pkg generate --hw-version 52 --application-version 1 --application 04_blinky_mbr.hex --sd-req 0x0100 --key-file private.key DFU_Package.zip

  • Flash

The bootloader, the bootloader settings and the softdevice (s140_nrf52_7.2.0_softdevice.hex) are flashed in the board.

  • DFU

After having set the board in DFU mode (Button 4 + RESET), I use this command to start the DFU

nrfutil dfu usb-serial -pkg DFU_Package.zip -p COM24 -b 115200

Do you know what could be the cause of this problem ?

Best regards,

Alexandre

Parents
  • Hello Alexandre,

    Just want to check first, you are using the USB port on the DK that is located between the reset button and the buttons 1-4 when you try to run "nrfutil dfu usb-serial ..." right? This is the USB peripheral of the nRF52840DK

    What is "nrf52840_myBootloaderUSB.hex"? Is that the bootloader .hex file, or is it the application .hex file?

    If it is in fact an application, and not the bootloader, and you flash only the softdevice and this .hex file (but not the bootloader), what happens then? Does the application run as expected? Is the main() function of that application reached?

    And what about if you only flash the bootloader and the softdevice, and then try to run the "nrfutil dfu usb-serial ..." command (and the USB cable plugged in the USB peripheral)?

    About your HW. The DK is kind of old, and it is an engineering sample, if I am not mistaken. I would recommend you to get hold of a DK with a production sample of the nRF52840 for further development. That being said, I am not aware of any USB defects on the engineering samples (that I know by heart), but I would need to check that on Monday if it looks like the USB is not working properly on your end. Unfortunately, I don't have an nRF52840DK v0.9.0 to test with.

    Best regards,

    Edvin

  • Hello Edvin,

    Thank you for your answer !

    Yes I used the USB port located between the RST and the four buttons.

    nrf52840_myBootloaderUSB.hex is indeed the bootloader I built from the secure bootloader example (I only added some logs to the secure bootloader USB debug).

    The peripheral is detected when I connect the USB and having pressed the button 4 and RESET.

    I will test with a newer DK (V1.0.0). Is this version good enough for the tests I want to do ?

     

    Best regards,

    Alexandre

Reply
  • Hello Edvin,

    Thank you for your answer !

    Yes I used the USB port located between the RST and the four buttons.

    nrf52840_myBootloaderUSB.hex is indeed the bootloader I built from the secure bootloader example (I only added some logs to the secure bootloader USB debug).

    The peripheral is detected when I connect the USB and having pressed the button 4 and RESET.

    I will test with a newer DK (V1.0.0). Is this version good enough for the tests I want to do ?

     

    Best regards,

    Alexandre

Children
No Data
Related