Skip to content

analogWrite causes reboot #4321

Closed
Closed
@yukini3

Description

@yukini3

Basic Infos

Although this issue is discussed and closed on #2238, this is still happening on my ESP8266s.

Hardware

Hardware: ESP-12
Core Version: 2.4.0

Description

analogWrite causes system reboot. To repro this problem, run the attached code and WAIT for a while. It happens randomly. Sometimes 10 minutes, somtimes few hours etc.

Settings in IDE

Module: Generic ESP8266 Module
Flash Size: 4MB/1MB
CPU Frequency: 80Mhz
Flash Mode: qio
Flash Frequency: 40Mhz?
Upload Using: OTA / SERIAL
Reset Method: ck / nodemcu

Sketch

#include <ESP8266WiFi.h>

#define PIN_LED 16

int fadeIncrement = 1;
int fadeValue = 0;
int showWiFi = 0;

void setup() {
  // put your setup code here, to run once:

  Serial.begin(115200);
  Serial.print("\n\nSDK Version=");
  Serial.println(ESP.getCoreVersion());
  
  pinMode(PIN_LED, OUTPUT);
  analogWriteRange(100);
  analogWrite(PIN_LED, 0);  

  WiFi.begin("YOURSSID","YOURPASS");
  
}

void loop() {
  // put your main code here, to run repeatedly:
  analogWrite(PIN_LED,fadeValue);
  fadeValue += fadeIncrement;
  if (fadeValue > 100) {
    fadeValue = 100;
    fadeIncrement = -1;
  } else if (fadeValue < 0) {
    fadeValue = 0;
    fadeIncrement = 1;
  }
  delay(10);

  if (WiFi.status() == WL_CONNECTED && showWiFi == 0) {
    Serial.print("WiFi Connected. IP=");
    Serial.println(WiFi.localIP());
    showWiFi = 1;
  }
}

Debug Messages

SDK Version=2_4_0
WiFi Connected. IP=192.168.10.157

 ets Jan  8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v4ceabea9
~ld


SDK Version=2_4_0
WiFi Connected. IP=192.168.10.157


Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions