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

Add ONEWIRE_MULTICORE flag to run in multi-core env #104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

heeres
Copy link

@heeres heeres commented Oct 28, 2021

I could not get the OneWire library working reliably on my ESP32 board while using both cores: WiFi stuff on core 0, main application on core 1. It seems the culprit is that flash is shared between both cores, and execution will stall when both cores have to access it. The solution is to make the critical functions live in RAM. Perhaps flash access could also result in improper timing in a single core situation, although I did not observe that.

- At least on ESP32, both cores access the same flash memory and
  therefore only disabling interrupts is not enough to guarantee proper
  timing. Setting the ONEWIRE_MULTICORE flag makes sure the critical
  functions live in RAM, so that no flash latency occurs during
  execution
@blazoncek
Copy link

Similar to #93
The IRAM_ATTR helps solve the temperature readings.

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.

2 participants