Can't make sense of this console output when porting from Uno to Nano Every

Hi everyone,

I'm running a sketch originally written for the Uno on the Nano Every and while it seems to be working completely fine, I'm getting this in the console when uploading to the board:


In file included from C:\Users\GabeChan\Documents\Arduino\libraries\Adafruit_APDS9960_Library\Adafruit_APDS9960.h:35:0,
                 from C:\Users\GabeChan\Documents\Arduino\libraries\Adafruit_APDS9960_Library\Adafruit_APDS9960.cpp:48:
C:\Users\GabeChan\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7\libraries\Wire\src/Wire.h: In member function 'uint8_t Adafruit_APDS9960::read(uint8_t, uint8_t*, uint8_t)':
C:\Users\GabeChan\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7\libraries\Wire\src/Wire.h:63:12: note: candidate 1: size_t TwoWire::requestFrom(int, int)
     size_t requestFrom(int, int);
            ^~~~~~~~~~~
C:\Users\GabeChan\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7\libraries\Wire\src/Wire.h:61:12: note: candidate 2: virtual size_t TwoWire::requestFrom(uint8_t, size_t)
     size_t requestFrom(uint8_t, size_t);
            ^~~~~~~~~~~

Sketch uses 8580 bytes (17%) of program storage space. Maximum is 49152 bytes.
Global variables use 1022 bytes (16%) of dynamic memory, leaving 5122 bytes for local variables. Maximum is 6144 bytes.

avrdude: jtagmkII_initialize(): Cannot locate "flash" and "boot" memories in description

Some of it appears related to the Adafruit sensor library I'm using, but no idea about the rest ... can anyone explain? Anything I should tweak in my sketch? I've read that the ATMEGA328 and the ATMEGA4809 aren't entirely compatible architectures and that the registers emulation doesn't work quite flawlessly... could this be related?

I can provide the sketch if needed, just didn't wanna clutter the post.

There is a mismatch in the type of parameter used and what's expected (size_t is unsigned and int is signed).

The full context of the warning message.

/home/jdbarney/Arduino/libraries/Adafruit_APDS9960_Library/Adafruit_APDS9960.cpp: In member function 'uint8_t Adafruit_APDS9960::read(uint8_t, uint8_t*, uint8_t)':
/home/jdbarney/Arduino/libraries/Adafruit_APDS9960_Library/Adafruit_APDS9960.cpp:702:51: 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:
     _wire->requestFrom((uint8_t)_i2caddr, read_now);
                                                   ^
In file included from /home/jdbarney/Arduino/libraries/Adafruit_APDS9960_Library/Adafruit_APDS9960.h:35:0,
                 from /home/jdbarney/Arduino/libraries/Adafruit_APDS9960_Library/Adafruit_APDS9960.cpp:48:
/home/jdbarney/.arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/Wire/src/Wire.h:63:12: note: candidate 1: size_t TwoWire::requestFrom(int, int)
     size_t requestFrom(int, int);
            ^~~~~~~~~~~
/home/jdbarney/.arduino15/packages/arduino/hardware/megaavr/1.8.7/libraries/Wire/src/Wire.h:61:12: note: candidate 2: virtual size_t TwoWire::requestFrom(uint8_t, size_t)
     size_t requestFrom(uint8_t, size_t);
            ^~~~~~~~~~~

The library uses a variable read_now that is declared as uint8_t. The Wire library for the Nano Every does not have a declaration for requestFrom(uint8_t, uint8_t), but does have two function declarations that will work with the 2nd argument being a uint8_t. The compiler is unable to determine which of those two functions would be the best choice. Should not result in any problems, both functions result in the same action being taken.

size_t TwoWire::requestFrom(uint8_t address, size_t quantity)
{
  return requestFrom(address, quantity, true);
}

size_t TwoWire::requestFrom(int address, int quantity)
{
  return requestFrom((uint8_t)address, (size_t)quantity, true);
}

I get this error often to when uploading to my Arduino nano every, sometimes, it helps to change which usb cable you use or change which USB port on your computer to use, also when I get that error my code works despite the error.

Ok, thanks for all the replies!

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