DS3231 and ESP32: Wire i2cWriteReadNonStop error 263

I'm a newbie :slight_smile:

I've started to write some simple code for connecting an ESP32 board (Ideaspark) with some sensors using I2C bus. This board is equipped with an onboard OLED display (I2C address 0x3c).
I2C SDA is GPIO_21 and SCL is GPIO_22

Till now I've tested INA219 and BME280 and they work very fine. OLED display works fine too. No problem at all.

I2Cscanner sketch works great.

Now I've bought an AzDelivery RTC DS3231 (Amazon) but I've strange result.
Power supply 3.3V, standard CR2032 installed.
I2Cscanner show 0x68 (rtc) and 0x57 (eeprom) address. Ok, correct.
No other sensor is connected to ESP32. Only DS3231 and the onboard OLED display.

Running this simple code I got error :

// global include
#include <Arduino.h>
#include <Wire.h>

// Adafruit RTClib
#include <RTClib.h>

RTC_DS3231 rtc;

void setup() {
  Serial.begin(115200);
  if (!Wire.begin(21,22)) {
    Serial.println("WIRE ERROR !!");
  }

  if (!rtc.begin()) {
    Serial.println("DS3231 RTC not found!");
    delay(3000);
  } else {
    Serial.println("DS3231 OK !!");
    delay(3000);
  }

 }

void loop() {
  
   // RTC DS3131
  DateTime adesso = rtc.now();
  Serial.println(adesso.unixtime());

  delay(1000);

}

DS3231 is initialized correctly, first read is ok but next reading show a Wire error (timeout)

20:56:04.897 > rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
20:56:04.902 > configsip: 0, SPIWP:0xee
20:56:04.904 > clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
20:56:04.910 > mode:DIO, clock div:2
20:56:04.913 > load:0x3fff0030,len:1184
20:56:04.915 > load:0x40078000,len:13232
20:56:04.918 > load:0x40080400,len:3028
20:56:04.918 > entry 0x400805e4
20:56:05.837 > DS3231 OK !!
20:56:08.840 > 946687788  // correct unix timestamp, 01 Jan 2000
20:56:11.346 > [  6287][E][Wire.cpp:499] requestFrom(): i2cWriteReadNonStop returned Error 263
20:56:11.352 > 2986760520
20:56:13.858 > [  8800][E][Wire.cpp:499] requestFrom(): i2cWriteReadNonStop returned Error 263
20:56:13.865 > 2986760520
20:56:16.372 > [ 11313][E][Wire.cpp:499] requestFrom(): i2cWriteReadNonStop returned Error 263
20:56:16.377 > 2986760520
(...omissis...)

I've tried to add 4.7K resistor pullup on SCL and SDA without any changes.

Note about timestamps: they are wrong. Not 1000mS between reading (more or less) but about 2500mS (Wire timeout probably stop processing).

I've read many post about i2cWriteReadNonStop error but none looks to be meaningful for me.

Any idea ?