Skip to content

esp32-c3-devkitm-1u BMP280 Crash Dump #264

Answered by UncleRus
jimcondit asked this question in Q&A
Discussion options

You must be logged in to vote

Why it's crashing? It's crashing due to the call ESP_ERROR_CHECK() macro on the line 28 of main.c in example:

ESP_ERROR_CHECK(bmp280_init(&dev, &params));

bmp280_init() tries to communicate with the device by incorrect I2C address, returns ESP_FAIL and ESP_ERROR_CHECK() reboots the chip.

Here's what you need to do:

  1. Correct the I2C address. In line 27 of main.c in example replace BMP280_I2C_ADDRESS_0 with BMP280_I2C_ADDRESS_1:
ESP_ERROR_CHECK(bmp280_init_desc(&dev, BMP280_I2C_ADDRESS_1, 0, SDA_GPIO, SCL_GPIO));
  1. Replace GPIO numbers with yours in lines 12 and 13 of main.c
#define SDA_GPIO 5
#define SCL_GPIO 6
  1. Compile and flash the example.

Replies: 1 comment 1 reply

Comment options

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

Answer selected by jimcondit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants