Search found 4 matches

by sgmustadio
Mon Mar 08, 2021 8:43 pm
Forum: ESP32 Arduino
Topic: Weird scheduling issue when using spinlocks in critical section with multiple cores
Replies: 4
Views: 3602

Re: Weird scheduling issue when using spinlocks in critical section with multiple cores

Thank you! That helps to make sense of what's going on. I moved the critical section to Core 1, and it worked as expected (as Core 0 could still update the timer variable). I also changed the toggle time to 30 ms for Core 0 so it's more noticeable on the scope. Next, I added critical section markers...
by sgmustadio
Sun Mar 07, 2021 3:11 pm
Forum: ESP32 Arduino
Topic: Weird scheduling issue when using spinlocks in critical section with multiple cores
Replies: 4
Views: 3602

Re: Weird scheduling issue when using spinlocks in critical section with multiple cores

In some instances, yes, it is crashing with a "Guru Meditation Error: Core 1 panic'ed (LoadProhibited)" when I had Serial.print statements in the other core (inside a similar critical section). I didn't know that Serial usage was not allowed inside the critical sections at all, so thank you for that...
by sgmustadio
Sat Mar 06, 2021 11:54 pm
Forum: ESP32 Arduino
Topic: Weird scheduling issue when using spinlocks in critical section with multiple cores
Replies: 4
Views: 3602

Weird scheduling issue when using spinlocks in critical section with multiple cores

This may or may not be related to my watchdog timer issue in this thread( https://esp32.com/viewtopic.php?f=2&t=19752 ), but it seems different enough that I decided to post it here anyway. I'm working with the following demo code (for illustrating how spinlocks work). // Core definitions (assuming ...
by sgmustadio
Thu Mar 04, 2021 5:04 am
Forum: General Discussion
Topic: Issue with spinlocks and interrupt watchdog timer reset
Replies: 0
Views: 2127

Issue with spinlocks and interrupt watchdog timer reset

Hi all, I'm creating a demonstration to show how spinlocks can be used to block tasks in a different core (for a video about multicore programming). I recognize that waiting in an ISR is terrible practice, but I found it useful for this particular demonstration. In the code below, I have an ISR peri...