Hi Stefan,toggle quoted messageShow quoted text
If your board selects HAS_DTS_I2C_DEVICE, then you should define CONFIG_LSM6DS0_I2C_MASTER_DEV_NAME and CONFIG_LSM6DS0_I2C_ADDR in your board dts.fixup file rather than myboard_defconfig. See boards/arm/hexiwear_k64/dts.fixup for an example.
From: users@... [mailto:users@...] On Behalf Of Stefan Jaritz
Sent: Friday, August 10, 2018 1:15 PM
Subject: [Zephyr-users] How to connect the LSM6DS0 sensor when using a custom board? #sensor #dts #defconfig
I am failing to get my LSM6DS3(almost LSM6DS0) sensor rightfully setup.
Maybe someone can give me a hint.
LSM6DS3 <--> I2C1 @ stm32F412 <--> Zephyr OS
I created an own board for that. It is configured via myboard_defconfig.
I added into that file:
# movement sensor
In myboard.dts I added:
status = "ok";
clock-frequency = <I2C_BITRATE_FAST>;
compatible = "st,lsm6ds0";
reg = <0x6A>;
label = "LSM6DS3";
I am getting following error:
‘CONFIG_LSM6DS0_I2C_MASTER_DEV_NAME’ undeclared here (not in a function)
.i2c_master_dev_name = CONFIG_LSM6DS0_I2C_MASTER_DEV_NAME,
‘CONFIG_LSM6DS0_I2C_ADDR’ undeclared here (not in a function)
.i2c_slave_addr = CONFIG_LSM6DS0_I2C_ADDR,
^~~~~~~~~~~~~~~~~~~~~~~ In file included from ~/zephyr/include/sensor.h:27:0,
‘CONFIG_LSM6DS0_DEV_NAME’ undeclared here (not in a function)
DEVICE_AND_API_INIT(lsm6ds0, CONFIG_LSM6DS0_DEV_NAME, lsm6ds0_init,
~/zephyr/include/device.h:106:11: note: in definition of macro ‘DEVICE_AND_API_INIT’
.name = drv_name, .init = (init_fn), \
I took the hexiwear_k64 board as template.
Any ideas how to get these problem solved?