So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By DDRSimon
#73181 Hello guys,

I'm new to the ESP8266.

I have an ESP-12F (supposedly) that seems to work ok when I flash an AT firmware, but It won't run my own programs.

I've written a very simple sketch:
Code: Select all// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin
  pinMode(9, OUTPUT);
  Serial.begin(115200);
  Serial.println("Start..");
}

// the loop function runs over and over again forever
void loop() {
  Serial.println("Pouet");
  digitalWrite(9, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);              // wait
  digitalWrite(9, LOW);    // turn the LED off by making the voltage LOW
  delay(100);              // wait
}


which is supposed to blink and print stuff. However when I upload it to the ESP, nothing happens.
After poweroff/power on, I get watchdogs error:
Code: Select all ets Jan  8 2013,rst cause:4, boot mode:(3,5)

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




Are there any parameters that could be set wrong when building the sketch that would explain this behaviour ?

Thanks.
User avatar
By NickLD
#73205 The first thing that comes to mind is that your boot pins aren't correctly configured (GPIO 0,2, and 15).

Are you using a dev board or one of the raw modules??

Second though is that it might be Flash corruption, but I feel that might be a bit unlikely.
User avatar
By DDRSimon
#73224
NickLD wrote:The first thing that comes to mind is that your boot pins aren't correctly configured (GPIO 0,2, and 15).

Are you using a dev board or one of the raw modules??

Second though is that it might be Flash corruption, but I feel that might be a bit unlikely.



Thanks for your reply.

I'm using a raw module. I'm fairly confident now that my GIO pins are set up correctly because they originally were not (I was not aware of GPIO15) and I could not talk to the bootloader. But now that part works.

Tonight I've tried using esptool.py instead of the esptool that shipped with the Arduino stuff.
Well the results are the same, sadly. I can't boot my own program. I tried a NodeMCU build, and that also did not work. But surprisingly flashing a file named AiThinker_ESP8266_DIO_32M_32M_20160615_V1.5.4.bin works.

I tried verifying the flash contents using esptool.py.
The verification is OK just after the flash but is NOT OK after power off/power on or even only a reset.

Code: Select all
simon@nordiste:~/essais/arduino-1.8.5/tools/esptool$ ./esptool.py --port /dev/ttyUSB0 write_flash -fm dio --verify 0x0000 /tmp/arduino_build_568335/blink.c.ino.bin
esptool.py v2.3-dev
Connecting........_____...
Detecting chip type... ESP8266
Chip is ESP8266EX
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Flash params set to 0x0240
Compressed 253952 bytes to 184893...
Wrote 253952 bytes (184893 compressed) at 0x00000000 in 16.4 seconds (effective 124.0 kbit/s)...
Hash of data verified.

Leaving...
Verifying just-written flash...
(This option is deprecated, flash contents are now always read back after flashing.)
Flash params set to 0x0240
Verifying 0x3e000 (253952) bytes @ 0x00000000 in flash against /tmp/arduino_build_568335/blink.c.ino.bin...
-- verify OK (digest matched)
Hard resetting...

*** HERE I DO RESET OR POWER OFF ***
Code: Select allsimon@nordiste:~/essais/arduino-1.8.5/tools/esptool$ ./esptool.py --port /dev/ttyUSB0 verify_flash 0x0000 /tmp/arduino_build_568335/blink.c.ino.bin
esptool.py v2.3-dev
Connecting.....
Detecting chip type... ESP8266
Chip is ESP8266EX
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Verifying 0x3e000 (253952) bytes @ 0x00000000 in flash against /tmp/arduino_build_568335/blink.c.ino.bin...
-- verify FAILED (digest mismatch)

A fatal error occurred: Verify failed.