Skip to content
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

esp8266: NMI not disabled when timer1 ISR cleared #2764

Merged
merged 4 commits into from
Apr 15, 2024

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Apr 12, 2024

Fixes #2763.

SDK doesn't actually disable NMI interrupts when interrupt callback cleared. This blocks regular (FRC) timer1 interrupts if subsequently enabled.

The HardwareTimer (timer1) appears to stop working if applications switch from using NMI interrupts to regular timer interrupts.

A more subtle manifestation of this bug is that the original NMI callback continues to be called when a different FRC handler is set.

TODO:

  • Check nothing else gets broken (e.g. Wifi)
  • Currently using SDK 3.0.3; does anything change in 3.0.4 or 3.0.5 ?

Copy link

what-the-diff bot commented Apr 12, 2024

PR Summary

  • Hardware Timer Interrupt Detachment
    A piece of code was added to the 'hw_timer1_detach_interrupt' function. This allows the system to disconnect or 'detach' a particular hardware timer's interrupt, improving the capability for managing hardware resources.

  • Definition of NMI_INT_ENABLE_REG
    A new line that articulates 'NMI_INT_ENABLE_REG' was incorporated into the file named eagle_soc.h. This line helps establish a standard for non-maskable interrupts, resulting in an enhanced system interaction with these interrupts.

@mikee47 mikee47 changed the title Disable NMI properly when interrupt cleared Disable esp8266 timer1 NMI when ISR cleared Apr 12, 2024
@mikee47 mikee47 changed the title Disable esp8266 timer1 NMI when ISR cleared esp8266: disable NMI when timer1 ISR cleared Apr 12, 2024
@mikee47 mikee47 changed the title esp8266: disable NMI when timer1 ISR cleared [WIP] esp8266: disable NMI when timer1 ISR cleared Apr 13, 2024
@mikee47 mikee47 changed the title [WIP] esp8266: disable NMI when timer1 ISR cleared esp8266: disable NMI when timer1 ISR cleared Apr 13, 2024
@mikee47 mikee47 changed the title esp8266: disable NMI when timer1 ISR cleared esp8266: NMI not disabled when timer1 ISR cleared Apr 13, 2024
@mikee47 mikee47 force-pushed the fix/nmi-interrupt-disable branch from 00ca13a to 9f55db9 Compare April 14, 2024 11:29
@slaff slaff added this to the 5.2.0 milestone Apr 15, 2024
@slaff slaff merged commit 895535e into SmingHub:develop Apr 15, 2024
46 checks passed
slaff pushed a commit that referenced this pull request Apr 15, 2024
SDK doesn't actually disable NMI interrupts when interrupt callback cleared. This blocks regular (FRC) timer1 interrupts if subsequently enabled.

The HardwareTimer (timer1) appears to stop working if applications switch from using NMI interrupts to regular timer interrupts.

A more subtle manifestation of this bug is that the original NMI callback continues to be called when a different FRC handler is set.
@mikee47 mikee47 deleted the fix/nmi-interrupt-disable branch April 15, 2024 09:45
@slaff slaff mentioned this pull request May 8, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HostTests stalling on esp8266 Waiting for timer1 callback test to complete
2 participants