Wisblock RAK4630 upload fails intermittently

Every now and then upload of the code to the Wisblock fails for no apparent reason

Forcing reset using 1200bps open/close on port /dev/ttyACM0
PORTS {/dev/ttyACM0, } / {} => {}
PORTS {} / {/dev/ttyACM0, } => {/dev/ttyACM0, }
Found upload port: /dev/ttyACM0
adafruit-nrfutil --verbose dfu serial -pkg /tmp/arduino_build_432204/RS485Passthrough.ino.zip -p /dev/ttyACM0 -b 115200 --singlebank 
Upgrading target on /dev/ttyACM0 with DFU package /tmp/arduino_build_432204/RS485Passthrough.ino.zip. Flow control is disabled, Single bank, Touch disabled
Opened serial port /dev/ttyACM0
Starting DFU upgrade of type 4, SoftDevice size: 0, bootloader size: 0, application size: 42604
Sending DFU start packet
Sending DFU init packet
Sending firmware file
########################################
#######################Timed out waiting for acknowledgement from device.

Failed to upgrade target. Error is: No data received on serial port. Not able to proceed.
Traceback (most recent call last):
  File "/home/jpmeijers/.local/lib/python3.8/site-packages/nordicsemi/__main__.py", line 294, in serial
    dfu.dfu_send_images()
  File "/home/jpmeijers/.local/lib/python3.8/site-packages/nordicsemi/dfu/dfu.py", line 235, in dfu_send_images
    self._dfu_send_image(HexType.APPLICATION, self.manifest.application)
  File "/home/jpmeijers/.local/lib/python3.8/site-packages/nordicsemi/dfu/dfu.py", line 206, in _dfu_send_image
    self.dfu_transport.send_firmware(firmware)
  File "/home/jpmeijers/.local/lib/python3.8/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 213, in send_firmware
    self.send_packet(pkt)
  File "/home/jpmeijers/.local/lib/python3.8/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 243, in send_packet
    ack = self.get_ack_nr()
  File "/home/jpmeijers/.local/lib/python3.8/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 282, in get_ack_nr
    raise NordicSemiException("No data received on serial port. Not able to proceed.")
nordicsemi.exceptions.NordicSemiException: No data received on serial port. Not able to proceed.

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.

I then have to double-tap reset the board to get it into bootloader mode, where I can upload the firmware.

It feels as if something is running in the background in the firmware that is causing this to happen. Is there perhaps by default some Bluetooth code active which I can disable?

Please update your bootloader on the RAK4631.
See this post

After the boorloader upgrade things are definitely more stable. But I just got the RAK4630 into a state where the upload fails.

adafruit-nrfutil --verbose dfu serial -pkg /tmp/arduino_build_226495/RAK4631-DeepSleep-LoRaWan.ino.zip -p /dev/ttyACM0 -b 115200 --singlebank 
Upgrading target on /dev/ttyACM0 with DFU package /tmp/arduino_build_226495/RAK4631-DeepSleep-LoRaWan.ino.zip. Flow control is disabled, Single bank, Touch disabled
Opened serial port /dev/ttyACM0
Starting DFU upgrade of type 4, SoftDevice size: 0, bootloader size: 0, application size: 93100
Sending DFU start packet
Sending DFU init packet
Sending firmware file
########################################
########################################
########################################
##############Timed out waiting for acknowledgement from device.

Failed to upgrade target. Error is: No data received on serial port. Not able to proceed.
Traceback (most recent call last):
  File "/home/jpmeijers/.local/lib/python3.8/site-packages/nordicsemi/__main__.py", line 294, in serial
    dfu.dfu_send_images()
  File "/home/jpmeijers/.local/lib/python3.8/site-packages/nordicsemi/dfu/dfu.py", line 235, in dfu_send_images
    self._dfu_send_image(HexType.APPLICATION, self.manifest.application)
  File "/home/jpmeijers/.local/lib/python3.8/site-packages/nordicsemi/dfu/dfu.py", line 206, in _dfu_send_image
    self.dfu_transport.send_firmware(firmware)
  File "/home/jpmeijers/.local/lib/python3.8/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 213, in send_firmware
    self.send_packet(pkt)
  File "/home/jpmeijers/.local/lib/python3.8/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 243, in send_packet
    ack = self.get_ack_nr()
  File "/home/jpmeijers/.local/lib/python3.8/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 282, in get_ack_nr
    raise NordicSemiException("No data received on serial port. Not able to proceed.")
nordicsemi.exceptions.NordicSemiException: No data received on serial port. Not able to proceed.

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.

Even in DFU mode (when the device is mounted as a Mass Storage Device) the upload fails intermittently. I did however manage to upload now, and after upload the new sketch does not start. Reset button press brings the device back into DFU mode. But this time a firmware upload makes it reset and run the new sketch.

I am sorry for the problems you have. I flashed my four RAK4631 with the new bootloader and I have no more problems with the USB upload. And I know our SW team did testing as well.

I will ask our SW team to have another look into the bootloader.

1 Like

Thanks @beegee. It is definitely MUCH better than before, and the upload fails at very random times now. I still wonder if there isn’t something running in the background that interrupts the USB serial port. I’ve seen the USB serial hang at random times too. Maybe related to deepsleep. If I find anything else I will report back.