Wiki Search Terms
crash
Controller Board
any
Machine Description
any
Input Circuits
Configuration file
any
Startup Messages
N/A
User Interface Software
any
What happened?
A Discord user reported a crash <https://discord.com/channels/780079161460916227/1422346350145830933> whose backtrace suggested a FLASH cache instruction fetch failure during an ISR. The symbol was _ZNK3Pin16synchronousWriteEb, i.e. Pin::synchronousWrite(), and the address was in FLASH. Instructions accessed from an ISR must be in RAM. Pin::synchronousWrite() is declared as an inline method which would normally be okay since the code would be inlined in the calling context which would be in IRAM, but for some reason the compiler (as is its privilege) chooses to disregard the inline hint, creating a routine that ends up in FLASH.
The solution is to add IRAM_ATTR to both Pin::synchronousWrite() and Pin::write(), forcing the routine into IRAM should the compiler disregard the inline hint.
GCode File
No response
Other Information
No response