Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BME680 Sensor is not building #21607

Closed
md-jamal opened this issue Dec 27, 2019 · 7 comments
Closed

BME680 Sensor is not building #21607

md-jamal opened this issue Dec 27, 2019 · 7 comments

Comments

@md-jamal
Copy link

Describe the bug
A clear and concise description of what the bug is.
What have you tried to diagnose or workaround this issue?

To Reproduce
Steps to reproduce the behavior:
$ west build -b sam_e70_xplained samples/sensor/bme680

Expected behavior
Build failed. From one of the issues, it says to update device tree . Can you please provide an sample device tree for bme680

Adding this, didn't work

bme680@77 {
compatible = "bosch,bme680";
reg = <0x77>;
};

Screenshots or console output
/home/abc/zephyrproject/zephyr/samples/sensor/bme680/src/main.c:14:42: error: 'DT_INST_0_BOSCH_BME680_LABEL' undeclared (first use in this function); did you mean 'DT_INST_0_SOC_NV_FLASH_LABEL'?
struct device *dev = device_get_binding(DT_INST_0_BOSCH_BME680_LABEL);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
DT_INST_0_SOC_NV_FLASH_LABEL

Environment (please complete the following information):

  • OS: Linux
  • Toolchain: Zephyr SDK
  • Commit SHA or Version used: 2.1.99

Additional context
Add any other context about the problem here.

@md-jamal md-jamal added the bug The issue is a bug, or the PR is fixing a bug label Dec 27, 2019
@ulfalizer
Copy link
Collaborator

CC @boschsensortec

Not familiar with this device, but try making it

bme680@77 {
	compatible = "bosch,bme680";
	reg = <0x77>;
	label = "BME680";
};

Doing a git grep for some of the other compatible strings you'll find in the bindings in dts/bindings/sensor/ might be helpful too, e.g. bosch,bmg160.

@md-jamal
Copy link
Author

md-jamal commented Dec 27, 2019

Added the following to sam_e70_xplained.overlay

bme680@77 {
	compatible = "bosch,bme680";
	reg = <0x77>;
	label = "BME680";
};

I get the following error:

Error: sam_e70_xplained.dts.pre.tmp:403.1-10 syntax error
FATAL ERROR: Unable to parse input tree
CMake Error at /home/abc/zephyrproject/zephyr/cmake/dts.cmake:183 (message):
  command failed with return code: 1
Call Stack (most recent call first):
  /home/abc/zephyrproject/zephyr/cmake/app/boilerplate.cmake:460 (include)
  CMakeLists.txt:8 (include)

@pabigot
Copy link
Collaborator

pabigot commented Dec 27, 2019

The node has to be a child of an I2C controller. E.g.:

&i2c0 {
  bme60@77 {
    label = "bme680";
    compatible = "bosch,bme680";
    reg = <0x77>;
  };
};

@md-jamal
Copy link
Author

It worked...

@carlescufi
Copy link
Member

I believe the issue is that you need to add a bme680 instance in your device tree file.

@carlescufi
Copy link
Member

Try something like this:

&i2c1 {
	compatible = ...

	bme680@76 {
		compatible = "bosch,bme680";
		label = "BME680";
		reg = <0x76>;
	};
};

ulfalizer added a commit to ulfalizer/zephyr that referenced this issue Jan 9, 2020
Show how the element size was calculated in the error message when a
'reg', 'ranges', or 'interrupts' property has the wrong size. This
should help with debugging. Also mention that #*-cells properties come
from the parent node, which can be subtle.

Came up in zephyrproject-rtos#21607
(though it seems the comment disappeared).

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
carlescufi pushed a commit that referenced this issue Jan 13, 2020
Show how the element size was calculated in the error message when a
'reg', 'ranges', or 'interrupts' property has the wrong size. This
should help with debugging. Also mention that #*-cells properties come
from the parent node, which can be subtle.

Came up in #21607
(though it seems the comment disappeared).

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
@nashif
Copy link
Member

nashif commented Jan 20, 2020

seems to be answered, closing.

@nashif nashif closed this as completed Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants