Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP32 use hardware u8g2 i2c cause flash crash #55

Open
TimonPeng opened this issue Aug 24, 2022 · 6 comments
Open

ESP32 use hardware u8g2 i2c cause flash crash #55

TimonPeng opened this issue Aug 24, 2022 · 6 comments

Comments

@TimonPeng
Copy link

TimonPeng commented Aug 24, 2022

I copied example and just changed

U8G2_KS0108_128X64_1 u8g2(U8G2_R0, 8, 9, 10, 11, 12, 13, 18, 19, /*enable=*/ A0, /*dc=*/ A1, /*cs0=*/ A3, /*cs1=*/ A2, /*cs2=*/ U8X8_PIN_NONE, /* reset=*/ U8X8_PIN_NONE);   // Set R/W to low!

to

U8G2_SSD1327_MIDAS_128X128_F_HW_I2C u8g2(U8G2_R0, /* reset=*/U8X8_PIN_NONE);

Build with -D GEM_DISABLE_GLCD -D GEM_DISABLE_ADAFRUIT_GFX, but it cause an esp32 flash error when uploaded and rebooted, tried two pieces but end with the same result.

rst:0x10 (RTCWDT_RTC_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371

Then can not use esptool.py to write or erase flash anymore.

WARNING: Failed to communicate with the flash chip, read/write operations will fail. Try checking the chip connections or removing any other hardware connected to IOs.
A fatal error occurred: Packet content transfer stopped (received 8 bytes)
@Spirik
Copy link
Owner

Spirik commented Aug 24, 2022

Hello!

I recently had a report of similar troubles with ESP32-based board. But based on general feedback, other boards work as expected, so not really sure where to dig (I have no access to ESP32 boards as of now, so I am only able to compile sketches without flashing to the real hardware). So let me ask you a few questions, that may help to research this issue further.

  1. I assume compilation succeeds and error appears only after flashing compiled sketch?
  2. What board exactly are you using?
  3. What software do you use to compile and upload sketch? What are the versions of Arduino IDE, u8g2 and GEM?
  4. Does your display work in combination with this board w/o GEM: initializes correctly, you can clear it and draw something using u8g2? Do examples that come with u8g2 work?

To investigate further, I may suggest trying to compile and flash sketch with U8G2_KS0108_128X64_1 constructor used in example (with proper pins assigned, specific to your board) after disconnecting your display - you won't get any output, of course, but console error messages may be of any help. You can also try to compile GEM without float support (with -D GEM_DISABLE_FLOAT_EDIT flag). There is also a number of ESP32 specific settings in Arduino IDE, that may affect how sketch compiled and uploaded.

@TimonPeng
Copy link
Author

Hi there,

Thanks for your fast reply Alex!

  1. Build firmware is fine, it only happened after uploaded to my board
  2. I'm using m5stack core, it's ESP32-D0WDQ6 inside
  3. I'm using platformio with olikraus/U8g2@2.33.11 and spirik/GEM@1.4.0
  4. I tested with ArduinoMenu and pure u8g2 to drive this same OLED, it works fine both

I can send you some ESP32 boards and OLEDs, if you want.

As all my boards were no longer working, I ordered some new to continue testing then.

@Spirik
Copy link
Owner

Spirik commented Aug 24, 2022

Thank you for detailed response! I am really sorry that you are having these issues, hopefully there is a way to revive these boards and they are not completely bricked after all. Meanwhile I will order some different ESP32 boards from local sources for testing, and consider adding corresponding attention note in a Readme.

@Spirik
Copy link
Owner

Spirik commented Aug 24, 2022

Seems like this flash read err, 1000 is quite common for some ESP32 boards. As far as my early findings go, It may be related to different flash settings (partitioning, encryption (and here), 16MB flash quirks etc.). I am sure you've googled this issue enough, but just in case here is couple more of resources probably worth checking (alongside Troubleshooting section on esptool.py docs):

I'll let you know if I manage to gig something more.

@TimonPeng
Copy link
Author

TimonPeng commented Aug 24, 2022

I have used several ways but can not restore them, like

esptool.py --chip esp32 --port /dev/tty.usbserial-XXX --baud 115200 --before default_reset --after hard_reset erase_flash

or shorting G0 and GND.

But don't worry! it doesn't matter I can replace it with a new SPI flash actually XD.

Just hope could find this strange problem asap!

@Spirik
Copy link
Owner

Spirik commented Aug 30, 2022

Added corresponding note to Compatibility section of Readme regarding possible issues with ESP32 boards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants