ESP-01 serial communication failed

all of a sudden ESP-1 refused to use 115200 bps (or any other usefull bit rate) serial. Tested same prog under arduino successfull.

#include <Arduino.h>
void setup() {
 Serial.begin(115200);
 delay(200);
 Serial.printf("\n\nCompiled from: %s  at: %s %s", __FILE__, __DATE__, __TIME__);
 Serial.println("\nXxXxXxXx");
}
void loop() {
  while(true){yield(); delay(100);}
}

[env:esp01_1m]
platform = espressif8266
board = esp01_1m
framework = arduino
monitor_speed = 115200
upload_speed = 512000

Tested with different ESP-01 modules.
Regards, very confused

Seems like the serial monitor starts after the output appears and there’s no auto-reset? What if you do

void loop() {
 Serial.printf("\n\nCompiled from: %s  at: %s %s", __FILE__, __DATE__, __TIME__);
 Serial.println("\nXxXxXxXx");
 delay(500);
}

as the loop?

1 Like

Thank-you Maxemilian for the hint however nothing has changed 🤔

looks like the serial output stream is at a very high bit rate.

As mentioned before: same program, same processor but arduino IDE used result is as expected.

Very strange

Aaah. Can you please set

monitor_speed = 74880

and look at the serial monitor output again?

These could be bootloader messages due to a maybe wrongly selected flash size.

Hi Max or hi Gerhard
set monitor_speed in platformio.ini and in source code as well Serial.begin(74880)
Now get an awful lot of garbage even higher speed
BUT also:
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 3584, room 16
tail 0
chksum 0xef
csum 0xef
csum err
ets_main.c
after reset. platforio.ini reads now
Thank-you

[env:esp01_1m]
platform = espressif8266
board = esp01_1m
framework = arduino
minitor_speed = 74880
upload_speed = 512000

Hi Max
checking flash configuration by an arduino prog shows
Flash real size: 1048576 bytes
Flash ide size: 1048576 bytes
Flash ide speed: 40000000 Hz
Flash ide mode: DOUT
Flash Chip configuration ok.
Check and serial output from the same device - the one that failt under platformio
Grüße vom Bodensee

Let’s try and match the configuration then per docs.

Add to the platformio.ini

board_build.f_flash = 40000000L 
board_build.flash_mode = dout

The flash size is already implicitly correct by choosing esp01_1m as the 1MByte version of the ESP-01.

Congratulations! 👍

Was this something I’ve missed? Should this be in the “normal” presets provided by platformio?

Anyway thank-you so much

regards

btw is there a german speaking user group?

When you select board = esp01_1m, the default definitions come from the board manifest file.

Here it declares 40MHz Flash speed in QIO mode – for your module, DOUT seems to be correct though.

Maybe there are different kinds of ESP01 with 1MByte flash modules in circumvention, and some have a Dual-SPI and others a Quad-SPI connection to the flash chip. I don’t have enough of these modules to say if the above standard definitions are always wrong… But that’s why PlatformIO lets you configure all these settings in your platformio.ini anyways, to be adaptive to whatever modules may be out there.

I haven’t heard of such an board explicitly. Maybe some users in the german section of the Arduino forum (Deutsch - Arduino Forum) use PlatformIO. Otherwise everything here is held in English for international audiences.

Thank-you, problem solved. Tested some modules - they require different flash_modes (dout, qio). Good to know :thinking: Arduino IDE seems to check it in advance. Flashing both without any configuration in advance. Maybe platformio can adapt.
Thanks again

1 Like

Arduino IDE should fail too if you flash a DOUT module with a QIO configuration (since the two additional SPI data lines aren’t there). But a QIO module can be flashed with any config (DOUT, etc.), just less connections are used.

I might be wrong and I’d be interesting to test how the Arduino IDE figures this out, but I think it should fail, too.

I have’nt realy flashed the different modules I have just tested them by using this program found somewhere:

/*
  ESP8266 CheckFlashConfig by Markus Sattler
  This sketch tests if the EEPROM settings of the IDE match to the Hardware
*/
void setup(void) {
  Serial.begin(115200);
}
void loop() {
  uint32_t realSize = ESP.getFlashChipRealSize();
  uint32_t ideSize = ESP.getFlashChipSize();
  FlashMode_t ideMode = ESP.getFlashChipMode();
  Serial.printf("Flash real id:   %08X\n", ESP.getFlashChipId());
  Serial.printf("Flash real size: %u bytes\n\n", realSize);
  Serial.printf("Flash ide  size: %u bytes\n", ideSize);
  Serial.printf("Flash ide speed: %u Hz\n", ESP.getFlashChipSpeed());
  Serial.printf("Flash ide mode:  %s\n", (ideMode == FM_QIO ? "QIO" : ideMode == FM_QOUT ? "QOUT" : ideMode == FM_DIO ? "DIO" : ideMode == FM_DOUT ? "DOUT" : "UNKNOWN"));
  if (ideSize != realSize) {
    Serial.println("Flash Chip configuration wrong!\n");
  } else {
    Serial.println("Flash Chip configuration ok.\n");
  }
  while(true){yield(); delay(100);}
}

works pretty well with arduino IDE - no parameter setting needed whereas platformio needs correct flash_mode setting.
As a hobby-programmer I’m fare away from understanding what happens inside - I trust and depend on IDE’s support. Maybe platform can adapt in favor of hobby programmers :wink:
Chapeau and thank-you again for your expert advice