RTClib icon indicating copy to clipboard operation
RTClib copied to clipboard

Upgrade to v2.0.1 renders code non-functioning

Open tstana opened this issue 4 years ago • 1 comments

Following a recent update to the latest version (2.0.1) of the RTClib, we get strange errors in the compiled code for this project:

  • https://github.com/tstana/proto-cubes-obc

The way in which the error manifests itself is that code which used to work... no longer works. Details on reproducing and the solution we adopted can be found below. Before that:

  • Arduino board: Arduino Due (using the Programming Port)

  • Shield: Adafruit Data Logger with the PCF8523

  • Arduino IDE version: 1.8.13 (but the problem manifests itself in 1.8.16 too)

The steps to reproduce the issue are:

  1. Install v2.0.1 of RTClib.
  2. Clone (or get a .zip of) the proto-cubes-obc code linked above.
  3. Upload the code to the Due.
  4. Bring up the Serial Monitor; you should see it only printing several '=' signs, for example =====.
  5. In the file debug.hpp, comment out #define DEBUG_ENABLE
  6. Upload the code again
  7. The serial monitor should now say that the "RTC could not be found", along with some other prints. The "RTC could not be found" line is printed from the file rtc.cpp in our code, after a call to RTC_PCF8523::begin().

Reverting the library to version 1.4.0 returns the code to a functioning condition. Unfortunately, I cannot say which version of the library I was running before the upgrade to 2.0.1.

I'm suspecting something "interesting" introduced in the compiled code by some modification to the library. If anyone cares to try to reproduce and look at the compiled code in an effort to fix any potential issues in the future, you now know all I do.

Good luck - and let me know if I can help.

tstana avatar Dec 10 '21 21:12 tstana

Does the library example work as expected? https://github.com/adafruit/RTClib/blob/master/examples/pcf8523/pcf8523.ino

caternuson avatar Aug 04 '22 17:08 caternuson