RGB Matrix and RTC DS3231 problem

Hello,
On Arduino Nano I want to display time on 32x32 led panel from RTC DS3231 module. When i run example from AdaFruit RGBmatrixPanel testshapes_32x32 everything is ok
but when i add RTC library

#include <Wire.h>
#include <DS3231.h>

program don’t work, led panel display only random pixels. When i comment RTC code, program displays on panel correctly. I notice also that when i uncomment DS3231 libraries (include) only, program not work properly again. Where is the problem?

#include <Wire.h>
#include <DS3231.h>
#include <Adafruit_GFX.h>   // Core graphics library
#include <RGBmatrixPanel.h> // Hardware-specific library

#define CLK 8  // MUST be on PORTB! (Use pin 11 on Mega)
#define OE  9
#define LAT 10
#define A   A0
#define B   A1
#define C   A2
#define D   A3

RGBmatrixPanel matrix(A, B, C, D, CLK, LAT, OE, false);
 
//DS3231 clock;
//RTCDateTime dt;
 
void setup()
{
  matrix.begin();
  
  //Serial.begin(9600);
  //Inicjalizacja DS3231
  //Serial.println("Initialize DS3231");;
  //clock.begin();
 
  // Ustawiamy date i czas z kompilacji szkicu
  //clock.setDateTime(__DATE__, __TIME__);
 
  // Lub recznie (YYYY, MM, DD, HH, II, SS
  // clock.setDateTime(2014, 4, 13, 19, 21, 00);

  
}
 
void loop()
{
  // Odczytujemy czas i formatujemy za pomoca funkcji dateFormat
  //dt = clock.getDateTime();
  //Serial.println(clock.dateFormat("H:i:s", dt));
  
  matrix.fillScreen(matrix.Color333(0, 0, 0));
  delay(1000);
  
  matrix.setCursor(1, 0);    // start at top left, with one pixel of spacing
  matrix.setTextSize(1);     // size 1 == 8 pixels high
  matrix.setTextWrap(false); // Don't wrap at end of line - will do ourselves

  matrix.setTextColor(matrix.Color333(7,7,7));
  matrix.println("Test");
  delay(1000);
  ;
}

Perhaps you have run out of ram memory? Do you have/borrow a Mega to do test with?

Have you established that the rtc code runs ok if you comment out all the matrix code?

Yes, it works fine in this case

#include <Wire.h>
#include <DS3231.h>
//#include <Adafruit_GFX.h>   // Core graphics library
//#include <RGBmatrixPanel.h> // Hardware-specific library

/*#define CLK 8  // MUST be on PORTB! (Use pin 11 on Mega)
#define OE  9
#define LAT 10
#define A   A0
#define B   A1
#define C   A2
#define D   A3

RGBmatrixPanel matrix(A, B, C, D, CLK, LAT, OE, false);*/
 
DS3231 clock;
RTCDateTime dt;
 
void setup()
{
  //matrix.begin();
  
  Serial.begin(9600);
  //Inicjalizacja DS3231
  Serial.println("Initialize DS3231");;
  clock.begin();
 
  // Ustawiamy date i czas z kompilacji szkicu
  clock.setDateTime(__DATE__, __TIME__);
 
  // Lub recznie (YYYY, MM, DD, HH, II, SS
  // clock.setDateTime(2014, 4, 13, 19, 21, 00);

  
}
 
void loop()
{
  // Odczytujemy czas i formatujemy za pomoca funkcji dateFormat
  dt = clock.getDateTime();
  Serial.println(clock.dateFormat("H:i:s", dt));
  
  //matrix.fillScreen(matrix.Color333(0, 0, 0));
  //delay(1000);
  
  //matrix.setCursor(1, 0);    // start at top left, with one pixel of spacing
  //matrix.setTextSize(1);     // size 1 == 8 pixels high
  //matrix.setTextWrap(false); // Don't wrap at end of line - will do ourselves

  //matrix.setTextColor(matrix.Color333(7,7,7));
  //matrix.println("Test");
  delay(1000);
}

Ram memory would still be my guess at this point. Rgb panels require a lot of ram. The panel will use at least 50% of the Nano's 2KB. If you can borrow a Mega or some Arduino with more ram, this would help to prove or disprove my theory.

What DS3231 library are you using? Please post a link to it, if you can.