-
First time using the UncleRus library. While trying to use the example code for the BMP280, and after modifying the SLA and SLC pins (respectively GPIO5, GPIO6), all compiles nicely but throws a crash dump during execution. (Shown below.) If I believe the dump, it appears to be crashing at the bmp280_init call. Also, it appears to be looking for the device at 0x76. But, when using espressif 12c_tools code, it finds the device at 0x77, which appears to be correct from other resource. Did I miss some configuration parameter? Thanks for your help! Jim I (940) cpu_start: Starting scheduler. file: "../main/main.c" line 28 abort() was called at PC 0x40384c7f on core 0 Stack dump detected 0x40384c8a: __ubsan_include at /home/condit/esp/esp-idf/components/esp_system/ubsan.c:294 TP : 0x3fc8aae0 T0 : 0x37363534 T1 : 0x7271706f T2 : 0x33323130 MHARTID : 0x00000000 Failed to run gdb_panic_server.py script: Command '['riscv32-esp-elf-gdb', '--batch', '-n', '/home/condit/esp/bmp280/build/example-bmp280.elf', '-ex', 'target remote | "/home/condit/.espressif/python_env/idf5.0_py3.8_env/bin/python" "/home/condit/esp/esp-idf/tools/idf_monitor_base/../gdb_panic_server.py" --target esp32c3 "/tmp/tmp_8lroo2r"', '-ex', 'bt']' returned non-zero exit status 127. Core 0 register dump: Stack memory: ELF file SHA256: ebe48ad7b0505c0e Rebooting... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Why it's crashing? It's crashing due to the call ESP_ERROR_CHECK(bmp280_init(&dev, ¶ms));
Here's what you need to do:
ESP_ERROR_CHECK(bmp280_init_desc(&dev, BMP280_I2C_ADDRESS_1, 0, SDA_GPIO, SCL_GPIO));
#define SDA_GPIO 5
#define SCL_GPIO 6
|
Beta Was this translation helpful? Give feedback.
Why it's crashing? It's crashing due to the call
ESP_ERROR_CHECK()
macro on the line 28 ofmain.c
in example:bmp280_init()
tries to communicate with the device by incorrect I2C address, returnsESP_FAIL
andESP_ERROR_CHECK()
reboots the chip.Here's what you need to do:
main.c
in example replaceBMP280_I2C_ADDRESS_0
withBMP280_I2C_ADDRESS_1
:main.c