Oled Feather example won't compile

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
robtyce
 
Posts: 8
Joined: Sat Oct 19, 2019 2:05 pm

Oled Feather example won't compile

Post by robtyce »

When trying to compile the Oled FeatherWing 128x64 example Arduino code exactly as downloaded I get the following message:
"exit status 1
Error compiling for board Adafruit Feather M0."

It doesn't even get to the stage of trying to download.
I am on Arduino IDE 1.8.12

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: Oled Feather example won't compile

Post by dastels »

If it can't compile (or link) here is nothing to download.

Can you turn on more verbose error reporting to see exactly what's going on? You can find the relevant checkboxes in the preferences dialog.

Dave

User avatar
robtyce
 
Posts: 8
Joined: Sat Oct 19, 2019 2:05 pm

Re: Oled Feather example won't compile

Post by robtyce »

Here is the brief IDE error message for compiling the example Oled program.

Arduino: 1.8.19 (Windows 10), Board: "Adafruit Feather M0, Arduino, Off"

C:\Users\hp\Documents\Arduino\libraries\Adafruit_SH110X\Adafruit_SH110X.cpp: In member function 'virtual void Adafruit_SH110X::display()':

C:\Users\hp\Documents\Arduino\libraries\Adafruit_SH110X\Adafruit_SH110X.cpp:218:16: error: 'class Adafruit_I2CDevice' has no member named 'setSpeed'

i2c_dev->setSpeed(i2c_preclk);
^
C:\Users\hp\Documents\Arduino\libraries\Adafruit_SH110X\Adafruit_SH110X.cpp:231:16: error: 'class Adafruit_I2CDevice' has no member named 'setSpeed'

i2c_dev->setSpeed(i2c_postclk);
^
exit status 1

Error compiling for board Adafruit Feather M0.

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: Oled Feather example won't compile

Post by dastels »

Make sure everything (libraries and board support packages) are all up to date.

Dave

User avatar
robtyce
 
Posts: 8
Joined: Sat Oct 19, 2019 2:05 pm

Re: Oled Feather example won't compile

Post by robtyce »

Now finding that other Adafruit examples failing to compile for feather mo. SH110x and RTLIB are both latest versions. Here is RTLIB Ds3231 example error:

C:\Users\hp\Documents\Arduino\libraries\RTClib\src\RTC_DS1307.cpp: In member function 'void RTC_DS1307::writenvram(uint8_t, const uint8_t*, uint8_t)':
C:\Users\hp\Documents\Arduino\libraries\RTClib\src\RTC_DS1307.cpp:109:47: error: invalid conversion from 'const uint8_t* {aka const unsigned char*}' to 'uint8_t* {aka unsigned char*}' [-fpermissive]
i2c_dev->write(buf, size, true, &addrByte, 1);
^
In file included from C:\Users\hp\Documents\Arduino\libraries\RTClib\src\RTClib.h:25:0,
from C:\Users\hp\Documents\Arduino\libraries\RTClib\src\RTC_DS1307.cpp:1:
C:\Users\hp\Documents\Arduino\libraries\Adafruit_BusIO/Adafruit_I2CDevice.h:15:8: note: initializing argument 1 of 'bool Adafruit_I2CDevice::write(uint8_t*, size_t, bool, uint8_t*, size_t)'
bool write(uint8_t *buffer, size_t len, bool stop = true,
^~~~~
exit status 1
Error compiling for board Arduino M0.

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: Oled Feather example won't compile

Post by dastels »

Did you make sure everything is up to date.

Dave

User avatar
robtyce
 
Posts: 8
Joined: Sat Oct 19, 2019 2:05 pm

Re: Oled Feather example won't compile

Post by robtyce »

IDE, Board manager, Library manager show all components up to date, but no example using RTCLIB can compile, and gets "invalid conversion error indicated previously.

R. Tyce

User avatar
robtyce
 
Posts: 8
Joined: Sat Oct 19, 2019 2:05 pm

Re: Oled Feather example won't compile

Post by robtyce »

The RTCLIB ds3231 example will compile for arduino uno and adafruit feather 32u4 boards, but not for the Adafruit feather mo. I've been using Adalogger feather mo boards for some time now, and now have software developed a year ago for US navy installed logging systems that will no longer compile with this same error.

Robtyce

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: Oled Feather example won't compile

Post by dastels »

Ah. It's the casting away of the const that's the issue. Unfortunately Arduino doesn't give you a lot of control over compilation.

Try adding "-fpermissive" (as noted in the error message) to the arduino preferences file:

Code: Select all

compiler.cpp.extra_flags=-fpermissive
Open the Arduino preferences dialog and click the link to preferences.txt near the bottom. Then edit preferences.txt that you find there to add the above line.

Dave

User avatar
robtyce
 
Posts: 8
Joined: Sat Oct 19, 2019 2:05 pm

Re: Oled Feather example won't compile

Post by robtyce »

After adding the -fpermissing line to the preferences file the error message for Adafruit Feather MO follows:

Code: Select all

Arduino: 1.8.19 (Windows 10), Board: "Adafruit Feather M0 (SAMD21), Small (-Os) (standard), Arduino, Off"

C:\Users\hp\Documents\Arduino\libraries\RTClib\src\RTC_DS1307.cpp: In member function 'void RTC_DS1307::writenvram(uint8_t, const uint8_t*, uint8_t)':

C:\Users\hp\Documents\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:\Users\hp\Documents\Arduino\libraries\RTClib\src\RTClib.h:25,

                 from C:\Users\hp\Documents\Arduino\libraries\RTClib\src\RTC_DS1307.cpp:1:

C:\Users\hp\Documents\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 Feather M0 (SAMD21).
Last edited by dastels on Fri Sep 09, 2022 5:37 pm, edited 1 time in total.
Reason: Add code tag to make more readable

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: Oled Feather example won't compile

Post by dastels »

It's still flagging it as an error. Did you restart (and ideally modify the preferences file with Arduino closed as instructed in the dialog)?

Dave

User avatar
robtyce
 
Posts: 8
Joined: Sat Oct 19, 2019 2:05 pm

Re: Oled Feather example won't compile

Post by robtyce »

I changed the preferences file with IDE closed, then restarted. No Joy. I would love to know if others experience this error when trying to compile the RTCLIB d3231 example for Adafruit Feather MO(SAMD21) boards, or if its just me with some problem of my own. I've a system to deliver to the US Navy in a week which depends upon the Featherwing ds3231 Precision real time clock. Testing this problem does not require any hardware, just the Arduino Ide and libraries.

Robtyce

User avatar
robtyce
 
Posts: 8
Joined: Sat Oct 19, 2019 2:05 pm

Re: Oled Feather example won't compile

Post by robtyce »

Success! I went back to the library manager and updated every library on my system except the Adafruit playground collection, and both RTCLIB and SH110x errors have gone away. I'm not sure which library fixed the problem, as the two libraries in question were already up to date, but it is great to have a working IDE with the Adalogger Feather MO once again. Thanks for all the help.

Robtyce

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

Return to “Other Arduino products from Adafruit”