TTN Uno - RN2903 firmware upgrade

Hi, also confirming - I successfully updated a sodaq one to SA915 1.03 firmware using the instructions. It’s taken over 3 hours, using 2 sodaqs. I killed my first one because I read this: RN2483 / RN2903 Firmware upgrade guide – PocketMagic

It said “We need to extract out the combined HEX file (not the smaller offset)”
I did that, but the file looked different when I was using Notepad++ macro recorder to put the " ", around each line. I burned it anyway using the Arduino v1.4 tool called RN2483FirmwareUpdater by SodaqMoja, and it said success, but now the microchip RN2903 isn’t responding.
I’ll need to reprogram it directly, suppose this means soldering to the microchip, because I’m not desoldering it!

What you need to do if you use RN2483FirmwareUpdater is the opposite.
Use the smaller offset, not the larger combined hex file!!!

Here’s what I did, the general version:

RE: Updating Microchip module on Sodaq One Rev.4

Get updater sketch GitHub - SodaqMoja/RN2483FirmwareUpdater
expand to c:\users\username\Documents\ardunio
rename updater sketch folder (remove the -master bit at the end)
load sketch (double click on the sketch INO)
double check it opens & shows all files including hex files etc (should be about 15 tabs across the top!)
uncomment the file HEXFILE_RN2903AU_097rc7 in the HexFileImage.h file (It’s the second tab in Arduino software)
compile the sketch, confirm it’s good
plug in the sodaq, select the sodaq one, then select the com port
compile and send to arduino
Wait for confirmation
select the com port again (might have changed)
click tools, serial monitor
send the y command to the arduino
-update success!
close, reset & reopen the serial monitor
confirm in the serial monitor that it’s running v097
Repeat on all sodaqs, confirming they update to the ‘old’ version OK.

Now comes the hard bit. You need to incorporate the new version into the sketch. It’s slow to do so if you’re a noob like me, but I cracked it. Only problem was, I incorporated the wrong hex file… as I mentioned at the start. Here are correct instructions (well, they worked for me)

First is converting the .hex to a .h file, by sort of making it look like json or js.
Find the .hex file in RN2903.SA1.0.3.Hex.zip named RN2903_Parser.production.hex
If you don’t have RN2903.SA1.0.3.Hex.zip from a source, none of these instructions help you!

Open this hex file in notepad plus plus, save it straight away as HexFileImage2903AU_103.h
Also in notepad ++,
Open file HexFileImage2903_103.h from SodaqMoja/RN2483FirmwareUpdater GitHub zip
compare the two files

Your goal is to make the new HexFileImage2903AU_103.h look much like the old HexFileImage2903_103.h

Then use the macro recorder to make the changes to all lines.

Adding
" at the start of each line
", at the end of each line.
I found it worked well if I started macro recording at the top left hand side, and used END to the end of the line, then pressed right arrow to go to the next line, then stopped macro recording. Then you multi-run the macro (I think it’s a double play) and repeat to the end of the file. This way it only takes a few minutes to fix the whole .h file up.

Also, show all characters (reveal codes) to see the LF and LFCR at end of each line. Use the LF converter to ensure it’s only LF at the end of each line. Click edit, EOL conversion, Unix.
Copy and paste and rename the bits at the top and bottom of the file. I’ve included them here, as I’ve customized the names, and this ties in with another .ino file in the RN2483FirmwareUpdater folder.

Header of new .h file (after it’s had the " ", added and LF checked)

#ifndef HEXFILEIMAGE2903AU_103_H__
#define HEXFILEIMAGE2903AU_103_H__

#define HexFileImage RN2903AU_103
const char* const RN2903AU_103 = {

Footer of that same new .h file

};

#endif /* HEXFILEIMAGE2903AU_103_H__ */

Once this is done, compare again your two files, and they should be pretty much identical, apart from the actual hex code inside, and the names (The one we are working on is 103, but has AU in the name…)

SAVE the file :slight_smile:

Ok, now, one more file to edit. in hexfile.h (second tab across the top in the Arduino IDE), replace lines as per this. It’s essentially just adding support for our new AU_103 version of the .h hexfile

/*

  • HexFileImage.h
    */

#ifndef HEXFILEIMAGE_H_
#define HEXFILEIMAGE_H_

// Uncomment one of the following, and one only, not more, not less.
//#define HEXFILE_RN2483_101
//#define HEXFILE_RN2483_103
//#define HEXFILE_RN2483_104
//#define HEXFILE_RN2903AU_097rc7
#define HEXFILE_RN2903AU_103
//#define HEXFILE_RN2903_098
//#define HEXFILE_RN2903_103

