Skip to content

Basic_Tasks sample gets watchdog resets on esp32#2975

Merged
slaff merged 2 commits intoSmingHub:developfrom
mikee47:fix/basic-tasks-sample
Sep 17, 2025
Merged

Basic_Tasks sample gets watchdog resets on esp32#2975
slaff merged 2 commits intoSmingHub:developfrom
mikee47:fix/basic-tasks-sample

Conversation

@mikee47
Copy link
Copy Markdown
Contributor

@mikee47 mikee47 commented Sep 16, 2025

Task queue gets hammered so needs additional consideration for esp32.

There's also an issue with having a static ElapseTimer inside an interrupt service routine because the constructor gets called on first use from ISR, which is problematic and leads to unpredictable crashing-type behaviour.

Closes #2971

@what-the-diff
Copy link
Copy Markdown

what-the-diff bot commented Sep 16, 2025

PR Summary

  • Incorporated Watchdog Timer Reset feature for ESP32 architecture
    A new line of code has been added to prevent the system from prematurely interrupting lengthy tasks. This addition aids in preserving tasks that require significant processing time from being cut short due to system's in-built timeout mechanism.

Non-trivial static variables may require an initialisation routine
which is invoked on first call. This happens in the `hwTimerCallback`
routine when the `ElapseTimer` constructor is called, but that is unsafe
to do from interrupt context.

Moving this to a global variable fixes the issue.

The exception may vary, but I'm getting:

```
assert failed: xQueueSemaphoreTake queue.c:1718 (!( ( xTaskGetSchedulerState() == ( ( BaseType_t ) 0 ) ) && ( xTicksToWait != 0 ) ))
```
@slaff slaff merged commit 98e9f4d into SmingHub:develop Sep 17, 2025
48 of 49 checks passed
@mikee47 mikee47 deleted the fix/basic-tasks-sample branch September 17, 2025 08:41
@slaff slaff mentioned this pull request Dec 16, 2025
5 tasks
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

Successfully merging this pull request may close these issues.

Services/Profiling/CpuUsage doesn't work on esp32c3

2 participants