RUI3 firmware upgrade

RAK4631R

I’m trying to update the firmware on a couple of 4631R that were bought some time ago. The aim here was to see of the application loading I’m struggling with is consistent across hardware. The first step is to try to have consistent hardware.

I first tried the WisToolBox (1.4.7) but it has trouble finding the device, even when I tell it what to look for, and the firmware that it thinks is the latest isn’t

Then I tried following RAK4631-R WisBlock LoRaWAN Module DFU | Firmware & Bootloader Update. but ran into its own problems.

After this, the Arduino load is just “No ping response”

@beegee, could you please point me to the tools and files I should be using.

I’m not even 100% certain that the CPU modules are RUI3 version. The packaging says they are, but I’ve run foul of this before and I’m hoping to avoid needing to solder the headers.

Thanks

(1) WisToolBox is not able to update bootloader/softdevice, it can only update firmware of RUI3 devices.

(2) Tools
I am using exactly the tools that are listed in our guides

However, if at some point something went wrong like

  • mix of wrong bootloader with wrong softdevice
  • missing softdevice

the only way to recover the devices is to use JLINK or DAPLink.

// so I am following the “Updating RAK4631 to RUI3” guide

The command:

./adafruit-nrfutil-macos --verbose dfu serial --package rui3_nrf52840_bootloader_latest.zip -p /dev/cu.usbmodem14101 -b 115200 --singlebank --touch 1200

results in an error

The last line says

FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/n2/d5q87fd15gq73p4_zmg18p0h0000gn/T/nrf_dfu_626u48d2/unpacked_zip/manifest.json'

[23375] Failed to execute script __main__

In the downloaded zip that is linked in the instructions there IS a manifest.json file, along with along with a couple of files from 2022.

image

Is that still the correct zip file?

I’m back to having a working download again.

Note to future readers (very likely me again 6 months from now):

When Ozone is refusing to load the pre canned Flash Dump file, and complaining about not having a working TDO line, that is the clue that the target config has lost the detail that it should be using SWD rather than JTAG.

Just start the New Project Wizard and set it up again.

Yes, it is a valid file, I was using the same:

As you have a JLink, I would stop using the serial update approaches.

I am using RUI3-Backup.hex to make a device a RUI3 device and _Arduino-Backup.hex to make a device an Arduino device through JLink.

RUI3-Backup.hex (2.4 MB)
Arduino-Backup.hex (2.4 MB)

The Jlink is part of my attempted migration to a debugger solution too.

There is now a new set of errors all about LoRa configuration.

/Users/markjeffree/Library/Arduino15/packages/rak_rui/hardware/nrf52/4.2.2/cores/nRF5/component/service/nvm/service_nvm.c: In function 'service_nvm_set_default_config_to_nvm':
/Users/markjeffree/Library/Arduino15/packages/rak_rui/hardware/nrf52/4.2.2/cores/nRF5/component/service/nvm/service_nvm.c:175:13: error: 'g_lora_mac_nvm_data' undeclared (first use in this function)
  175 |     memset(&g_lora_mac_nvm_data,0,sizeof(lora_mac_nvm_data_t));
      |             ^~~~~~~~~~~~~~~~~~~
/Users/markjeffree/Library/Arduino15/packages/rak_rui/hardware/nrf52/4.2.2/cores/nRF5/component/service/nvm/service_nvm.c:175:13: note: each undeclared identifier is reported only once for each function it appears in
/Users/markjeffree/Library/Arduino15/packages/rak_rui/hardware/nrf52/4.2.2/cores/nRF5/component/service/nvm/service_nvm.c:175:42: error: 'lora_mac_nvm_data_t' undeclared (first use in this function)
  175 |     memset(&g_lora_mac_nvm_data,0,sizeof(lora_mac_nvm_data_t));
      |                                          ^~~~~~~~~~~~~~~~~~~

etc

Any advice on where to fix this?

How and where did you define this variable?
Is it global?

==>

error: 'g_lora_mac_nvm_data' undeclared (first use in this function)

Is not mine. I’m not doing anything with LoRa at all.

All the errors are in:

nrf52/4.2.2/cores/nRF5/component/service/nvm/service_nvm.c

And all the errors are wrapped in “LORA_STACK_104”

which must have recently become defined somehow.

Ah ha. At the start of service_nvm.c is are these lines:

So if SUPPORT_LORA is not defined, the g_lora_mac_nvm_data variable will not be defined. But this is the only time that LORA_STACK_104 is wrapped.

I think this is a bug.

Can you share your project (privately).
I can’t see that problem.
What are your settings in Arduino IDE for the device?