Skip to content

NRFutil (.exe, Windows) needs a larger write timeout #6

@waltje

Description

@waltje

I run the Arduino IDE under a VM with VMware - which runs just fine.

The thing here is, that once I want to program (flash) the resulting binary into a SuperMicro board, I get the following:

Upgrading target on COM20 with DFU package Y:\TEMP\arduino_build_677040\serial_echo.ino.zip. Flow control is disabled, Single bank, Touch disabled
Opened serial port COM20
Starting DFU upgrade of type 4, SoftDevice size: 0, bootloader size: 0, application size: 49232
Sending DFU start packet
Sending DFU init packet
Sending firmware file

Failed to upgrade target. Error is: Write timeout
Traceback (most recent call last):
  File "__main__.py", line 296, in serial
  File "dfu\dfu.py", line 235, in dfu_send_images
  File "dfu\dfu.py", line 206, in _dfu_send_image
  File "dfu\dfu_transport_serial.py", line 213, in send_firmware
  File "dfu\dfu_transport_serial.py", line 241, in send_packet
  File "serial\serialwin32.py", line 325, in write
serial.serialutil.SerialTimeoutException: Write timeout

Possible causes:
- Selected Bootloader version does not match the one on Bluefruit device.
    Please upgrade the Bootloader or select correct version in Tools->Bootloader.
- Baud rate must be 115200, Flow control must be off.
- Target is not in DFU mode. Ground DFU pin and RESET and release both to enter DFU mode.

which most likely is caused by the disconnect-reconnect of the USB port through VMware, which takes longer than it would on a direct connect system. Adafruit suggests:

"... the default timeout for acknowledgement packets is too short. A GitHub issue suggests increasing the ACK_PACKET_TIMEOUT constant in the nordicsemi/dfu/dfu_transport_serial.py file within the adafruit-nrfutil library to a higher value like 2.0 seconds."

A value of 2-3 seconds should indeed overcome this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions