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

Fails with ESP32 - solution provided #14

Open
hsgentry opened this issue Mar 26, 2018 · 2 comments
Open

Fails with ESP32 - solution provided #14

hsgentry opened this issue Mar 26, 2018 · 2 comments

Comments

@hsgentry
Copy link

I have used this library many times with the ESP2866 with excellent results. I recently ported a project to the ESP32. It worked about 90% of the time, but occasionally it would crash with:"Guru Meditation Error: Core 1 panic'ed (Cache disabled but cached memory region accessed)". I also use preferences.h to store data in NV ram. The crash was caused by an interrupt from the touch screen while preferences was saving data to NV ram. I added IRAM_ATTR to the interrupt service routine in the .cpp file in the touch library.

Changed:
void isrPin( void )

to:
void IRAM_ATTR isrPin( void )

and the touch library is now 100% reliable on the ESP32.

The development environment is Arduino IDE 1.8.2

touch library version 1.20

@CelliesProjects
Copy link
Contributor

CelliesProjects commented Jun 11, 2018

Good catch!

https://esp-idf.readthedocs.io/en/v2.0/general-notes.html#iram-instruction-ram

I may have the same issue here.
Guru Meditation Error: Core 1 panic'ed (Cache disabled but cached memory region accessed)

I will try your fix and report back.

@nrdmtt
Copy link

nrdmtt commented Nov 11, 2019

The same issue is present when this lib is used with an ESP8266 using latest toolchain version.

The solution is to expand the #ifdef statement to

#ifdef ESP32
void IRAM_ATTR isrPin( void )
#elif ESP8266
void ICACHE_RAM_ATTR isrPin ( void )
#else
void isrPin( void )
#endif

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