Hi,
I’m trying to convert a RAK4631-R to RAK4631 (i could only order the -R at some stage here in the UK).
Now, i’ve seen a few guides that all use adafruit-nrfutil and for me (under linux) they don’t seem to work.
I’ve now also noticed that i can’t use adafruit-nrfutil to flash normal firmware onto the RAK4631 that i already had.
Here’s the output from adafruit-nrfutil:
$ adafruit-nrfutil --verbose dfu serial -p /dev/ttyACM0 -fc -sb -pkg ~/dev/RAKTracker/.pio/build/RAK4631/firmware.zip
Upgrading target on /dev/ttyACM0 with DFU package /home/cyclops/dev/RAKTracker/.pio/build/RAK4631/firmware.zip. Flow control is enabled, Single bank, Touch disabled
Opened serial port /dev/ttyACM0
Starting DFU upgrade of type 4, SoftDevice size: 0, bootloader size: 0, application size: 346056
Sending DFU start packet
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/cyclops/dev/adafruit-nrfutil/lib/python3.13/site-packages/nordicsemi/__main__.py", line 296, in serial
dfu.dfu_send_images()
~~~~~~~~~~~~~~~~~~~^^
File "/home/cyclops/dev/adafruit-nrfutil/lib/python3.13/site-packages/nordicsemi/dfu/dfu.py", line 235, in dfu_send_images
self._dfu_send_image(HexType.APPLICATION, self.manifest.application)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cyclops/dev/adafruit-nrfutil/lib/python3.13/site-packages/nordicsemi/dfu/dfu.py", line 199, in _dfu_send_image
self.dfu_transport.send_start_dfu(program_mode, softdevice_size, bootloader_size,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
application_size)
^^^^^^^^^^^^^^^^^
File "/home/cyclops/dev/adafruit-nrfutil/lib/python3.13/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 179, in send_start_dfu
self.send_packet(packet)
~~~~~~~~~~~~~~~~^^^^^^^^
File "/home/cyclops/dev/adafruit-nrfutil/lib/python3.13/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 243, in send_packet
ack = self.get_ack_nr()
File "/home/cyclops/dev/adafruit-nrfutil/lib/python3.13/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.
From platformio, i can flash the device, and the output looks like this:
Building in release mode
MethodWrapper(["checkprogsize"], [".pio/build/RAK4631/firmware.elf"])
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [= ] 10.9% (used 27100 bytes from 248832 bytes)
Flash: [==== ] 42.5% (used 346056 bytes from 815104 bytes)
.pio/build/RAK4631/firmware.elf :
section size addr
.text 344488 155648
.ARM.exidx 8 500136
.data 1560 536895488
.bss 25540 536897048
.heap 208420 536922588
.ARM.attributes 50 0
.comment 126 0
.debug_frame 84148 0
.stab 180 0
.stabstr 439 0
Total 664959
<lambda>(["upload"], [".pio/build/RAK4631/firmware.zip"])
AVAILABLE: jlink, nrfjprog, nrfutil, stlink
CURRENT: upload_protocol = nrfutil
BeforeUpload(["upload"], [".pio/build/RAK4631/firmware.zip"])
Auto-detected: /dev/ttyACM0
Forcing reset using 1200bps open/close on port /dev/ttyACM0
Waiting for the new upload port...
"/home/cyclops/.platformio/penv/bin/python" "/home/cyclops/.platformio/packages/tool-adafruit-nrfutil/adafruit-nrfutil.py" dfu serial -p /dev/ttyACM0 -b 115200 --singlebank -pkg .pio/build/RAK4631/firmware.zip
Upgrading target on /dev/ttyACM0 with DFU package /home/cyclops/dev/RAKTracker/.pio/build/RAK4631/firmware.zip. Flow control is disabled, Single bank, Touch disabled
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
########################################
####################################
Activating new firmware
Device programmed.
================================================================================== [SUCCESS] Took 23.25 seconds ==================================================================================
Even if i just run "/home/cyclops/.platformio/penv/bin/python" "/home/cyclops/.platformio/packages/tool-adafruit-nrfutil/adafruit-nrfutil.py" dfu serial -p /dev/ttyACM0 -b 115200 --singlebank -pkg .pio/build/RAK4631/firmware.zip outside of platformio, this doesn’t work (same output as first code block in this post).
The key difference seems to be: Forcing reset using 1200bps open/close on port /dev/ttyACM0
This makes a lot of sense to me, as the device wouldn’t be waiting for firmware or be in DFU mode, although adafruit-nrfutil seems to try to do that too.
Is there a way to ‘forcing reset using 1200bps open/close on port /dev/ttyACM0’ via a different command?