deviceOS@1.5.0-rc2 causing compile errors for i2c libraries

I have been getting compile errors when I move my toolchain to deviceOS@1.5.0-rc2. Here is an example from @rickkas7’s FRAM library. Note, I have seen this in other libraries as well so I think this is a general issue.

:::: COMPILING APPLICATION

Creating /Users/chipmc/Documents/Maker/Particle/Projects/Boron-Connected-Counter/target/1.5.0-rc.2/boron/platform_user_ram.ld ...
/Users/chipmc/Documents/Maker/Particle/Projects/Boron-Connected-Counter/lib/MB85RC256V-FRAM-RK/src/MB85RC256V-FRAM-RK.cpp: In member function 'virtual bool MB85RC::readData(size_t, uint8_t*, size_t)':
/Users/chipmc/Documents/Maker/Particle/Projects/Boron-Connected-Counter/lib/MB85RC256V-FRAM-RK/src/MB85RC256V-FRAM-RK.cpp:68:58: error: call of overloaded 'requestFrom(int, size_t&, bool)' is ambiguous
    wire.requestFrom(addr | DEVICE_ADDR, bytesToRead, true);
                                                          ^
In file included from ../wiring/inc/spark_wiring_power.h:35:0,
                 from ./inc/application.h:46,
                 from ./inc/Particle.h:5,
                 from /Users/chipmc/Documents/Maker/Particle/Projects/Boron-Connected-Counter/lib/MB85RC256V-FRAM-RK/src/MB85RC256V-FRAM-RK.cpp:2:
../wiring/inc/spark_wiring_i2c.h:109:10: note: candidate: size_t TwoWire::requestFrom(uint8_t, size_t, uint8_t)
   size_t requestFrom(uint8_t, size_t, uint8_t);
          ^
../wiring/inc/spark_wiring_i2c.h:111:10: note: candidate: size_t TwoWire::requestFrom(int, int, int)
   size_t requestFrom(int, int, int);
          ^
/Users/chipmc/Documents/Maker/Particle/Projects/Boron-Connected-Counter/lib/MB85RC256V-FRAM-RK/src/MB85RC256V-FRAM-RK.cpp: In member function 'virtual bool MB85RC1M::readData(size_t, uint8_t*, size_t)':
/Users/chipmc/Documents/Maker/Particle/Projects/Boron-Connected-Counter/lib/MB85RC256V-FRAM-RK/src/MB85RC256V-FRAM-RK.cpp:203:54: error: call of overloaded 'requestFrom(int, size_t&, bool)' is ambiguous
    wire.requestFrom(getI2CAddr(framAddr), count, true);
                                                      ^
In file included from ../wiring/inc/spark_wiring_power.h:35:0,
                 from ./inc/application.h:46,
                 from ./inc/Particle.h:5,
                 from /Users/chipmc/Documents/Maker/Particle/Projects/Boron-Connected-Counter/lib/MB85RC256V-FRAM-RK/src/MB85RC256V-FRAM-RK.cpp:2:
../wiring/inc/spark_wiring_i2c.h:109:10: note: candidate: size_t TwoWire::requestFrom(uint8_t, size_t, uint8_t)
   size_t requestFrom(uint8_t, size_t, uint8_t);
          ^
../wiring/inc/spark_wiring_i2c.h:111:10: note: candidate: size_t TwoWire::requestFrom(int, int, int)
   size_t requestFrom(int, int, int);
          ^
make[3]: *** [../build/target/user/platform-13-m/Boron-Connected-Counter/MB85RC256V-FRAM-RK/src/MB85RC256V-FRAM-RK.o] Error 1
make[2]: *** [user] Error 2
make[1]: *** [modules/boron/user-part] Error 2
make: *** [compile-user] Error 2
The terminal process terminated with exit code: 2

For now, I will go back to rc1 which compiles the same code without error.

Thanks,

Chip

Have you got a sneak peek at a not yet resleased RC or is this a typo.
The most recent version I’m aware of is 1.5.0-rc.2 not 1.5.1-rc.2.

I fixed the MB85RC256V-FRAM-RK; I just published version 0.0.5. I’m not really sure why it worked before because the receiveFrom call was ambiguous before as well.

@ScruffR, Sorry, typo

Chip

@rickkas7,

Thank you. Perhaps it is this line in the rc2 release notes that explains why the new release is causing an error:

[gcc] fixes builds on osx and enables usage of the latest gcc versions #2041

Thanks,

Chip

@rickkas7,

Any chance I could ask you to do the same for your MCP79410 library?

:::: COMPILING APPLICATION

Creating /Users/chipmc/Documents/Maker/Particle/Projects/Boron-Connected-Counter/target/1.5.0-rc.2/boron/platform_user_ram.ld ...
/Users/chipmc/Documents/Maker/Particle/Projects/Boron-Connected-Counter/lib/MCP79410RK/src/MCP79410RK.cpp: In member function 'int MCP79410::deviceRead(uint8_t, uint8_t, uint8_t*, size_t) const':
/Users/chipmc/Documents/Maker/Particle/Projects/Boron-Connected-Counter/lib/MCP79410RK/src/MCP79410RK.cpp:777:69: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
    count = wire.requestFrom(i2cAddr, (uint8_t) count, (uint8_t) true);
                                                                     ^
In file included from ../wiring/inc/spark_wiring_power.h:35:0,
                 from ./inc/application.h:46,
                 from ./inc/Particle.h:5,
                 from /Users/chipmc/Documents/Maker/Particle/Projects/Boron-Connected-Counter/lib/MCP79410RK/src/MCP79410RK.h:4,
                 from /Users/chipmc/Documents/Maker/Particle/Projects/Boron-Connected-Counter/lib/MCP79410RK/src/MCP79410RK.cpp:1:
../wiring/inc/spark_wiring_i2c.h:111:10: note: candidate 1: size_t TwoWire::requestFrom(int, int, int)
   size_t requestFrom(int, int, int);
          ^
../wiring/inc/spark_wiring_i2c.h:109:10: note: candidate 2: size_t TwoWire::requestFrom(uint8_t, size_t, uint8_t)
   size_t requestFrom(uint8_t, size_t, uint8_t);
          ^
Creating /Users/chipmc/Documents/Maker/Particle/Projects/Boron-Connected-Counter/target/1.5.0-rc.2/boron/platform_user_ram.ld ...
   text    data     bss     dec     hex filename
  40288     420    1928   42636    a68c /Users/chipmc/Documents/Maker/Particle/Projects/Boron-Connected-Counter/target/1.5.0-rc.2/boron/Boron-Connected-Counter.elf

*** COMPILED SUCCESSFULLY ***

Thanks, Chip

That’s only a warning, not an error, but I fixed it in MCP79410RK 0.0.4.

Thank you @rickkas7, I have been working with this library and and trying to figure out how to manage sleep with the Boron and an external real time clock.

This library is great and I look forward to getting better at using it to its full potential.

Thanks, Chip

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.