Skip to content

Trying to get the BMM150 Magnetometer Working #89232

Answered by mjs513
mjs513 asked this question in Q&A
Discussion options

You must be logged in to vote

Just as a heads up to any finding this discussion I managed to get the BMM150 working.

Comparing chip init in zephyr to the chip init in the DFRobot library found that they do not do a softreset as part of the chip init only a power suspend and power on before configuring the chip, i.e., modified in static int bmm150_init_chip(const struct device *dev)

	//if (bmm150_full_por(dev) != 0) {
	//	goto err_poweroff;
	//}
  
	ret = bmm150_power_control(dev, 0);
	if (ret != 0) {
		LOG_ERR("failed to enter suspend mode: %d", ret);
		return ret;
	}

	k_sleep(BMM150_POR_TIME);

	ret = bmm150_power_control(dev, 1);
	if (ret != 0) {
		LOG_ERR("failed to go back into sleep mode: %d", ret);
		return ret…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@mjs513
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by JarmouniA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants