issue with trinket M0 and the RTClibrary

Adafruit's tiny microcontroller platform. Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Kylobyte25
 
Posts: 13
Joined: Sun Oct 18, 2020 2:32 pm

issue with trinket M0 and the RTClibrary

Post by Kylobyte25 »

Hi there, I'm able to program and demo any example code on a trinket m0, but when i use the RTC library to even just compile, it throws errors.

Code: Select all

C:\...Arduino\libraries\RTClib\src\RTC_DS1307.cpp: In member function 'void RTC_DS1307::writenvram(uint8_t, const uint8_t*, uint8_t)':
C:\...Arduino\libraries\RTClib\src\RTC_DS1307.cpp:109:18: error: invalid conversion from 'const uint8_t*' {aka 'const unsigned char*'} to 'uint8_t*' {aka 'unsigned char*'} [-fpermissive]
  109 |   i2c_dev->write(buf, size, true, &addrByte, 1);
      |                  ^~~
      |                  |
      |                  const uint8_t* {aka const unsigned char*}
In file included from C:...Arduino\libraries\RTClib\src\RTClib.h:25,
                 from C:\...Arduino\libraries\RTClib\src\RTC_DS1307.cpp:1:
C:\...Arduino\libraries\Adafruit_BusIO/Adafruit_I2CDevice.h:15:23: note:   initializing argument 1 of 'bool Adafruit_I2CDevice::write(uint8_t*, size_t, bool, uint8_t*, size_t)'
   15 |   bool write(uint8_t *buffer, size_t len, bool stop = true,
      |              ~~~~~~~~~^~~~~~
exit status 1
Error compiling for board Adafruit Trinket M0 (SAMD21).
An error occurred while uploading the sketch
I'm using a PCF8523. not sure whats going on here

User avatar
mikeysklar
 
Posts: 14181
Joined: Mon Aug 01, 2016 8:10 pm

Re: issue with trinket M0 and the RTClibrary

Post by mikeysklar »

Are you using the Adafruit RTClibrary? If so, what version (v2.0.3 is current).

https://github.com/adafruit/RTClib

https://learn.adafruit.com/adafruit-ada ... th-arduino

User avatar
Franklin97355
 
Posts: 23939
Joined: Mon Apr 21, 2008 2:33 pm

Re: issue with trinket M0 and the RTClibrary

Post by Franklin97355 »

What code are you trying to compile(post the program, please), and do you have the libraries and boards updated?

User avatar
Kylobyte25
 
Posts: 13
Joined: Sun Oct 18, 2020 2:32 pm

Re: issue with trinket M0 and the RTClibrary

Post by Kylobyte25 »

mikeysklar wrote:Are you using the Adafruit RTClibrary? If so, what version (v2.0.3 is current).
Using the RTClib version 2.0.3 according to the Arduino library manager

User avatar
Kylobyte25
 
Posts: 13
Joined: Sun Oct 18, 2020 2:32 pm

Re: issue with trinket M0 and the RTClibrary

Post by Kylobyte25 »

Franklin97355 wrote:What code are you trying to compile(post the program, please), and do you have the libraries and boards updated?
Libraries and boards are most recent version,
I'm just compiling the PCF8523 example in the library

i went into the library folder and removed the problematic file that its erroring on and it compiles now but now the upload process just says uploading. and it never ends..
typical trinket behavour i think. IT works 5% of the time, the bootloader on this thing is so annoying, i have to keep uploading over and over for it to, enter or exit the bootloader, i see it sometimes mounting the drive on and off, and then uploading rarely. I think my problem is solved?
it uploaded once and i was able to verify the example by removing RTC_DS1307.cpp from the library , it doesn't seem compatible with trinket m0

User avatar
Franklin97355
 
Posts: 23939
Joined: Mon Apr 21, 2008 2:33 pm

Re: issue with trinket M0 and the RTClibrary

Post by Franklin97355 »

using this learn article and the Trinket M0 I get a proper compilation.
Attachments
2022-07-29_13-52-12.png
2022-07-29_13-52-12.png (52.38 KiB) Viewed 167 times

User avatar
Kylobyte25
 
Posts: 13
Joined: Sun Oct 18, 2020 2:32 pm

Re: issue with trinket M0 and the RTClibrary

Post by Kylobyte25 »

Franklin97355 wrote:using this learn article and the Trinket M0 I get a proper compilation.
what did you end up modifying?
My example default sketch size isnt the same as yours

Locked
Please be positive and constructive with your questions and comments.

Return to “Trinket ATTiny, Trinket M0”