Basic Infos
Platform / Settings in IDE
Deleted because doesn't matter here (any of these should lead to the same result AFAIK, but happy to provide if necessary.)
Problem Description
interruptFunctional in FunctionInterrupt should probably have the ICACHE_RAM_ATTR attribute set. Right now it appears the function is linked into the normal flash section. And because this is (always) called from an ISR that will fail.
|
void interruptFunctional(void* arg) |
|
{ |
|
ArgStructure* localArg = (ArgStructure*)arg; |
|
if (localArg->functionInfo->reqScheduledFunction) |
|
{ |
|
schedule_function(std::bind(localArg->functionInfo->reqScheduledFunction,InterruptInfo(*(localArg->interruptInfo)))); |
|
// scheduledInterrupts->scheduleFunctionReg(std::bind(localArg->functionInfo->reqScheduledFunction,InterruptInfo(*(localArg->interruptInfo))), false, true); |
|
} |
|
if (localArg->functionInfo->reqFunction) |
|
{ |
|
localArg->functionInfo->reqFunction(); |
|
} |
|
} |
#include <Arduino.h>
#include <FunctionalInterrupt.h>
void setup() {
// doesn't work reliably, my guess the function is pre-cached somehow and so
// no interrupt for reading it into cache needs to be called?
// I don't have the experience to say.
attachInterrupt(D1, [](){}, CHANGE);
}
void loop() {}
Exception decode
See full stacktrace here: esphome/issues#61 (comment) (original report)
The important part is here:
[15:17:04]Exception (0):
WARNING Exception type: unknown
[15:17:04]epc1=0x4020a208 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000
WARNING Decoded 0x4020a208: interruptFunctional(void*)
- Exception type 0 likely means the usual
ICACHE_RAM_ATTR error.
- epc1 is 0x4020a208 - not
0x4010C000 as seen here.
- epc1 also gets decoded to
interruptFunctional - so the error is likely there (I don't think the compiler can inline anything here)
Basic Infos
Platform / Settings in IDE
Deleted because doesn't matter here (any of these should lead to the same result AFAIK, but happy to provide if necessary.)
Problem Description
interruptFunctionalinFunctionInterruptshould probably have theICACHE_RAM_ATTRattribute set. Right now it appears the function is linked into the normal flash section. And because this is (always) called from an ISR that will fail.Arduino/cores/esp8266/FunctionalInterrupt.cpp
Lines 14 to 26 in 9790e1c
MCVE Sketch
Exception decode
See full stacktrace here: esphome/issues#61 (comment) (original report)
The important part is here:
ICACHE_RAM_ATTRerror.0x4010C000as seen here.interruptFunctional- so the error is likely there (I don't think the compiler can inline anything here)