I am trying to use the LoRa Development Utility on macOS to update the firmware on my RN2903 to SA1.0.3 using this hex file. Unfortunately no devices are found.
My current setup is as follows:
Operating system: macOS Mojave 10.14.2
Board: Adafruit RN2903 Featherwing
MCU within RN2903: PIC18LF46K22
Programmer: PICkit 3
Here is a screenshot of my current LoRa Development Utility:
I installed this by following this tutorial by signmon. Do note that when installing Java8, I had to enter an additional line
brew tap caskroom/versions
brew cask install java8
And when wanting to read the logs from the LoRa Development Utility, I had to cd into the LoRaDevUtility.
cd /Users/lachlanetherton/Microchip/LoRaSuite/Applications/LoRaDevUtility/
/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home/bin/java -jar LoRaDevUtility.jar
This opens the LoRa Development Utility, however no devices come up, so when I click “Find Devices” I get this output in my terminal. This happens for every press of that button, however take note that it takes a couple of seconds for the java lines to appear:
Tool List Refereshed
No Server in List
2019-01-12 15:37:10.792 java[11094:275055] unrecognized type is 4294967295
2019-01-12 15:37:10.792 java[11094:275055] *** Assertion failure in -[NSEvent _initWithCGEvent:eventRef:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1671.20.108/AppKit.subproj/NSEvent.m:1969
2019-01-12 15:37:10.887 java[11094:278303] -[NSPersistentUIWindowSnapshotter writeWindowSnapshot:length:width:height:bytesPerRow:toFile:inDirectory:encryptingWithKey:uuid:checksum:fd:]: 0 == ftruncate(fd, finalFileSize) failed on line 797: No such file or directory
2019-01-12 15:37:10.888 java[11094:278303] -[NSPersistentUIWindowSnapshotter writeWindowSnapshot:length:width:height:bytesPerRow:toFile:inDirectory:encryptingWithKey:uuid:checksum:fd:]: 0 == ftruncate(fd, fileLength) failed on line 868: No such file or directory
Thanks to some help from sighmon, we determined that the first two java error lines relate to a bug as described in the following links:
- java - Assertion failure in NSEvent? - Stack Overflow
- Focus and unfocus JavaFX application leads to "Assertion failure" on macOS Mojave using Java 8 - Stack Overflow
From my understanding, these do little more than clog the console. What I don’t understand however are the 3rd and 4th error lines.
Interestingly enough, I went into MPLAB X IDE to test if I could read the PIC18LF46K22. I was able to after troubleshooting and this is what I did. I have also described the process below:
- Create a new project
- I selected the MCU as the
PIC18LF46K22
- When setting up the project, I could see the PICkit 3 and its serial number being
BUR124107786
- MPLAB X IDE gave me a choice of complier toolchains to select from. These included:
C18
HI-TECH PICC18-PRO
HI-TECH PICC18-STD
mpasm
however the only one with a green circle next to it, which was the one I selected was:
mpasm (v5.82) [/Applications/microchip/mplabx/v5.10/mpasmx]
- Right clicked on the project name and clicked properties
- Clicked PICkit 3
- Clicked “Power” under Option categories
- Ticked the box next to “Power target circuit from PICkit 3”*
I then clicked “Read Device Main Memory Main Project” and got this in the PICkit 3 output:
Connecting to MPLAB PICkit 3...
Currently loaded firmware on PICkit 3
Firmware Suite Version.....01.54.00
Firmware type..............PIC18F
Programmer to target power is enabled - VDD = 3.250000 volts.
Target device PIC18LF46K22 found.
Device Revision ID = 4
Reading...
The following memory area(s) will be read:
program memory: start address = 0x0, end address = 0xffff
configuration memory
EEData memory
User Id Memory
Read complete
*If I didn’t change this setting, I got the following output in the PICkit 3 output:
Target device was not found (could not detect target voltage vdd). You must connect to a target device to use PICkit 3.
I have read articles which describe how macOS does not work with the LoRa Development Utility well, however in all instances they seem to be able to detect the device. Here is a link to a forum post I read similar to this.
I also have tried opening LoRaDevUtility.jnlp in the LoRaDevUtility directory, however I get this error:
Thinking about it, the errors that I described above were related to Java and if the LoRa Development Utility is unable to access this file due to new security restrictions, these errors may arise. So I went into the Java Control Panel in my security preferences and changed the “Exception Site List” such that https://www.microchip.com/ and/or http://ww1.microchip.com/downloads/en/DeviceDoc/LoRaSuite-osx-1.0.zip is included. I then tried to reopen the file and got the same error.
So, I uninstalled the LoRa Development Utility and reinstalled it. I then got this error:
Runtime error. Click for details.
Application Error
General Exception
Name: lora.LoRa
ExitException[3]com.sun.deploy.net.FailedDownloadException: Unable to load resource: file:/Users/lachlanetherton/Microchip/LoRaSuite/Applications/LoRaDevUtility/lib/RXTXcomm.jar
I then installed RXTX from here and installed it as follows:
RXTXcomm.jar goes in /Library/Java/Extensions
librxtxSerial.jnilib goes in /Library/Java/Extensions
I also put RXTXcomm.jar in:
/Users/lachlanetherton/Microchip/LoRaSuite/Applications/LoRaDevUtility/lib
But I ended up at the same place with the Java security blocking it, even when I tried:
javaws LoRaDevUtility.jnlp
in my terminal. I’m assuming that I must have had it installed previously.
According to Java on this webpage:
Starting with Java 8 Update 20, the Medium security level has been removed from the Java Control Panel. Only High and Very High levels are available.
The exception site list provides users with the option of allowing the same applets that would have been allowed by selecting the Medium option but on a site-by-site basis therefore minimising the risk of using more permissive settings.
As previous testing shows, after giving an exception to Microchip’s website, LoRaDevUtility.jnlp was still blocked. This means that I didn’t believe the medium security level and the exception site list were the same, so I decided to downgrade.
I first of all tried to install Java 7 Update 80 (the last version of Java 7), but the LoRa Development Utility requested that I install a newer version of Java.
I then tried install the last update before Java 8 Update 20, being Java 8 Update 11, however got this error:
This is a known bug, which is reported here, but due to new permission changes with macOS, even though it is possible, it has become much harder to change the OS version.
Unless you are very experienced with this type of stuff, do NOT try changing your macOS version by accessing SystemVersions.plist. You are entering a world of problems if you stuff it up and IMO it is not worth it. It is very easy to get the device stuck in a boot loop, as shown below:
If you do end up in a situation such as this, you will have to end up resetting your computer, either by reinstalling the OS or wiping the drive.
If you have files on your computer, you can install macOS on an external hard drive, boot into it and copy your files over. After that, either attempt to reinstall macOS or erase the drive and start over again. It’s not too hard of a process, but is time consuming.
I have found an article by @leogaggl about installing the LoRa Development Utility for Linux here, however the install process seems a bit different, so I’ll give that one a shot and see how I go.
At this point, I’m lost. If anyone would be able to help, I would really appreciate it.