Skip to content

[BUG] Workaround for ESP32 hw timer library calls not in IRAM. #1351

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

Merged
merged 2 commits into from
Dec 2, 2020

Conversation

crankyoldgit
Copy link
Owner

@crankyoldgit crankyoldgit commented Dec 1, 2020

  • Manipulate the ESP32 hw timers directly rather than through the library interface.

    • Fixes a crash (only) on the ESP32 platform.
    • Required because the following lib calls are not in IRAM by default.
      • timerWrite();
      • timerAlarmEnable()
    • This a horrible kludge/hack/mess!
  • Tested on a ESP8266 NodeMCU & a ESP32dev board. Working as expected.

Fixes #1350

* Fixes a crash on the ESP32 platform.
* Rename the global var `timer` to something that should not colide easily.
* Manipulate the ESP32 hw timers directly rather than through the library interface.
  - Required because the following lib calls are not in IRAM by default.
    * `timerWrite();`
    * `timerAlarmEnable()`
* This a horrible kludge/hack/mess!

Fixes #1350 (Hopefully!)
@crankyoldgit crankyoldgit added bug ESP32 ESP32 only issue Pending Confirmation Waiting for confirmation from user labels Dec 1, 2020
@crankyoldgit crankyoldgit requested a review from NiKiZe December 1, 2020 08:54
@crankyoldgit crankyoldgit self-assigned this Dec 1, 2020
@NiKiZe
Copy link
Collaborator

NiKiZe commented Dec 1, 2020

Could we have the timer rename part in a separate "safe" commit? And then have only the "kludge" here? That way any reverts are needed it would be cleaner?

* We'll do this in a separate commit/PR instead.

Ref: #1350
@crankyoldgit
Copy link
Owner Author

Could we have the timer rename part in a separate "safe" commit? And then have only the "kludge" here? That way any reverts are needed it would be cleaner?

Fair point. I've reverted the variable rename. I'll do it as a separate PR after we confirm it fixes the problem in #1350 & merge this one.

@crankyoldgit
Copy link
Owner Author

Confirmed fixed in #1350 (comment)

@crankyoldgit crankyoldgit removed the Pending Confirmation Waiting for confirmation from user label Dec 2, 2020
@crankyoldgit crankyoldgit merged commit 0d215e1 into master Dec 2, 2020
@crankyoldgit crankyoldgit deleted the Issue1350 branch December 3, 2020 23:16
crankyoldgit added a commit that referenced this pull request Jan 3, 2021
**[Bug Fixes]**
- SanyoAc: Fix Sensor Location error (#1359)
- IRMQTTServer: Compiler error under PlatformIO on Windows. (#1353 #1354)
- Workaround for ESP32 hw timer library calls not in IRAM. (#1350 #1351)

**[Features]**
- PANASONIC_AC32: Add limited detailed support. (#1364 #1366)
- Move global vars in IRrecv into a namespace. (#1350 #1352)
- Fujitsu: Handle toggles of Econo & Turbo when `IRac` interface is used. (#1334 #1345)

**[Misc]**
- Elitescreens: Update supported brands/models (#1375)
- refactor ir_Sharp (#1374)
- refactor ir_Sanyo (#1359)
- Gree: List Amana as supported. (#1361 #1363)
- Lasertag: Increase matching tolerance. (#1360 #1362)
- refactor ir_Samsung (#1358)
- refactor ir_Neoclima (#1349)
- Update issue templates (#1348 #1355)
- Midea: Update supported devices & add notes for an odd Pioneer System. (#1342 #1344)
- Kelvinator: Update supported models. (#1335 #1346)
@crankyoldgit crankyoldgit mentioned this pull request Jan 3, 2021
crankyoldgit added a commit that referenced this pull request Jan 4, 2021
## _v2.7.14 (20210103)_

**[Bug Fixes]**
- SanyoAc: Fix Sensor Location error (#1359)
- IRMQTTServer: Compiler error under PlatformIO on Windows. (#1353 #1354)
- Workaround for ESP32 hw timer library calls not in IRAM. (#1350 #1351)

**[Features]**
- PANASONIC_AC32: Add limited detailed support. (#1364 #1366)
- Move global vars in IRrecv into a namespace. (#1350 #1352)
- Fujitsu: Handle toggles of Econo & Turbo when `IRac` interface is used. (#1334 #1345)

**[Misc]**
- Elitescreens: Update supported brands/models (#1375)
- refactor ir_Sharp (#1374)
- refactor ir_Sanyo (#1359)
- Gree: List Amana as supported. (#1361 #1363)
- Lasertag: Increase matching tolerance. (#1360 #1362)
- refactor ir_Samsung (#1358)
- refactor ir_Neoclima (#1349)
- Update issue templates (#1348 #1355)
- Midea: Update supported devices & add notes for an odd Pioneer System. (#1342 #1344)
- Kelvinator: Update supported models. (#1335 #1346)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ESP32 ESP32 only issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ESP32 crashes with Guru Meditation Error: Core 1 panic'ed (Cache disabled but cached memory region accessed)
2 participants