Why is this resetting?
Posted: Fri Dec 08, 2017 9:52 pm
I'm running the following program, compiled in the Arduino IDE, on an NodeMCU 12e connected to my laptop via a USB cable, but otherwise not plugged into anything. This is of course just an example to illustrate the problem I have initializing the Wire library, not actual code I want to run.
And getting the following output:
This repeats every (approx) 6 seconds. Changing the 6s to 5s fixes the problem (except that I need to use pin 6).
My understanding is that setting the pinMode to OUTPUT is hanging, and the hardware watchdog is rebooting the device. But how can setting the pinMode hang?
Thanks!
Code: Select all
void setup() {
Serial.begin(115200);
Serial.println("here 0");
pinMode(6, INPUT);
Serial.println("here 1");
pinMode(6, OUTPUT);
Serial.println("here 2");
pinMode(6, INPUT_PULLUP);
Serial.println("here 3");
}
void loop() {
// Do nothing
}
And getting the following output:
Code: Select all
βΈ®here 0
here 1
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
v180000ca
~ld
This repeats every (approx) 6 seconds. Changing the 6s to 5s fixes the problem (except that I need to use pin 6).
My understanding is that setting the pinMode to OUTPUT is hanging, and the hardware watchdog is rebooting the device. But how can setting the pinMode hang?
Thanks!