Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] ESP8266: Able to flash but no program execution

Status
Not open for further replies.

Ifgad

Newbie level 5
Joined
Jul 22, 2023
Messages
9
Helped
0
Reputation
0
Reaction score
1
Trophy points
3
Activity points
65
I everyone,

I designed a PCB based on the ESP8266EX dotn here is the schematic:

1701960276425.png


1701960337814.png


1701960345797.png

To flash the board I use the module: https://joy-it.net/de/products/SBC-ESP8266-PROG
I am able to flash the board with Arduino IDE with a simple code:

C++:
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  Serial.println("OK");
}
void loop() {
  // put your main code here, to run repeatedly:
  Serial.println("OK");
  delay(1000);
}

Result of the flashing:

1701960425557.png


But when I open the serial monitor, nothing happens.

All the pins of the 8-pin connector are connected respectively to the Joy-it module.

Flash configuration :
  • Card Type: Generic ESP8266 Module"
  • Upload Speed: "57600
  • CPU Frequency: "160 MHz
  • Crystal Frequency: "40 MHz
  • Flash Size: "4MB (FS:3MB OTA:~512KB)"
  • Flash Mode: "DIO"
  • >Flash Frequency
I've tried different flash configurations without success.

I wonder if it's a connection problem between CHIP_EN and RST pin.

Flash datasheets: https://datasheet.lcsc.com/lcsc/2201121400_HTCSEMI-HT25WD40ARZ_C2928800.pdf

ESP8266EX datasheet: https://www.espressif.com/sites/default/files/documentation/0a-esp8266ex_datasheet_en.pdf
 

Solution
I tried flashing the ESP in DOUT instead of DIO, and it seems to work!
Reading the flash memory datasheet, I'd understood that you had to flash in DIO...
Sorry for this silly mistake and thank you very much for your help.
You are probably starting up in bootloader mode.
GPIO0 and GPIO2 must be high at reset or power-up to put it in normal execution mode. Add resistors from both pins to VDD and it should work. 10K to 22K would be good values and big enough that they won't affect normal pin functions.
If I remember correctly, at boot, the state of GPIO15 decides whether startup messages are sent out of the serial port.

Brian.
 

You are probably starting up in bootloader mode.
GPIO0 and GPIO2 must be high at reset or power-up to put it in normal execution mode. Add resistors from both pins to VDD and it should work. 10K to 22K would be good values and big enough that they won't affect normal pin functions.
If I remember correctly, at boot, the state of GPIO15 decides whether startup messages are sent out of the serial port.

Brian.
Hi, thanks for the response.
I've tried what's you suggest:
GPIO0 --> 10K --> 3.3V
GPIO2 --> 10K --> 3.3V

but no more result.
 

Hi,

and be sure to have the correct UART setup in serial monitor.

Klaus
 

It all looks OK, it should work.

Just a thought, the switch on the "joy-it" board switches between programming mode and UART mode but to make it work you have to unplug the USB and reconnect it. Simply flicking the switch will not change mode. Is that what you have done?

Another point, in respect of the previous post, are you using using a 26MHz crystal for Y1? Any other frequency will produce the wrong baud rate.

Brian.
 

It all looks OK, it should work.

Just a thought, the switch on the "joy-it" board switches between programming mode and UART mode but to make it work you have to unplug the USB and reconnect it. Simply flicking the switch will not change mode. Is that what you have done?

Another point, in respect of the previous post, are you using using a 26MHz crystal for Y1? Any other frequency will produce the wrong baud rate.

Brian
Yes I do it right that way for the joy it board.

My crystal is 40MHz, but it’s a supported frequency for ESP8266EX. When I flash my board, I choose the 40MHz parameter in Arduino IDE.

I really don’t understand what’s wrong here…
 

Try this experiment please:
Connect via the joy-it board in UART mode and run a serial terminal program. Then, temporarily short out C8 so the reset line is grounded. when the short is removed, the ESP8266 should send some debugging information through its UART0 TX pin. The baud rate will probably be wrong but you should see some garbled characters. The actual baud rate varies according to the bootloader program, common values are 9600, 74880 and 115200.

I am trying to establish whether the bootloader is still running, if it is in normal mode the message should appear, in bootloading mode it will be missing.

If that doesn't help, can you post a photograph of the PCB please.

Brian.
 

Try this experiment please:
Connect via the joy-it board in UART mode and run a serial terminal program. Then, temporarily short out C8 so the reset line is grounded. when the short is removed, the ESP8266 should send some debugging information through its UART0 TX pin. The baud rate will probably be wrong but you should see some garbled characters. The actual baud rate varies according to the bootloader program, common values are 9600, 74880 and 115200.

I am trying to establish whether the bootloader is still running, if it is in normal mode the message should appear, in bootloading mode it will be missing.

If that doesn't help, can you post a photograph of the PCB please.

Brian.
I have a readable output at 115200:

load 0x4010f000, len 3424, room 16
tail 0
chksum 0xef
load 0x00000000, len 0, room 8
tail 0
chksum 0xef
csum 0xef
csum err
ets_main.c

So I presume it's already in normal mode..
 
Last edited by a moderator:

Hi,

did you read "csum err"?
I don´t know what this means, but "err" does not sound good.

Klaus
 


The pin numbers are directly on the ESP8266 IC, not on any development board. This is why I asked for the photograph, it takes considerable skill to design a PCB around the ESP8266 IC because of it's size, speed and 2.4GHz WiFi output. The schematic looks OK but layout will be critical.

Nevertheless, the fact that a debug message was produced at reset means the UART pins are correct.

Brian.
 

I tried flashing the ESP in DOUT instead of DIO, and it seems to work!
Reading the flash memory datasheet, I'd understood that you had to flash in DIO...
Sorry for this silly mistake and thank you very much for your help.
 
Solution
Always happy to help! Thank you for giving such a detailed analysis of your problem, so often we get "I pressed the button and nothing happened" messages and don't even know what the device is!

Brian.
 
You can change the baud rate to 115200 in your program. See if there is an improvement. Also select 115200 baud rate when you open your serial monitor.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top