You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to use the BME680-driver on an ESP32C6 with VSC on Linux with newest ESP-IDF (v5.1.2).
Unfortunately the controller went in an error by init the sensor. After a debug session I realized, that there is a wrong variable initialization.
the definitions in bme680.h:
/** * BME680 sensor device data structure type*/typedefstruct
{
i2c_dev_t i2c_dev; //!< I2C device descriptorbool meas_started; //!< Indicates whether measurement starteduint8_t meas_status; //!< Last sensor status (for internal use only)bme680_settings_t settings; //!< Sensor settingsbme680_calib_data_t calib_data; //!< Calibration data of the sensor
} bme680_t;
//Test-Dev without the first structtypedefstruct
{
bool meas_started; //!< Indicates whether measurement starteduint8_t meas_status; //!< Last sensor status (for internal use only)bme680_settings_t settings; //!< Sensor settingsbme680_calib_data_t calib_data; //!< Calibration data of the sensor
} bme680t1;
typedefstruct
{
i2c_dev_t i2c_dev0; //!< I2C device descriptor
} bme680_t_1;
the definitions in i2cdev.h:
/** * I2C device descriptor*/typedefstruct
{
i2c_port_t port; //!< I2C port numberi2c_config_t cfg; //!< I2C driver configurationuint8_t addr; //!< Unshifted address
SemaphoreHandle_t mutex; //!< Device mutexuint32_t timeout_ticks; /*!< HW I2C bus timeout (stretch time), in ticks. 80MHz APB clock ticks for ESP-IDF, CPU ticks for ESP8266. When this value is 0, I2CDEV_MAX_STRETCH_TIME will be used */
} i2c_dev_t;
typedefstruct
{
i2c_port_t port; //!< I2C port numberi2c_config_t cfg; //!< I2C driver configurationuint8_t addr; //!< Unshifted address
SemaphoreHandle_t mutex; //!< Device mutexuint32_t timeout_ticks; /*!< HW I2C bus timeout (stretch time), in ticks. 80MHz APB clock ticks for ESP-IDF, CPU ticks for ESP8266. When this value is 0, I2CDEV_MAX_STRETCH_TIME will be used */
} i2c_dev_t_stek;
The variables (breakpoint after the declarations) are shown in the picture.
What you see: The nested structs are absolutely wrong - and I don't know how and why. The compiler(?) uses the wrong struct definitions. And...after a nested struct the the definition in the typedef stops.
What is going wrong here?
Which SDK are you using?
esp-idf
Which version of SDK are you using?
v5.1.2
Which build target have you used?
esp32
esp32s2
esp32s3
esp32c2
esp8266
other
Component causing the issue
BME680, I2CDEV
Anything in the logs that might be useful for us?
No response
Additional information or context
No response
Confirmation
This report is not a question nor a request for drivers.
The text was updated successfully, but these errors were encountered:
rk-sTEk
changed the title
Problem with nested structs in BME680-Driver
Problem with nested structs in BME680-Driver / I²C-init
Feb 13, 2024
The issue
I try to use the BME680-driver on an ESP32C6 with VSC on Linux with newest ESP-IDF (v5.1.2).
Unfortunately the controller went in an error by init the sensor. After a debug session I realized, that there is a wrong variable initialization.
the definitions in bme680.h:
the definitions in i2cdev.h:
the declarations:
The variables (breakpoint after the declarations) are shown in the picture.
What you see: The nested structs are absolutely wrong - and I don't know how and why. The compiler(?) uses the wrong struct definitions. And...after a nested struct the the definition in the typedef stops.
What is going wrong here?
Which SDK are you using?
esp-idf
Which version of SDK are you using?
v5.1.2
Which build target have you used?
Component causing the issue
BME680, I2CDEV
Anything in the logs that might be useful for us?
No response
Additional information or context
No response
Confirmation
The text was updated successfully, but these errors were encountered: