๐Ÿ“ฃ๐Ÿ“ช ๐Ÿšš Adafruit will not be shipping USPS orders Monday October 14, 2019 ๐Ÿ—“. Expedited USPS orders placed after 11am ET ๐Ÿ•š Friday October 11 will go out Tuesday October 15 ๐Ÿ“ฃ๐Ÿ“ช๐Ÿšš
0

ESP8266 + RFM69 = ISR not in iram
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

ESP8266 + RFM69 = ISR not in iram

by probe on Sun Jul 14, 2019 9:04 am

I have a simple IOT device built upon the "Adafruit Feather HUZZAH ESP8266" which needs to receive data from a 900 Mhz source. I attached a "Adafruit RFM69HCW Transceiver Radio Breakout - 868 or 915 MHz", which works perfectly, ( debugged it using q "Metro"). When the ESP8266 attempts to reset the RFM69 during setup, I get an immediate crash with "ISR not in IRAM". This is presumable coming from the libraries. Are you aware of this problem? Is there a work around? Has anyone successfully used RFM69HCW breakout with the Adafruit Feather HUZZAH ESP6266?

I am stuck! Any help would be appreciated.

--- code fragment --
void setup()
{
Serial.begin(115200);

pinMode(RFM69_RST, OUTPUT);
digitalWrite(RFM69_RST, LOW);
delay(10);

Serial.println("ESP8266 RFM69 RX Startup!"); // ***** This is the last thing that I see, then it reboots with the ISR not in IRAM error.
Serial.println();

// manual reset
digitalWrite(RFM69_RST, HIGH); // ******** DIES HERE, not that I have not yet even attempted to make a wifi connection.
delay(10); // This same code works when running on a Metro.
digitalWrite(RFM69_RST, LOW);
delay(10);

if (!manager.init()) {
Serial.println("RFM69 radio init failed");
while (1);
}
Serial.println("RFM69 radio init OK!");
... // rest of setup elided
}

probe
 
Posts: 5
Joined: Sun Jul 22, 2012 1:39 pm

Re: ESP8266 + RFM69 = ISR not in iram

by probe on Mon Jul 15, 2019 7:00 pm

In the absence of any suggestions from you, I have been searching online and have found that this problem is well known and that it is the result of additional checking for non IRAM ISR's to avoid crashes. Since the ISR's are not mine but in the libraries, the solution lies in the other libraries. Other people have resorted to going bad to the version 2.4.2 (the problem was introduced in the 2.5.* versions. Is there a simple way for me to revert to the 2.4.2 version of the Adafruit Feather ESP8266 board version? The the Adafruit feather board include the ESP8266 code or can I down load the ESP8266 version 2.4.2 and then une the Adafruit Feather 8266 board which will in its turn use the ESP8266 code on my machine? Or do I need to revert to an earlier version of the Adafruit Feather ESP8266 board code? If so, how best to do that? Has anyone looked at finding the ISR's in the RFM69HCW code base in order to fix this problem (I am presuming, perhaps incorrectly, that that is where the problem lies). I could, perhaps, fork the RFM69HCW code base and try to localize the ISR's myself and add the appropriate prefix. If someone has already done some or any of these things, I would appreciate knowing about them, since I hadn't bargained on having to fix someone else's library and I certainly don't want to duplicate someone else's work. Anyway, please let me know what you know, even if it is nothing.

Paul

probe
 
Posts: 5
Joined: Sun Jul 22, 2012 1:39 pm

Re: ESP8266 + RFM69 = ISR not in iram

by probe on Tue Jul 16, 2019 8:19 am

OK, so no one is listening and no advice from anyone.

I found the solution that works perfectly without reverting to version 2.4.2. I'd be happy to share the solution with anyone who may be facing the same problem.

Obviously reverting to version 2.4.2 would be a pity because the result would be something that could crash. The fix added to Version 2.5.2 was a real fix and the 3rd party vendors need to ensure that the ISR's in their libraries follow the rules. The solution that I found is therefore more robust. I'm glad that I didn't follow the path of reverting to a prior version.

probe
 
Posts: 5
Joined: Sun Jul 22, 2012 1:39 pm

Re: ESP8266 + RFM69 = ISR not in iram

by o1grossman on Wed Aug 07, 2019 2:25 pm

I'm having this exact same issue with a very simple interrupt sketch. What is the fix so that I don't have to revert to 2.4.2?

o1grossman
 
Posts: 2
Joined: Tue Sep 18, 2018 6:12 pm

Re: ESP8266 + RFM69 = ISR not in iram

by probe on Wed Aug 07, 2019 3:16 pm

The problem is that the interrupt routines in the RFM69 library are not safe and the ESP8266 code now checks and forces a failure rather than let execution continue with the possibility of random runtime failures.

The solution is to fix the library. My code has now been running without a single failure for weeks.

The fix is to make every function that is an ISR or reachable from an ISR be proceeded by the ICACHE_RAM_ATTR attribute. Here (attached) is my modified copy of the RH_RF69.cpp file. You simply have to replace the file in .../Arduino/libraries/RadioHead-master/RH_RF69.cpp and recompile your sketch.

If you diff my version with the RadioHead original you will see what I had to change.
Let me know if it works for you -- or if it doesn't.

Good luck!

Paul
Attachments
RH_RF69.cpp
(20.15 KiB) Downloaded 28 times

probe
 
Posts: 5
Joined: Sun Jul 22, 2012 1:39 pm

Re: ESP8266 + RFM69 = ISR not in iram

by adafruit2 on Sat Aug 10, 2019 6:37 pm

probe, thanks - the compiler has changed - can you submit a PR? it would be helpful!

adafruit2
Site Admin
 
Posts: 18705
Joined: Fri Mar 11, 2005 7:36 pm

Please be positive and constructive with your questions and comments.