Skip to content

Suggest marking stopWaveForm with ICACHE_RAM_ATTR  #5247

Closed
@chyrtsik

Description

@chyrtsik

int stopWaveform(uint8_t pin) {

I had a problem with custom servo implementation. I am using hardware serial to parallel port extension. Needed to change servo implementation to send serial code for each servo pulse.
Code crashed in case eps is connecting to a wifi at the time when servo is active. If servo is activated after the connection, it works. If it is activated before the wifi connection (my device works with and without connection), it crashes (attached stac traces).

While debugging, I found, that the new ESP core (2.4.2) calls stopWaveForm in each call to a _digitalWrite. This new implementation (comparing to the pwm-one, the old one,

void ICACHE_RAM_ATTR pwm_stop_pin(uint8_t pin)
), does not have method marked with ICACHE_RAM_ATTR. Adding this section definition to a method fixed the crash for me.

Suggest to evaluate this change to be included in the esp core.

stacktrace.txt
stacktrace-parsed.txt

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions