Issue compiling MAXREFDES117 example code

Here is the error that I get when trying to compile the example code from this website for the MAX30102 SP02 sensor. I'm thinking I might be missing a library but I'm not sure...

https://www.maximintegrated.com/en/design/reference-design-center/system-board/6300.html

Please find the code attached in this google drive link and the error down below.

Arduino: 1.8.15 (Windows Store 1.8.49.0) (Windows 10), Board: "Arduino Uno"





















C:\Users\adam3\AppData\Local\Temp\cc9iCKuJ.ltrans0.ltrans.o: In function `i2c_read':

C:\Users\adam3\Downloads\rd117_arduino_v01_00\Design Files\RD117_ARDUINO1/SoftI2CMaster.h:528: undefined reference to `ass_i2c_delay_half'

C:\Users\adam3\Downloads\rd117_arduino_v01_00\Design Files\RD117_ARDUINO1/SoftI2CMaster.h:528: undefined reference to `ass_i2c_delay_half'

C:\Users\adam3\Downloads\rd117_arduino_v01_00\Design Files\RD117_ARDUINO1/SoftI2CMaster.h:528: undefined reference to `ass_i2c_wait_scl_high'

C:\Users\adam3\Downloads\rd117_arduino_v01_00\Design Files\RD117_ARDUINO1/SoftI2CMaster.h:528: undefined reference to `ass_i2c_delay_half'

C:\Users\adam3\Downloads\rd117_arduino_v01_00\Design Files\RD117_ARDUINO1/SoftI2CMaster.h:528: undefined reference to `ass_i2c_wait_scl_high'

C:\Users\adam3\Downloads\rd117_arduino_v01_00\Design Files\RD117_ARDUINO1/SoftI2CMaster.h:528: undefined reference to `ass_i2c_delay_half'

C:\Users\adam3\AppData\Local\Temp\cc9iCKuJ.ltrans0.ltrans.o: In function `i2c_rep_start(unsigned char) [clone .constprop.10]':

C:\Users\adam3\Downloads\rd117_arduino_v01_00\Design Files\RD117_ARDUINO1/SoftI2CMaster.h:334: undefined reference to `ass_i2c_delay_half'

C:\Users\adam3\Downloads\rd117_arduino_v01_00\Design Files\RD117_ARDUINO1/SoftI2CMaster.h:334: undefined reference to `ass_i2c_delay_half'

C:\Users\adam3\Downloads\rd117_arduino_v01_00\Design Files\RD117_ARDUINO1/SoftI2CMaster.h:334: undefined reference to `ass_i2c_delay_half'

C:\Users\adam3\Downloads\rd117_arduino_v01_00\Design Files\RD117_ARDUINO1/SoftI2CMaster.h:334: undefined reference to `ass_i2c_wait_scl_high'

C:\Users\adam3\Downloads\rd117_arduino_v01_00\Design Files\RD117_ARDUINO1/SoftI2CMaster.h:334: undefined reference to `ass_i2c_delay_half'

C:\Users\adam3\Downloads\rd117_arduino_v01_00\Design Files\RD117_ARDUINO1/SoftI2CMaster.h:334: undefined reference to `ass_i2c_write'

C:\Users\adam3\AppData\Local\Temp\cc9iCKuJ.ltrans0.ltrans.o: In function `i2c_write':

C:\Users\adam3\Downloads\rd117_arduino_v01_00\Design Files\RD117_ARDUINO1/SoftI2CMaster.h:458: undefined reference to `ass_i2c_delay_half'

C:\Users\adam3\Downloads\rd117_arduino_v01_00\Design Files\RD117_ARDUINO1/SoftI2CMaster.h:458: undefined reference to `ass_i2c_wait_scl_high'

C:\Users\adam3\Downloads\rd117_arduino_v01_00\Design Files\RD117_ARDUINO1/SoftI2CMaster.h:458: undefined reference to `ass_i2c_delay_half'

C:\Users\adam3\Downloads\rd117_arduino_v01_00\Design Files\RD117_ARDUINO1/SoftI2CMaster.h:458: undefined reference to `ass_i2c_delay_half'

C:\Users\adam3\Downloads\rd117_arduino_v01_00\Design Files\RD117_ARDUINO1/SoftI2CMaster.h:458: undefined reference to `ass_i2c_wait_scl_high'

C:\Users\adam3\Downloads\rd117_arduino_v01_00\Design Files\RD117_ARDUINO1/SoftI2CMaster.h:458: undefined reference to `ass_i2c_delay_half'

C:\Users\adam3\AppData\Local\Temp\cc9iCKuJ.ltrans0.ltrans.o: In function `i2c_start(unsigned char) [clone .constprop.8]':

C:\Users\adam3\Downloads\rd117_arduino_v01_00\Design Files\RD117_ARDUINO1/SoftI2CMaster.h:309: undefined reference to `ass_i2c_wait_scl_high'

C:\Users\adam3\Downloads\rd117_arduino_v01_00\Design Files\RD117_ARDUINO1/SoftI2CMaster.h:309: undefined reference to `ass_i2c_delay_half'

C:\Users\adam3\Downloads\rd117_arduino_v01_00\Design Files\RD117_ARDUINO1/SoftI2CMaster.h:309: undefined reference to `ass_i2c_write'

C:\Users\adam3\AppData\Local\Temp\cc9iCKuJ.ltrans0.ltrans.o: In function `ass_i2c_stop':

C:\Users\adam3\Downloads\rd117_arduino_v01_00\Design Files\RD117_ARDUINO1/SoftI2CMaster.h:382: undefined reference to `ass_i2c_delay_half'

C:\Users\adam3\Downloads\rd117_arduino_v01_00\Design Files\RD117_ARDUINO1/SoftI2CMaster.h:382: undefined reference to `ass_i2c_delay_half'

C:\Users\adam3\Downloads\rd117_arduino_v01_00\Design Files\RD117_ARDUINO1/SoftI2CMaster.h:382: undefined reference to `ass_i2c_wait_scl_high'

C:\Users\adam3\Downloads\rd117_arduino_v01_00\Design Files\RD117_ARDUINO1/SoftI2CMaster.h:382: undefined reference to `ass_i2c_delay_half'

collect2.exe: error: ld returned 1 exit status

exit status 1

Error compiling for board Arduino Uno.



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

The reason for these errors is you are using a very outdated version of the SoftI2CMaster library. One of the improvements to the library that you missed out on is this one from 5 years ago:

This became necessary when Arduino updated the version of the avr-gcc compiler used for your Uno board. That update introduced more aggressive code optimization to make the sketch size smaller so you can fit more code into the limited memory of the microcontrollers on the Arduino boards. In this case, it seems the compiler gets a little overexuberant with the optimization and removes code that is actually needed, thinking it was not used due to the peculiarities of this library. Adding the used attribute to the function declarations tells the compiler that we really do need that code and to leave it in.

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