Skip to content

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

Open
heeres wants to merge 1 commit intoPaulStoffregen:masterfrom
heeres:master
Open

Add ONEWIRE_MULTICORE flag to run in multi-core env#104
heeres wants to merge 1 commit intoPaulStoffregen:masterfrom
heeres:master

Conversation

@heeres
Copy link
Copy Markdown

@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
Copy Markdown

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