Access to RTC fast memory from core 1

eccessivo
Posts: 19
Joined: Tue Apr 14, 2020 4:38 pm

Access to RTC fast memory from core 1

Postby eccessivo » Sun Apr 04, 2021 5:30 pm

Hi All!
Here is the scenario:
I am using ESp32 wroom 32E with platformio and arduino framework.
In my code the most of the time the CPU is in deep sleep state.
When the wake up is triggered , it executes a customized wakeup stub that i wrote and that works perfectly. All the code and the variables used within the wakeup stub are placed in the RTC fast memory using "RTC_IRAM_ATTR".
When the processor is awake i would like to reuse all the function used in the wakeup stub but i get 'panic - illegal instruction crash.
The reason is that Arduino loop runs on core 1 and core 1 has no access to RTC fast memory but only through PRO cpu (core 0).
Is there a way to use a stub function also in the main loop?
Thanks to all for your help

eccessivo
Posts: 19
Joined: Tue Apr 14, 2020 4:38 pm

Re: Access to RTC fast memory from core 1

Postby eccessivo » Mon Apr 05, 2021 9:59 am

Please let me know if my question is stupid or too difficult or not so interesting or out of theme. So i can improve my contribution to this forum. My goal is always to find and share my solutions. Thank you.

ESP_Sprite
Posts: 9711
Joined: Thu Nov 26, 2015 4:08 am

Re: Access to RTC fast memory from core 1

Postby ESP_Sprite » Tue Apr 06, 2021 4:10 am

Well, to point out the obvious, you could start a task on core 0 to interface with your RTC_FAST stuff?

eccessivo
Posts: 19
Joined: Tue Apr 14, 2020 4:38 pm

Re: Access to RTC fast memory from core 1

Postby eccessivo » Tue Apr 06, 2021 8:39 am

Thank you ESP- sprite-. I found a work around without using the rtc functions from arduino loop. If you want to post an example here , of a function to make the rtc functions available to core one , all the other users can benefit of this .It Is something that i have not found during my extended searches.
Many thanks
Guido

Who is online

Users browsing this forum: No registered users and 34 guests