Search found 53 matches

by apuder
Thu Sep 05, 2019 2:20 pm
Forum: General Discussion
Topic: RTOS running on one core only
Replies: 37
Views: 57868

Re: RTOS running on one core only

The synchronization between the cores is definitely related to NVS access. I saw that when the ESP performs a core dump, it can write to NVS *without* syncing with the second core. In another thread I asked the question if I could use the same trick: https://esp32.com/viewtopic.php?f=2&t=10901 Someo...
by apuder
Mon Jun 10, 2019 2:27 pm
Forum: General Discussion
Topic: Turning off interrupts on core 1
Replies: 13
Views: 19853

Re: Turning off interrupts on core 1

Forgot to mention that on core 1 I do not call any ESP-related API; only memory-mapped I/O on some GPIO pins. So I know that core 1 is not doing anything with SPI.
by apuder
Mon Jun 10, 2019 2:53 am
Forum: General Discussion
Topic: Turning off interrupts on core 1
Replies: 13
Views: 19853

Re: Turning off interrupts on core 1

If I wanted to continue to use NVS API on core 0, would it be OK to call

Code: Select all

spi_flash_guard_set(&g_flash_guard_no_os_ops);
after turning off interrupts on core 1?
by apuder
Thu Jun 06, 2019 9:48 pm
Forum: General Discussion
Topic: Turning off interrupts on core 1
Replies: 13
Views: 19853

Turning off interrupts on core 1

Hi. I want to use core 1 to poll GPIO pins in a tight loop. In order for fastest response, I am turning off interrupts on core 1 (read this post for a rationale for doing this: https://esp32.com/viewtopic.php?f=2&t=10006). Turning off interrupts on core 1 via portDISABLE_INTERRUPTS() and disabling t...
by apuder
Wed Jun 05, 2019 11:13 pm
Forum: General Discussion
Topic: RTOS running on one core only
Replies: 37
Views: 57868

Re: RTOS running on one core only

more digging: the problem seems to be indeed related to IPC. I logged esp_ipc_call() for core 1 and I was surprised how much code is executed on that core. E.g., calling nvs_flash_init() will trigger esp_ipc_call() on core 1. If interrupts are disabled on core 1 at that moment, then the ESP32 will j...
by apuder
Wed Jun 05, 2019 6:48 pm
Forum: General Discussion
Topic: RTOS running on one core only
Replies: 37
Views: 57868

Re: RTOS running on one core only

followup to my own question. portDISABLE_INTERRUPTS() only disables interrupts on the core where that function is called. So in the scenario discussed here, interrupts on core 0 are still enabled. However, I have noticed that FreeRTOS will create an "ipc" task on core 1. I wonder if disabling interr...
by apuder
Wed Jun 05, 2019 2:59 am
Forum: General Discussion
Topic: RTOS running on one core only
Replies: 37
Views: 57868

Re: RTOS running on one core only

Thanks for the nice explanations. I have been trying the same thing. I have a question about portDISABLE_INTERRUPTS(): does this turn off interrupts only on the core where that function is called or turn off interrupts for both cores? I am calling this function on core 1, but then I noticed some unu...
by apuder
Tue Jun 04, 2019 7:21 pm
Forum: General Discussion
Topic: Disable all interrupts on a core
Replies: 4
Views: 11081

Re: Disable all interrupts on a core

thx! Exactly what I've been looking for!
by apuder
Tue Jun 04, 2019 3:59 pm
Forum: General Discussion
Topic: Disable all interrupts on a core
Replies: 4
Views: 11081

Re: Disable all interrupts on a core

I am using an ESP to serve the I/O bus of an old 8-bit CPU (a Z80). The ROM running on the Z80 sometimes runs a tight loop where it constantly polls the I/O bus. I want to make serving the Z80's I/O bus as deterministic as possible by dedicating one core to that task. That core will constantly poll ...
by apuder
Tue Jun 04, 2019 4:12 am
Forum: General Discussion
Topic: Disable all interrupts on a core
Replies: 4
Views: 11081

Disable all interrupts on a core

Hi,
is there a way to disable all interrupts on a core? I was looking for an assembly instruction that would do that but cannot find one.
TIA,
AP