RTC examples not compiling for d21G

We are migrating to the D21G for its RTC capabilites.

Is there information that will help get me up and running using RTC?

I am using the RTC link in the Industruino Github

I tried to compile the examples included with the library for the d21g but it failed with this error

exit status 1
request for member 'SetOutput' in '1073746944u', which is of pointer type 'Rtc*' (maybe you meant to use '->' ?)

they compile for other board types which suggests there is something in the RTC libary that needs to be tweaked for the D21G?

Colin Ragush
Colin Ragush
7
| 0 0 0
Asked on 6/15/17, 6:48 PM
0
vote
378 Views

Hi Colin,

My appologies for the trouble, we found the issue: Indeed the "RTC" function was conflicting with the internal RTC function, changing the name to RTCind in all files resolved it. Also had to add Wire.begin in the setup routine. Please re-install latest version from our github: https://github.com/Industruino/MCP7940-RTC-Library

I did something wrong with my version control, I had a local version of the library that was working with the changes and instead of pushing this one I pulled the original one and made the changes on that copy, forgetting the most crucial changes along the way... A lesson learned. 

Best Regards,

Loic

Loic De Buck
Loic De Buck
1227
| 3 1 3
Answered on 6/22/17, 4:05 AM
1
vote

Thanks Loic - this all makes sense. Library management/versioning is always a joy. I am unsure why you needed to add wire.begin() and I'm not sure if you meant in the RTC library or in any code using it. To me it seems redundant having it in the main sketch, but it doesn't necessarily have an impact.

Colin Ragush
on 6/22/17, 2:19 PM

More information - appologies as that likely wasn't enough

 

In file included from C:\Users\Colin\AppData\Local\Arduino15\packages\industruino\tools\CMSIS-Atmel\1.0.0/CMSIS/Device/ATMEL/samd21/include/samd21.h:69:0,

                 from C:\Users\Colin\AppData\Local\Arduino15\packages\industruino\tools\CMSIS-Atmel\1.0.0/CMSIS/Device/ATMEL/samd.h:105,

                 from C:\Users\Colin\AppData\Local\Arduino15\packages\industruino\tools\CMSIS-Atmel\1.0.0/CMSIS/Device/ATMEL/sam.h:424,

                 from C:\Users\Colin\AppData\Local\Arduino15\packages\industruino\hardware\samd\1.0.1\cores\industruino/Arduino.h:48,

                 from sketch\serial_functions.ino.cpp:1:

C:\Users\Colin\AppData\Local\Arduino15\packages\industruino\tools\CMSIS-Atmel\1.0.0/CMSIS/Device/ATMEL/samd21/include/samd21g18a.h:487:38: error: expected ')' before '*' token

 #define RTC               ((Rtc      *)0x40001400UL) /**< \brief (RTC) APB Base Address */

                                      ^

C:\arduino-1.6.12\libraries\MCP7940-RTC/MCP7940.h:90:16: note: in expansion of macro 'RTC'

 extern MCP7940 RTC;

                ^

C:\Users\Colin\AppData\Local\Arduino15\packages\industruino\tools\CMSIS-Atmel\1.0.0/CMSIS/Device/ATMEL/samd21/include/samd21g18a.h:487:38: error: expected ')' before '*' token

 #define RTC               ((Rtc      *)0x40001400UL) /**< \brief (RTC) APB Base Address */

Colin Ragush
Colin Ragush
7
| 0 0 0
Answered on 6/20/17, 1:08 PM
0
vote

So I know I'm just replying to my self here.. but it might help direct the solution. My understanding now is that the two headers (samd21g18a and MCP7940) are in conflict with respect to the defining of RTC. Now the approriate way to resolve this is a little lost on me.. but this link may help someone http://forum.arduino.cc/index.php?topic=285059.0

Colin Ragush
on 6/21/17, 5:07 PM

Your answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

Ask a Question

Keep Informed

About This Forum

This community is for professionals and enthusiasts of our products and services.

Read Guidelines

Question tools

36 follower(s)

Stats

Asked: 6/15/17, 6:48 PM
Seen: 378 times
Last updated: 6/22/17, 4:07 AM