sebmillet / RF433recv

Manage receiving codes from 433 Mhz RX device plugged on Arduino
GNU Lesser General Public License v3.0
6 stars 4 forks source link

Crashes on ESP8266 #6

Closed skorokithakis closed 1 year ago

skorokithakis commented 1 year ago

I'm trying to flash an ESP8266 with the example using Platformio, but I'm getting a crash at boot:

 ets Jan  8 2013,rst cause:2, boot mode:(3,7)

load 0x4010f000, len 3460, room 16 
tail 4
chksum 0xcc
load 0x3fff20b8, len 40, room 4 
tail 4
chksum 0xc9
csum 0xc9
v000432f0
~ld
Waiting for signal
                  ISR not in IRAM!

User exception (panic/abort/assert)
                                   --------------- CUT HERE FOR EXCEPTION DECODER ---------------

Abort called

>>>stack>>>

ctx: cont
sp: 3ffffec0 end: 3fffffc0 offset: 0000
3ffffec0:  74696157 20676e69 20726f66 6e676973  
3ffffed0:  000000fe 00000000 00000000 00000000  
3ffffee0:  00000000 00000000 00000000 00ff0000  
3ffffef0:  5ffffe00 5ffffe00 000007d0 3ffee59c  
3fffff00:  00000000 00000003 00000004 40202c9a  
3fffff10:  40100541 40201030 3ffef48c 40202cac  
3fffff20:  000002fe 00000000 00000004 402031be  
3fffff30:  000034f4 0000000c 3ffee534 40201fe4  
3fffff40:  3fffdad0 3ffee534 3ffee4e8 4020325c  
3fffff50:  0001c200 0000001c 00000000 40201b95  
3fffff60:  3fffdad0 3ffee534 3ffee4e8 40201108  
3fffff70:  0000019f 000002fe 00000000 00000000  
3fffff80:  0000032d 000034f4 0000000c 40201030  
3fffff90:  000007d0 feefeffe feefeffe feefeffe  
3fffffa0:  feefeffe 00000000 3ffee588 40202828  
3fffffb0:  feefeffe feefeffe 3ffe85dc 40100ed1  
<<<stack<<<

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

The "ISR not in IRAM!" error message in particular points to some changes to ESP Core regarding interrupt handling, but I don't know enough to fix that.

skorokithakis commented 1 year ago

Turns out I needed to declare IRAM_ATTR on handle_int_receive() in RF433recv.cpp:

void IRAM_ATTR handle_int_receive() {
sebmillet commented 1 year ago

Hello

could you post a pull-request that I could integrate to the code? This'd ease the work of others using ESP8266.

Reg, Sébastien Millet

skorokithakis commented 1 year ago

Sure, filed #7.

sebmillet commented 1 year ago

integrated in the code, thanks

skorokithakis commented 1 year ago

Thank you!

sebmillet commented 1 year ago

Hello

The result would not compile due to a gap between interrupt handler function declaration and definition with IRAM_ATTR. I just rewrote it. It compiles well in my case (Arduino, generation on Debian bullseye) Could you please re-test in your ESP8266 environment and confirm it compiles well?

Regards, Sébastien Millet