#if defined(HEXFILE_RN2483_101)
#include “HexFileImage2483_101.h”
#elif defined(HEXFILE_RN2483_103)
#include “HexFileImage2483_103.h”
#elif defined(HEXFILE_RN2483_104)
#include “HexFileImage2483_104.h”
#elif defined(HEXFILE_RN2903AU_097rc7)
#include “HexFileImage2903AU_097rc7.h”
#elif defined(HEXFILE_RN2903AU_103)
#include “HexFileImage2903AU_103.h”
#elif defined(HEXFILE_RN2903_098)
#include “HexFileImage2903_098.h”
#elif defined(HEXFILE_RN2903_103)
#include “HexFileImage2903_103.h”
#else
#error “Please define one the the following: HEXFILE_RN2483_101, HEXFILE_RN2483_103, HEXFILE_RN2903AU_097rc7, HEXFILE_RN2903_098, HEXFILE_RN2903AU_103”
#endif

#endif /* HEXFILEIMAGE_H_ */

Logs from bad update - using wrong hex file: (just for interest)

  • Starting HEX File Image Verification…
    0% |||||||||||| 25% |||||||||||| 50% |||||||||||| 75% |||||||||||| 100%
    HEX File Image Verification Successful!

  • The module is in Application mode:
    RN2903AU 0.9.7rc7 Aug 11 2016 15:07:56

Ready to start firmware update…
Firmware Image: RN2903AU_103

Please press ‘c’ to continue…

  • Starting HEX File Image Verification…
    0% |||||||||||| 25% |||||||||||| 50% |||||||||||| 75% |||||||||||| 100%
    HEX File Image Verification Successful!

  • The module is in Application mode:
    RN2903AU 0.9.7rc7 Aug 11 2016 15:07:56

Ready to start firmware update…
Firmware Image: RN2903AU_103

Please press ‘c’ to continue…
Erasing firmware and attempting to start bootloader…

  • The module is in Bootloader mode.
    Bootloader Version: 101
    Device ID: 5424

  • Starting firmware update…
    0% Failed to upload the firmware. Please unplug and restart.

** SODAQ Firmware Updater **
Version 1.4

Press:

  • ‘b’ to enable bootloader mode
  • ‘d’ to enable debug
  • Starting HEX File Image Verification…
    0% |||||||||||| 25% |||||||||||| 50% |||||||||||| 75% |||||||||||| 100%
    HEX File Image Verification Successful!
    The module did not respond in application mode. Please unplug and retry in bootloader mode.
    The module did not respond in application mode. Please unplug and retry in bootloader mode.
    The module did not respond in application mode. Please unplug and retry in bootloader mode.
    The module did not respond in application mode. Please unplug and retry in bootloader mode.

completePage()
startNewPage(0x300000): starting at 0x300000
100%
completePage()
HEX File Image Verification Successful!
[initBootloader]
[applicationReset]
[expectApplicationString] expecting RN.The module did not respond in application mode. Please unplug and retry in bootloader mode.
[applicationReset]
[expectApplicationString] expecting RN.The module did not respond in application mode. Please unplug and retry in bootloader mode.
[applicationReset]
[expectApplicationString]

Logs from good update:

Before…

  • Starting HEX File Image Verification…
    0% |||||||||||| 25% |||||||||||| 50% |||||||||||| 75% |||||||||||| 100%
    HEX File Image Verification Successful!

  • The module is in Application mode:
    RN2903AU 0.9.7rc7 Aug 11 2016 15:07:56

Ready to start firmware update…
Firmware Image: RN2903AU_103

Please press ‘c’ to continue…
Erasing firmware and attempting to start bootloader…

  • The module is in Bootloader mode.
    Bootloader Version: 101
    Device ID: 5424

  • Starting firmware update…
    0% |||||||||||| 25% ||||||||

After…

  • Starting HEX File Image Verification…
    0% |||||||||||| 25% |||||||||||| 50% |||||||||||| 75% |||||||||||| 100%
    HEX File Image Verification Successful!

  • The module is in Application mode:
    RN2903 SA1.0.3 Jan 23 2018 14:56:26

Ready to start firmware update…
Firmware Image: RN2903AU_103

Please press ‘c’ to continue…

And there you have it.
An updated RN2903 now at SA1.0.3

This issue is all also touched on here

I am sure it’s much easier to use the LoRaSuite-windows-1.0.exe from https://www.microchip.com/Developmenttools/ProductDetails.aspx?PartNO=dv164140-2 (assume this is latest version?!) and a passthrough sketch. I’m going to try that now to fix the dead Sodaq One that I have…

If you try this,

Get the Lora development suit for windows
Install, but untick docker (only works on 32bit) & java (it’s an old version), read the readme, close.
Then install latest java
https://www.java.com/en/download/windows-64bit.jsp
Lastly, Using windows explorer go and run C:\Users\username\Microchip\LoRaSuite\Applications\LoRaDevUtility\LoRaDevUtility.jar

Put on some passthrough sketch, and maybe give the loradevutility a go. No idea if it’s going to work :wink:

x