How to fix "ISR not in IRAM"

Foolishly i just did upgrade and i’m already having some issues with this when i try to upload one big project. I get this error “ISR not in IRAM” and the ESP8266 starts rebooting.

  1. Is there a way to revert the platform on the version before to avoid this issue?

I tried something like this but it didn’t help
https://github.com/platformio/platform-espressif8266.git@2.0.4

  1. Is there any bugfix for this?

thnx guys

Just platform = espressif8266@2.0.4 in your platformio.ini

Add ICACHE_RAM_ATTR as seen in Using interrupts with a Node MCU - Programming Questions - Arduino Forum from 2 months ago.

1 Like

For reference, it’s also mentioned in the v2.5.1 notes… although it is obscure…

  • ISR code must be in ICACHE_RAM (#6002)
  • ISR: check for address in IRAM (#5995)

Problem with ISR not IRAM in a WEMOS or ARDUION is that memory for that handle ISR interrupt must be reserved in a section DECLARATION for values in this way for example
void ICACHE_RAM_ATTR ServiceLimitSwitchUpperShield_12_D6();
// There are solved for ATTACHINTERRUPT - you must declare this before function SETUP (very important )
In a section SETUP you can define
attachInterrupt(digitalPinToInterrupt(12), ServiceLimitSwitchUpperShield_12_D6 , FALLING );

The method ServiceLimitSwitchUpperShield_12_D6 define for example
[[ichache_IRAM_ATTR]]
void ServiceLimitSwitchUpperShield_12_D6()

Take attention what memory is need for your souce code . This value give compilator.With abouve 32 KB may also occur problem . Choice MMU from Tools
as 32 KB cache + 32 KB IRAM (balanced ). You can try other option
de sp9auv