Skip to content

ResetInfo->reason is 6 (REASON_EXT_SYS_RST) even on power up #3266

Closed
@Ognian

Description

@Ognian

Basic Infos

Hardware

Hardware: ESP-12E
Core Version: master @ 85078f4
SDK version 2.0.0 (656edbf)

Description

Load the following sketch into a nodemcu v.1.0; After 5 seconds you will see the output

myResetInfo->reason 6 

this is (maybe) correct since after an upload a reset is triggered.
BUT
disconnect the USB cable, close the serial monitor, connect the USB cable (power on again) and quickly open the serial monitor, you will still see

myResetInfo->reason 6 

but it should be 0 (REASON_DEFAULT_RST)
And no, it is not a hardware problem since with the nodemcu firmware (lua) the reason is read correct...
I suspect the SDK you are using ESP8266 NONOS SDK V2.0.0 patch 20160809but there is a later one used by nodemcu firmware ESP8266 NONOS SDK V2.0.0 20160810

Do you have a better idea?
Please help
Thanks
Ognian

Settings in IDE

Module: nodemcu v.1.0
Flash Size: 4MB
CPU Frequency: 80Mhz
Flash Mode: dio?
Flash Frequency: 40Mhz
Upload Using: SERIAL
Reset Method: nodemcu

Sketch

extern "C" {
#include <user_interface.h> // https://github.com/esp8266/Arduino actually tools/sdk/include
}

void checkForResetButtonPressed() {
    rst_info *myResetInfo;
    delay(5000); // slow down so we really can see the reason!!
    myResetInfo = ESP.getResetInfoPtr();
    Serial.printf("myResetInfo->reason %x \n", myResetInfo->reason); // reason is uint32
    Serial.flush();
}

void setup() {
    // put your setup code here, to run once:
    Serial.begin(115200);
    Serial.println("------");

    checkForResetButtonPressed();
}

void loop() {
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions