I am using the nRF52840-dongle. I tried to create and application with the i2c library for bme280 sensor. When I run the following I get the error in linking step that there is undefined reference for i2c_read_reg and i2c_write_reg.
make BOARD=nrf52840dongle -C examples/myapplication
RIOT/examples/myapplication/bin/nrf52840dongle/bmx280/bmx280.o: in function _read_reg': /RIOT/drivers/bmx280/bmx280.c:102: undefined reference to i2c_read_reg’
I have checked weather i2c.h is included in the application via bmx280.h—>it is included following the makefiles i2c defination.
Also the sources should be compilled for i2c.c via some of the
Seems that I could be missing something in Makefile, here is the Makefile of my application…
> # Set the name of your application:
> APPLICATION = foobar
>
> # If no BOARD is found in the environment, use this default:
> CPU += nrf52
> BOARD += nrf52840dongle
> DRIVER ?= bme280_i2c
> USEMODULE += fmt
> USEMODULE += $(DRIVER)
> USEMODULE += xtimer
>
> USEMODULE += bme280_i2c
> USEMODULE += bmp280_i2c
>
> FEATURES_PROVIDED += periph_i2c
> FEATURES_PROVIDED += periph_uart
> USEMODULE += dht
>
> CFLAGS += -DBMX280_PARAM_I2C_DEV=I2C_DEV\(0\)
> CFLAGS += -DBMX280_PARAM_I2C_ADDR=0x76
> # This has to be the absolute path to the RIOT base directory:
> RIOTBASE ?= $(CURDIR)/../../
> QUIET ?= 1
> include $(RIOTBASE)/Makefile.include
FEATURES_PROVIDED is something that’s used by a board configuration. If you intended to use i2c or uart, use FEATURES_REQUIRED instead. but both periph_uart and periph_i2c should be pulled automatically by the dependency resolution.
I did some changes as you have mentioned in the Makefile but the undefined reference in .o files continues to pop-up. This is both for /test/driver_bmx280 and also for my application in examples/myapplication.
One thing I am not sure is that it always fails after the line.