Just a question: How do i build the firmware for the RAK4631?
Following Building Meshtastic Firmware | Meshtastic worked well for the T-Beam for example. At the end of the build process, something like firmware.factory.bin is produced, which i can rename to say 2.0.12_TBeam.bin and flash that to my T-Beam. Fine.
However the RAK4631 (tutorial) asks for a .uf2 file.
I do not find that file. VSC generates a .zip file at the end of the build process which contains a file firmware.bin. Uploading this firmware to the 4631 does not work and also renaming to firmware.uf2 does not work.
Typically a ZIP file is flashed via āadafruit-nrfutilā such as done when updating the bootloader on NRF52 devices as covered here on RAK documentation
However the process of creating a UF2 file is derived from a HEX or BIN file and requires the use of a special command called uf2conv.py with specifc parameters
Copied onto the RAK FAT fs volume
BIN file
If using a .bin file with the conversion script you must specify application address with the -b switch, this address depend on the SoftDevice size/version e.g S140 v6 is 0x26000, v7 is 0x27000
While Iām sure the above method also works, I usually use the āUploadā button of the PlatformIO extension in VSCode (step 5 in your link). Just make sure the RAK is in bootloader mode by double-pressing the reset button after you connect it.
also worth noting @mark.birss is absolutely right. The uf2 file is generated from the hex file in our build process within gitlab. the right uf2conv.py is included in the firmware bin filder and you can have a peek in bin/build-nrf52.sh for the right parameter
Now, in addition:
How do i create the zip file for RAK4631 OTA updates? Can i simply use the ready to use OTA zip file and replace the firmware.bin file within that zip file? Or wonāt that work? If not, how is it done?
thereās a script ./bin/build-nrf52.sh that you can call that will build all the things you normally get from the release. Maybe have a read of that one.
I just noticed that the .zip file seems to be automatically generated during the build process within VSC. The .zip file can be found in .pio/build/rak4631.
But is that the one which is used for OTA updates?
It containes the same 3 files but my modified firmware.bin file has just 716 kB instead of the 733 kB of the original file (provided by the ready to use firmware).