Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardware ISR not working with git master branch (2018-06-27) #4866

Closed
1 task done
Marc-Vreeburg opened this issue Jun 29, 2018 · 5 comments
Closed
1 task done

Hardware ISR not working with git master branch (2018-06-27) #4866

Marc-Vreeburg opened this issue Jun 29, 2018 · 5 comments

Comments

@Marc-Vreeburg
Copy link

Marc-Vreeburg commented Jun 29, 2018

Basic Infos

  • [ x] This issue complies with the issue POLICY doc.
  • [x ] I have read the documentation at readthedocs and the issue is not addressed there.
  • [ x] I have tested that the issue is present in current master branch (aka latest git).
  • [x ] I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • [x ] I have filled out all fields below.

Platform

  • Hardware: [ESP-12|
  • Core Version: [2018-06-27]
  • Development Env: [Arduino IDE 1.8.5]
  • Operating System: [Windows 10]

Settings in IDE

  • Module: [Generic ESP8266 Module and Nodemcu]
  • Flash Mode: [qio]
  • Flash Size: [4MB]
  • lwip Variant: [v2 both Lower Memory and Higher Bandwidth]
  • Reset Method: [ck]
  • Flash Frequency: [40 and 80Mhz]
  • CPU Frequency: [80Mhz and 160MHz]
  • Upload Using: [OTA and SERIAL]
  • Upload Speed: [115200]

Problem Description

Using arduino esp8266 core 4.2.1 hardware ISR's work fine. However this core has got a memory leakage problem which seems to be solved in latest git/current master branch. So i used latest git/current master branch. However with latest git hardware ISR's do not seem to work anymore. Esp8266 keeps resetting when interruptpin is connected to a pulsecounter. Disconnecting the pulsecounter from the interruptpin stops esp8266 from resetting.
Going back to arduino esp8266 core 4.2.1 (no hardware changes) and flashing same sketch results in hardware ISR working again (no resets with the pulsecounter connected to the interruptpin).

###Esp8266 log

Exception (28):
epc1=0x401067d9 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: cont 
sp: 3ffffc10 end: 3fffffd0 offset: 01a0

>>>stack>>>
3ffffdb0:  3ffef9dd 00000000 3ffef9a8 4021980c  
3ffffdc0:  00000005 00000000 00000020 40100f22  
3ffffdd0:  3ffe9685 4010431f 3ffed110 622f3c3e  
3ffffde0:  40101c3d 3ffed110 00000020 40100f22  
3ffffdf0:  0000001c 00852cf0 3ffedb40 40101e0e  
3ffffe00:  4010678e 00000000 00000000 40104bfd  
3ffffe10:  e0030025 00852cf0 4010224e 00000100  
3ffffe20:  00000000 00000000 0000001f 00000022  
3ffffe30:  3fffc200 40106754 3fffc258 4000050c  
3ffffe40:  40000662 00000030 00000010 ffffffff  
3ffffe50:  401065dc 00867c52 00000000 4bc6a7f0  
3ffffe60:  00000000 00000000 00000000 3fe00000  
3ffffe70:  00000000 00100000 00000000 4bc6a7f0  
3ffffe80:  00000000 00867c52 00000000 00000030  
3ffffe90:  40202b07 00000030 00000010 ffffffff  
3ffffea0:  402041e5 00002266 0000ea5f 00000000  
3ffffeb0:  3ffe9490 00000000 40590000 00000000  
3ffffec0:  00000000 00000000 00000000 3ffef02c  
3ffffed0:  00000000 3ffef490 00000000 00000030  
3ffffee0:  00000000 3ffef490 00000000 00000030  
3ffffef0:  3ffeef90 00000005 3fff07a4 401006dc  
3fffff00:  3ffeef90 3fff07a4 3ffeef24 402060fe  
3fffff10:  4020151a 00000005 3fff07a4 4020586f  
3fffff20:  00000000 4bc6a7f0 3ffef02c 4020c694  
3fffff30:  00000000 4bc6a7f0 a49ba5e3 00000000  
3fffff40:  00867c52 00000000 4bc6a7f0 00000000  
3fffff50:  00000000 3fff07a4 401065dc 4bc6a7f0  
3fffff60:  00000000 3ffef23c 00000000 00000000  
3fffff70:  0027cec6 7fdf224d 3fff05f4 4020643b  
3fffff80:  3ffef490 3ffef1c4 3ffef23c 3ffef05c  
3fffff90:  3ffef490 3ffef064 3ffef23c 402042fa  
3fffffa0:  00000000 00000000 00000001 3ffef578  
3fffffb0:  3fffdad0 00000000 3ffef570 4020c204  
3fffffc0:  feefeffe feefeffe 3ffe860c 40100739  
<<<stack<<<

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

load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v00000000
~ld
Debug exception 28:
28 | LoadProhibitedCause | A load referenced a page mapped with an attribute that does not permit loads | Region Protection or MMU | Yes

###Code

const int digitalPin4 = 4;

void ICACHE_RAM_ATTR pulsecount()
{
   ISR code here .....
}

void setup()
{
   pinMode(4, INPUT_PULLUP);
   attachInterrupt(digitalPinToInterrupt(4), pulsecount, FALLING);
}
@Marc-Vreeburg
Copy link
Author

Got Exception Decoder working so here's the result of the stacktrace:

0x40213957: ethernet_output at /local/users/gauchard/arduino/arduino_esp8266/origin/tools/sdk/lwip2/builder/lwip2-src/src/netif/ethernet.c line 305
0x40213960: ethernet_output at /local/users/gauchard/arduino/arduino_esp8266/origin/tools/sdk/lwip2/builder/lwip2-src/src/netif/ethernet.c line 305
0x40100f22: pp_post at ?? line ?
0x4010431f: lmacRxDone at ?? line ?
0x40101c3d: trc_NeedRTS at ?? line ?
0x402198e4: etharp_output_to_arp_index at /local/users/gauchard/arduino/arduino_esp8266/origin/tools/sdk/lwip2/builder/lwip2-src/src/core/ipv4/etharp.c line 768
0x40101e0e: trc_NeedRTS at ?? line ?
0x401067ca: interrupt_handler at C:\Users\marc\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/core_esp8266_wiring_digital.c line 138
0x40100f22: pp_post at ?? line ?
0x40106790: interrupt_handler at C:\Users\marc\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/core_esp8266_wiring_digital.c line 132
0x40106642: millis at C:\Users\marc\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/core_esp8266_wiring.c line 183
0x4010662d: millis at C:\Users\marc\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/core_esp8266_wiring.c line 180
0x402061ea: WiFiServer::available(unsigned char*) at C:\Users\marc\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\libraries\ESP8266WiFi\src/WiFiServer.cpp line 115
0x4020151a: delay at C:\Users\marc\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/core_esp8266_wiring.c line 54
0x40205957: ClientContext::unref() at C:\Users\marc\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\libraries\ESP8266WiFi\src/WiFiClient.cpp line 92
0x4010662d: millis at C:\Users\marc\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/core_esp8266_wiring.c line 180
0x40106648: millis at C:\Users\marc\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/core_esp8266_wiring.c line 183
0x40202ca9: loopwerk_klok() at C:\Users\marc\AppData\Local\Temp\arduino_modified_sketch_678291/Wifi_pulscounter_electriciteit_zp_net_waddinxveen_192_27-6-2018.ino line 441
0x402041f9: loop at C:\Users\marc\AppData\Local\Temp\arduino_modified_sketch_678291/Wifi_pulscounter_electriciteit_zp_net_waddinxveen_192_27-6-2018.ino line 1294
0x4020c320: loop_wrapper at C:\Users\marc\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/core_esp8266_main.cpp line 125
0x40100739: cont_wrapper at C:\Users\marc\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/cont.S line 81

Stacktrace:

Exception (28):
epc1=0x40106815 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: cont 
sp: 3ffffc40 end: 3fffffd0 offset: 01a0

>>>stack>>>
3ffffde0:  00000001 00000080 3ffedb4c 40101e0e  
3ffffdf0:  3ffe9f54 0cbf0c3f 00002200 4000050c  
3ffffe00:  3fffc278 40101fe8 3fffc200 00000022  
3ffffe10:  3ffe9f6c 3ffe9f54 3ffe9f54 00000001  
3ffffe20:  4000dd11 00000030 00000010 ffffffff  
3ffffe30:  401067ca 0cbf153f 4bc6a7f0 00000cbf  
3ffffe40:  c0034025 0ea66fca 408f4000 00000000  
3ffffe50:  00000000 00000000 085c8c10 00000022  
3ffffe60:  3fffc200 40106790 3fffc258 4000050c  
3ffffe70:  401065ff 00000030 00000010 ffffffff  
3ffffe80:  401065ed 00000000 3ffef3cc 00000000  
3ffffe90:  00004bc6 00000000 408f4000 00000000  
3ffffea0:  00000000 00000000 00000000 3ffef298  
3ffffeb0:  3ffef0a8 0cbf6312 3ffef0a0 00000030  
3ffffec0:  00004bc6 00000000 408f4000 00000000  
3ffffed0:  00000000 00000000 00000000 3ffef0c0  
3ffffee0:  00000000 3ffef4e8 3ffef0b8 00000030  
3ffffef0:  3fffdab0 00000000 3fffd9d0 3ffef5d0  
3fffff00:  00000000 00000000 3ffeef54 402061ea  
3fffff10:  00000000 3fffdad0 3ffef5d0 00000030  
3fffff20:  00000000 4bc6a7f0 3ffef068 4020c7b0  
3fffff30:  00000000 4bc6a7f0 53b645a1 00000000  
3fffff40:  00000000 00000000 4bc6a7f0 00000000  
3fffff50:  00000000 3fff1064 40106648 0003436d  
3fffff60:  00000000 3ffef298 00000000 00000000  
3fffff70:  03c5f668 00000000 3fff064c 40206527  
3fffff80:  3ffef4e8 3ffef1f4 3ffef298 3ffef0a0  
3fffff90:  3ffef4e8 3ffef0a8 3ffef298 40204406  
3fffffa0:  00000000 00000000 00000001 3ffef5d0  
3fffffb0:  3fffdad0 00000000 3ffef5c8 4020c320  
3fffffc0:  feefeffe feefeffe 3ffe8620 40100739  
<<<stack<<<

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

load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v00000000
~ld

@arihantdaga
Copy link

Something wrong in this commit - 641c5cd In my local git clone if i revert this commit then everything is working fine again..

@d-a-v
Copy link
Collaborator

d-a-v commented Jul 2, 2018

@arihantdaga can you retry master with this patch and report ?

if (localArg->interruptInfo)

@Marc-Vreeburg
Copy link
Author

I can confirm that the suggested solution works for me as well!

d-a-v added a commit to d-a-v/Arduino that referenced this issue Jul 2, 2018
(fix proposed by @shimarin, verified by @marcvtew esp8266#4866)
@d-a-v d-a-v mentioned this issue Jul 2, 2018
@arihantdaga
Copy link

@d-a-v Working good with this patch... (y)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants