i am using esp8266 to calculate the rpm using hall 3144 sensor, and while doing so there is an issue arises in code.
void exti_callback()
{
Serial.println("working");
}
void setup() {
pinMode(D1,INPUT);
attachInterrupt(digitalPinToInterrupt(D1),exti_callback,FALLING);
Serial.begin(115200);
}
void loop() {
Serial.println("Not working");
}
upon further investigation i understand that this specific line
attachInterrupt(digitalPinToInterrupt(D1),exti_callback,FALLING);
of code is giving me error. Earlier i was using D2 pin and was still facing the same error so i thought i am using wrong pin to get the interrupt so i change that pin to pin D1 but same error still persists. How did i know that this line is giving me error because if i comment out this line, whole code works perfectly, and void loop () also starts to work fine then.
I have even tried using different baud rate, different upload rate but the issue persists. I have even change the USB cable, USB port and what not but still error came. This is the error.
load 0x4010f000, len 3424, room 16
tail 0
chksum 0x2e
load 0x3fff20b8, len 40, room 8
tail 0
chksum 0x2b
csum 0x2b
v00041f10
~ld
⸮⸮⸮⸮o쒜p⸮⸮n|⸮l⸮⸮$`b⸮⸮|r⸮$⸮o⸮⸮o⸮
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
this same error is keep getting generated again and again.
I have even tried using different baud rate, different upload rate but the issue persists. I have even change the USB cable, USB port and what not but still error came.
EDIT#1
I tried your Button code as said by @MartinR its giving same error. But i have made a progress
int flag = 0;
void ICACHE_RAM_ATTR hallInterrupt();
void setup() {
Serial.begin(115200);
pinMode(D5, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(D5), hallInterrupt, FALLING);
}
void loop() {
Serial.println(flag);
delay(500);
}
void hallInterrupt()
{
flag = 1;
delay(500);
}
this code at least run without giving the previous error but still this code unable to enter the interrupt function. I mean to say that this code is printing 0, but as soon i provide some interrupts to hall sensor using magnets it's giving me new kind of hex numberical error.

ICACHE_RAM_ATTRattribute (meaning to run it from RAM). Read documentation on interrupt. 2) addvolatileto the declaration offlagto avoid it from being over-optimized away by the compiler.