Convert RAK4631 to RAK4631-R (again)

Hi, I need some help converting RAK4631 to -R

Im confused after reading posts and “step 2” in following this tutorial (updating-rak4631-to-rui3) - https://docs.rakwireless.com/Product-Categories/WisBlock/RAK4631-R/DFU/#updating-rak4631-to-rui3

Iv managed to flash the boot loader ok but step 2 says that I should flash rui3_rak4631_latest.zip but it fails what ever I try.

log from latest try

$ adafruit-nrfutil dfu serial --package rui3_rak4631_latest.zip -p /dev/ttyACM0 -b 115200
Traceback (most recent call last):
  File "/home/tomas/.local/bin/adafruit-nrfutil", line 8, in <module>
    sys.exit(cli())
  File "/home/tomas/.local/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/tomas/.local/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/tomas/.local/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/tomas/.local/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/tomas/.local/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/tomas/.local/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/tomas/.local/lib/python3.10/site-packages/nordicsemi/__main__.py", line 290, in serial
    dfu = Dfu(package, dfu_transport=serial_backend)
  File "/home/tomas/.local/lib/python3.10/site-packages/nordicsemi/dfu/dfu.py", line 66, in __init__
    self.manifest = Package.unpack_package(self.zip_file_path, self.unpacked_zip_path)
  File "/home/tomas/.local/lib/python3.10/site-packages/nordicsemi/dfu/package.py", line 368, in unpack_package
    return Manifest.from_json(_json)
  File "/home/tomas/.local/lib/python3.10/site-packages/nordicsemi/dfu/manifest.py", line 239, in from_json
    return Manifest(**kwargs['manifest'])
  File "/home/tomas/.local/lib/python3.10/site-packages/nordicsemi/dfu/manifest.py", line 223, in __init__
    SoftdeviceBootloaderFirmware(**softdevice_bootloader) if softdevice_bootloader else None
TypeError: SoftdeviceBootloaderFirmware.__init__() got an unexpected keyword argument 'info_read_only_metadata'

Im running Linux, Ubuntu 22 and I also have the RAKDAP1 to go back to Arduino (and that works fine).

Any help much appreciated!

Welcome to the forum @tomas

After you flashed the RUI3 bootloader, you have to flash the application with the nrfutil.exe, not with the adafruit-nrfutil.exe:

Thanks for the welcome and info @beegee !!

Well I have tried this to (on linux) and will do it again to paste the outcome.

Last run, still a problem…

$ adafruit-nrfutil --verbose dfu serial --package rui3_nrf52840_bootloader_latest.zip -p /dev/ttyACM0
Upgrading target on /dev/ttyACM0 with DFU package /home/tomas/Documents/Projekt/pyproj/rak-env/RUI3/rui3_nrf52840_bootloader_latest.zip. Flow control is disabled, Dual bank, Touch disabled
Opened serial port /dev/ttyACM0
Starting DFU upgrade of type 2, SoftDevice size: 0, bootloader size: 36184, application size: 0
Sending DFU start packet
Sending DFU init packet
Sending firmware file
########################################
###############################
Activating new firmware

DFU upgrade took 9.285885095596313s
Device programmed.
(rak-env) /RUI3$ nrfutil dfu serial --package rui3_rak4631_latest.zip -p /dev/ttyACM0
Traceback (most recent call last):
  File "/home/tomas/.local/bin/nrfutil", line 8, in <module>
    sys.exit(cli())
  File "/home/tomas/.local/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/tomas/.local/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/tomas/.local/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/tomas/.local/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/tomas/.local/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/tomas/.local/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/tomas/.local/lib/python3.10/site-packages/nordicsemi/__main__.py", line 290, in serial
    dfu = Dfu(package, dfu_transport=serial_backend)
  File "/home/tomas/.local/lib/python3.10/site-packages/nordicsemi/dfu/dfu.py", line 66, in __init__
    self.manifest = Package.unpack_package(self.zip_file_path, self.unpacked_zip_path)
  File "/home/tomas/.local/lib/python3.10/site-packages/nordicsemi/dfu/package.py", line 368, in unpack_package
    return Manifest.from_json(_json)
  File "/home/tomas/.local/lib/python3.10/site-packages/nordicsemi/dfu/manifest.py", line 239, in from_json
    return Manifest(**kwargs['manifest'])
  File "/home/tomas/.local/lib/python3.10/site-packages/nordicsemi/dfu/manifest.py", line 223, in __init__
    SoftdeviceBootloaderFirmware(**softdevice_bootloader) if softdevice_bootloader else None
TypeError: SoftdeviceBootloaderFirmware.__init__() got an unexpected keyword argument 'info_read_only_metadata'

edit: is there a .hex file for RUI3 fimware?

Yes, there is a hex file.
I never tried it with DAPLink. I am always using JLink.

Downloads ==> RAK4631_latest_final.hex

Thanks!

Flashing seems Ok, but no response on USB port after flashing!?

(rak-env) /RUI3$ pyocd pack -s
  Vendor                Pack                   Version  
--------------------------------------------------------
  NordicSemiconductor   nRF_DeviceFamilyPack   8.44.1   

(rak-env) /RUI3$ pyocd flash -t nrf52840 RAK4631_latest_final.hex
0000841 I Loading /home/tomas/Documents/Projekt/pyproj/rak-env/RUI3/RAK4631_latest_final.hex [load_cmd]
[==================================================] 100%
0036303 I Erased 521216 bytes (128 sectors), programmed 521216 bytes (128 pages), skipped 0 bytes (0 pages) at 14.52 kB/s [loader]

Try a chip-erase.
If that doesn’t work either, try to flash this
RAK4631-RUI3-V4.1.1-Flash-Dump.hex (2.4 MB)

1 Like

Solved after erasing !

14:18:28.815 -> AT+VER=RUI_4.1.1_RAK4631
14:18:28.815 -> OK