-->
Page 1 of 2

Assistance: Incapable to upload a single sketch in Arduino.

PostPosted: Fri Jun 16, 2017 9:56 am
by Fleming
Hi,
I would like to ask for some help… as I am new in this platform and declaring myself stupid… not been able to run a single sketch in Arduino.
What is happening, is that after upload a sketch (normally he wify Scan or the blink), when I press reset, I cannot see anything in the serial, and after a couple of seconds, the WDT resets the chip…
IF I try the uploading the same sketch with the ModeMCU board (V1.0 or V0.9) everything works perfectly.
So that’s the boards:
-I have around several ESP-12E, adquired in different moments of time (Ebay, DealExtreme and Bangood), so I marked them with letters, so I have
--Batch A: 10 units (tested around 5)
--Batch B: 2 Units (Tested 2)
--Batch C: 1 Unit (Tested 1)
--Bath D: 2 Units (not tested yet)
--Two ModeMCU V1.0 (samples tested and working properly)
--Two ModeMCE V0.9 (Samples tested and working Propoerly)
-Most of them (batch A and B) has 100uF Electrolytic capacitor for the spikes and ceramic capacitor for filtering (I also have some ESP-12E with the electrolic capacitor soldered to VCC and GND.
-I rely on the power supply (see pictures) as it can deliver a couples of amps without problem.
-I did not tested the power supply with the oscilloscope (TO-DO)
-Trials done on Windows 7, 10 and XP using Arduino v1.8.2(portable, non-administrator mode) and ESP Arduino core V2.3.0 (I also tried with the V2.2.0)


I am almost one month trying different circuits and connections: wires, solderless breakout boards and finally soldered breakout boards, alqays with the same. The latest one is the one bellow.
Its following the ModeMCU v0.9… with only one resistor for pulling-up/down (15k resistor… the ones that I has around) …. I realised that for the ModeMCU v1.0 there are a low ohm resistor before the gGND/VCC (don’t know the reason)
PHOTOS OF MY SETUP
I also added bouncing capacitor to the reset button.

The modules work perfectly before flashing them with Arduino, they are responsive to the AT commands. For example, here bellow some info before and after uploading the Arduino Sketch:

Code: Select allets Jan  8 2013,rst cause:2, boot mode:(3,6)
load 0x40100000, len 1396, room 16
tail 4
chksum 0x89
load 0x3ffe8000, len 776, room 4
tail 4
chksum 0xe8
load 0x3ffe8308, len 540, room 4
tail 8
chksum 0xc0
csum 0xc0

2nd boot version : 1.4(b1)
  SPI Speed      : 40MHz
  SPI Mode       : DIO
  SPI Flash Size & Map: 8Mbit(512KB+512KB)
jump to run user1 @ 1000


Then, In the arduino I select te Board ModeMCU V1.0 (ESP-12E) (I also Tried with ModeMCU V0.9), and I got this:
Code: Select allSketch uses 226729 bytes (21%) of program storage space. Maximum is 1044464 bytes.
Global variables use 31936 bytes (38%) of dynamic memory, leaving 49984 bytes for local variables. Maximum is 81920 bytes.
C:\Users\Fleming\Documents\ArduinoData\packages\esp8266\tools\esptool\0.4.9/esptool.exe -vv -cd nodemcu -cb 115200 -cp COM3 -ca 0x00000 -cf C:\Users\Fleming\AppData\Local\Temp\arduino_build_334125/WiFiScan.ino.bin
esptool v0.4.9 - (c) 2014 Ch. Klippel <ck@atelier-klippel.de>
   setting board to nodemcu
   setting baudrate from 115200 to 115200
   setting port from COM1 to COM3
   setting address from 0x00000000 to 0x00000000
   espcomm_upload_file
   espcomm_upload_mem
   setting serial port timeouts to 1000 ms
opening bootloader
resetting board
trying to connect
   flush start
   setting serial port timeouts to 1 ms
   setting serial port timeouts to 1000 ms
   flush complete
   espcomm_send_command: sending command header
   espcomm_send_command: sending command payload
   read 0, requested 1
trying to connect
   flush start
   setting serial port timeouts to 1 ms
   setting serial port timeouts to 1000 ms
   flush complete
   espcomm_send_command: sending command header
   espcomm_send_command: sending command payload
   espcomm_send_command: receiving 2 bytes of data
   espcomm_send_command: receiving 2 bytes of data
   espcomm_send_command: receiving 2 bytes of data
   espcomm_send_command: receiving 2 bytes of data
   espcomm_send_command: receiving 2 bytes of data
   espcomm_send_command: receiving 2 bytes of data
   espcomm_send_command: receiving 2 bytes of data
   espcomm_send_command: receiving 2 bytes of data
Uploading 230880 bytes from C:\Users\Fleming\AppData\Local\Temp\arduino_build_334125/WiFiScan.ino.bin to flash at 0x00000000
   erasing flash
   size: 0385e0 address: 000000
   first_sector_index: 0
   total_sector_count: 57
   head_sector_count: 16
   adjusted_sector_count: 41
   erase_size: 029000
   espcomm_send_command: sending command header
   espcomm_send_command: sending command payload
   setting serial port timeouts to 15000 ms
   setting serial port timeouts to 1000 ms
   espcomm_send_command: receiving 2 bytes of data
   writing flash
................................................................................ [ 35% ]
................................................................................ [ 70% ]
..................................................................               [ 100% ]
starting app without reboot
   espcomm_send_command: sending command header
   espcomm_send_command: sending command payload
   espcomm_send_command: receiving 2 bytes of data
closing bootloader
   flush start
   setting serial port timeouts to 1 ms
   setting serial port timeouts to 1000 ms
   flush complete


After flashing, they enter in the WDT reset loop,
Code: Select all ets Jan  8 2013,rst cause:4, boot mode:(3,7)
wdt reset
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v09f0c112
~ld


I can reprogram them, also I can flash the AT firmware and they work properly, So I discard a corrupt eeprom, I mean, the ESP bootloader is responsive.

The sequence that I am following is the next.
Code: Select all1-Plug USB-Serial adapter (only ground shared and it’s 3.3v ttl)
2-I provide power
3-Run Arduino
4-On the boards manager, I choose or Generic ESP8266 or ESP12-E (ModeMCU v1) or ESP-12 (ModeMCU V0.9), doesn’t matter.
5-I press the Prog button, and then the reset button, and the release the two buttons. I notice in the serial that the chip enters in mode (1,7) or (1.6)
6-I click on the “Upload Scketch”  a the Arduino, then the lights start flashing, and when completed the three bars (35%, 70%, 100%)
7-Then I press reset button
8-Then WDT reset loop.


I also tried inverting 5 and 6. Maybe I am doing something wrong in this sequence. Is there any additional configuration on the Arduino?

Also, sometimes, when I choose the generic ESP8266 board, I play with the options, and it happens that when I am uploading the sketch it get stuck in the last bar:
Code: Select all............................................................................... [ 35% ]
................................................................................ [ 70% ]
.................................................................   read 0, requested 1
warning: espcomm_send_command: didn't receive command response
warning: espcomm_send_command(FLASH_DOWNLOAD_DATA) failed
warning: espcomm_send_command: wrong direction/command: 0x01 0x03, expected 0x01 0x04
closing bootloader
   flush start
   setting serial port timeouts to 1 ms
   setting serial port timeouts to 1000 ms
   flush complete
error: espcomm_upload_mem failed
error: espcomm_upload_mem failed



And again, after I reset… WDT reset Loop:
Code: Select allets Jan  8 2013,rst cause:4, boot mode:(3,7)

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


Any tip, indication, help or guidance will be more than welcome… What I am doing wrong??
Thanks a lot for your support.

Regards.

Re: Assistance: Incapable to upload a single sketch in Ardui

PostPosted: Sat Jun 17, 2017 8:44 pm
by atexit8

Re: Assistance: Incapable to upload a single sketch in Ardui

PostPosted: Sat Jun 17, 2017 10:48 pm
by rudy
Confirm with a meter that GPIO15 is pulled low. GPIO0 and GPIO2 are at a high level. That Reset and CH_PD are both high.

I don't use a momentary switch on GPIO0 to switch between modes. I use either a jumper pin (shorted for programming) or a latching push button switch. When the boot loader finishes loading the code it executes it and it doesn't matter that GPIO0 is still low. (unless I am using it in the current program)

Many of my boards are soldered on the same crappy white boards you are using. But I have an on board regulator along with additional capacitors on it. I have never used those boards with an external 3.3 volt supply.

I have had problems with some regulators even when they were soldered to the back of those boards. It would work often but I would get crashing problems. It was only after I brought them to work and scoped the power pin on the module did I find there was a glitch on the power line. The glitch was causing crashing problems.

I am concerned about using large value electrolytic capacitors to provide the surge current. They often have to high an impedance at high frequencies. I use a multi stage approach. 0.1uF in parallel with a 10uF ceramic cap in parallel with a 68uF tantalum cap. All as close as possible to the Vcc and gnd pins on the module.

See viewtopic.php?f=6&t=11068&start=4

With your setup I would take a module and solder a tantalum cap from the Vcc pin and the negative of the cap soldered right onto the metal shield of the module. It is a ground point. I would keep the wire length of the cap as short as possible. That's what I would do, but the -ve wire of the cap soldered to the gnd pad should do.

I just use the generic setup. 4M with 1M SPIFFS, QIO, flash freq 40Mhz, CPU freq 80MHz.

Load the blink sketch. Have that run for a while.

Re: Assistance: Incapable to upload a single sketch in Ardui

PostPosted: Sun Jun 18, 2017 10:41 am
by rudy
I can reprogram them, also I can flash the AT firmware and they work properly,


That makes me think it would be a wrong configuration problem when programming with an Arduino sketch.