mjaakkol / bme680_esp_idf Goto Github PK
View Code? Open in Web Editor NEWBME680 software build on top of ESP-IDF 4.0 generation and Bosch BSEC stack
License: MIT License
BME680 software build on top of ESP-IDF 4.0 generation and Bosch BSEC stack
License: MIT License
Hello @mjaakkol
I used your repository in ESP-IDF 4.2, I given the NVS partition but esp not able to find the nvs.
So, I comment on that part.
After the loading configuration, the esp core is dumping continuously.
Here is the example file.
#define I2C_MASTER_TX_BUF_DISABLE 0 /*!< I2C master doesn't need buffer */
#define I2C_MASTER_RX_BUF_DISABLE 0 /*!< I2C master doesn't need buffer */
#define I2C_FREQUENCY 100000
#define I2C_GPIO_SDA GPIO_NUM_21
#define I2C_GPIO_SCL GPIO_NUM_22
#define ACTIVE_I2C I2C_NUM_0
#define STORAGE_NAMESPACE "storage"
static const char *TAG = "bme680_sensor";
static const char *sensor_binary = "sensor_blob";
/**********************************************************************************************************************/
/* functions */
/**********************************************************************************************************************/
/*!
* @brief Write operation in either I2C or SPI
*
* param[in] dev_addr I2C or SPI device address
* param[in] reg_addr register address
* param[in] reg_data_ptr pointer to the data to be written
* param[in] data_len number of bytes to be written
*
* @return result of the bus communication function
*/
int8_t bus_write(uint8_t dev_addr, uint8_t reg_addr, uint8_t *reg_data_ptr, uint16_t data_len)
{
// ...
// Please insert system specific function to write to the bus where BME680 is connected
// ...
i2c_cmd_handle_t cmd = i2c_cmd_link_create();
assert(data_len > 0 && reg_data_ptr != NULL); // Safeguarding the assumptions
i2c_master_start(cmd);
i2c_master_write_byte(cmd, (dev_addr << 1) | I2C_MASTER_WRITE, true);
i2c_master_write_byte(cmd, reg_addr, true);
i2c_master_write(cmd, reg_data_ptr, data_len, true);
i2c_master_stop(cmd);
esp_err_t ret = i2c_master_cmd_begin(I2C_NUM_0, cmd, 1000 / portTICK_PERIOD_MS);
i2c_cmd_link_delete(cmd);
// ESP_OK matches with the function success code (0)
return (int8_t)ret;
}
/*!
* @brief Read operation in either I2C or SPI
*
* param[in] dev_addr I2C or SPI device address
* param[in] reg_addr register address
* param[out] reg_data_ptr pointer to the memory to be used to store the read data
* param[in] data_len number of bytes to be read
*
* @return result of the bus communication function
*/
int8_t bus_read(uint8_t dev_addr, uint8_t reg_addr, uint8_t *reg_data_ptr, uint16_t data_len)
{
// ...
// Please insert system specific function to read from bus where BME680 is connected
// ...
i2c_cmd_handle_t cmd = i2c_cmd_link_create();
assert(data_len > 0 && reg_data_ptr != NULL); // Safeguarding the assumptions
// Feeding the command in
i2c_master_start(cmd);
i2c_master_write_byte(cmd, (dev_addr << 1) | I2C_MASTER_WRITE, true);
i2c_master_write_byte(cmd, reg_addr, true);
//bme680_sleep(150);
// Reading data back
i2c_master_start(cmd);
i2c_master_write_byte(cmd, (dev_addr << 1) | I2C_MASTER_READ, true);
if (data_len > 1)
{
i2c_master_read(cmd, reg_data_ptr, data_len - 1, I2C_MASTER_ACK);
}
i2c_master_read_byte(cmd, reg_data_ptr + data_len - 1, I2C_MASTER_NACK);
i2c_master_stop(cmd);
esp_err_t ret = i2c_master_cmd_begin(I2C_NUM_0, cmd, 1000 / portTICK_PERIOD_MS);
i2c_cmd_link_delete(cmd);
// ESP_OK matches with the function success code (0)
return (int8_t)ret;
}
/*!
* @brief System specific implementation of sleep function
*
* @param[in] t_ms time in milliseconds
*
* @return none
*/
static void bme680_sleep(uint32_t t_ms)
{
// ...
// Please insert system specific function sleep or delay for t_ms milliseconds
// ...
vTaskDelay(pdMS_TO_TICKS(t_ms));
}
/*!
* @brief Handling of the ready outputs
*
* @param[in] timestamp time in nanoseconds
* @param[in] iaq IAQ signal
* @param[in] iaq_accuracy accuracy of IAQ signal
* @param[in] temperature temperature signal
* @param[in] humidity humidity signal
* @param[in] pressure pressure signal
* @param[in] raw_temperature raw temperature signal
* @param[in] raw_humidity raw humidity signal
* @param[in] gas raw gas sensor signal
* @param[in] bsec_status value returned by the bsec_do_steps() call
*
* @return none
*/
void output_ready(int64_t timestamp, float iaq, uint8_t iaq_accuracy, float temperature, float humidity,
float pressure, float raw_temperature, float raw_humidity, float gas, bsec_library_return_t bsec_status,
float static_iaq, float co2_equivalent, float breath_voc_equivalent)
{
// ...
// Please insert system specific code to further process or display the BSEC outputs
// ...
ESP_LOGI(TAG, "iaq %f temp %f hum %f press %f static iaq %f co2_equivalent %f breath voc %f", iaq, temperature, humidity, pressure, static_iaq, co2_equivalent, breath_voc_equivalent);
}
/*!
* @brief Load previous library state from non-volatile memory
*
* @param[in,out] state_buffer buffer to hold the loaded state string
* @param[in] n_buffer size of the allocated state buffer
*
* @return number of bytes copied to state_buffer
*/
uint32_t state_load(uint8_t *state_buffer, uint32_t n_buffer)
{
// ...
// Load a previous library state from non-volatile memory, if available.
//
// Return zero if loading was unsuccessful or no state was available,
// otherwise return length of loaded state string.
// ...
nvs_handle_t my_handle;
// esp_err_t err = nvs_open(STORAGE_NAMESPACE, NVS_READONLY, &my_handle);
// switch (err)
// {
// case ESP_OK:
// printf("< storage handle was opened successfully \n");
// err = nvs_get_blob(my_handle, sensor_binary, state_buffer, &n_buffer);
// // We close this anyway even if the operation didn't succeed.
// nvs_close(my_handle);
// if (err == ESP_OK)
// {
// return n_buffer;
// }
// ESP_LOGI(TAG, "loading sensor binary blob failed with code %d", err);
// break;
// case ESP_ERR_NVS_NOT_INITIALIZED:
// printf(" < ESP_ERR_NVS_NOT_INITIALIZED \n");
// break;
// case ESP_ERR_NVS_PART_NOT_FOUND:
// printf(" < ESP_ERR_NVS_PART_NOT_FOUND \n");
// break;
// case ESP_ERR_NVS_NOT_FOUND:
// printf(" < ESP_ERR_NVS_NOT_FOUND \n");
// break;
// case ESP_ERR_NVS_INVALID_NAME:
// printf(" < ESP_ERR_NVS_INVALID_NAME \n");
// break;
// case ESP_ERR_NO_MEM:
// printf(" < ESP_ERR_NO_MEM \n");
// break;
// default:
// break;
// }
//ESP_ERROR_CHECK( err );
return 0;
}
/*!
* @brief Save library state to non-volatile memory
*
* @param[in] state_buffer buffer holding the state to be stored
* @param[in] length length of the state string to be stored
*
* @return none
*/
void state_save(const uint8_t *state_buffer, uint32_t length)
{
// ...
// Save the string some form of non-volatile memory, if possible.
// ...
nvs_handle_t my_handle;
// esp_err_t err = nvs_open(STORAGE_NAMESPACE, NVS_READWRITE, &my_handle);
// //ESP_ERROR_CHECK(err);
// switch (err)
// {
// case ESP_OK:
// printf("->storage handle was opened successfully \n");
// err = nvs_set_blob(my_handle, sensor_binary, state_buffer, length);
// //ESP_ERROR_CHECK( err );
// err = nvs_commit(my_handle);
// // ESP_ERROR_CHECK(err);
// nvs_close(my_handle);
// break;
// case ESP_ERR_NVS_NOT_INITIALIZED:
// printf(" ->ESP_ERR_NVS_NOT_INITIALIZED \n");
// break;
// case ESP_ERR_NVS_PART_NOT_FOUND:
// printf(" ->ESP_ERR_NVS_PART_NOT_FOUND \n");
// break;
// case ESP_ERR_NVS_NOT_FOUND:
// printf(" ->ESP_ERR_NVS_NOT_FOUND \n");
// break;
// case ESP_ERR_NVS_INVALID_NAME:
// printf(" ->ESP_ERR_NVS_INVALID_NAME \n");
// break;
// case ESP_ERR_NO_MEM:
// printf(" ->ESP_ERR_NO_MEM \n");
// break;
// default:
// break;
// }
return;
}
/*!
* @brief Load library config from non-volatile memory
*
* @param[in,out] config_buffer buffer to hold the loaded state string
* @param[in] n_buffer size of the allocated state buffer
*
* @return number of bytes copied to config_buffer
*/
uint32_t config_load(uint8_t *config_buffer, uint32_t n_buffer)
{
// ...
// Load a library config from non-volatile memory, if available.
//
// Return zero if loading was unsuccessful or no config was available,
// otherwise return length of loaded config string.
// ...
ESP_LOGI(TAG, "Loading configuration: buffer-size %d config size %d", n_buffer, sizeof(bsec_config_iaq));
assert(n_buffer >= sizeof(bsec_config_iaq));
memcpy(config_buffer, bsec_config_iaq, sizeof(bsec_config_iaq));
return sizeof(bsec_config_iaq);
}
static esp_err_t i2c_master_init(void)
{
esp_err_t ret;
i2c_config_t conf = {
.mode = I2C_MODE_MASTER,
.sda_io_num = I2C_GPIO_SDA,
.scl_io_num = I2C_GPIO_SCL,
.sda_pullup_en = GPIO_PULLUP_ENABLE,
.scl_pullup_en = GPIO_PULLUP_ENABLE,
.master.clk_speed = I2C_FREQUENCY,
};
i2c_param_config(I2C_NUM_0, &conf);
ret = i2c_driver_install(I2C_NUM_0, conf.mode,
I2C_MASTER_RX_BUF_DISABLE,
I2C_MASTER_TX_BUF_DISABLE, 0);
switch (ret)
{
case ESP_OK:
printf("I2C initialize-->\n");
break;
default:
printf("I2C Failed-->\n");
break;
}
return ret;
}
/*!
* @brief Main function which configures BSEC library and then reads and processes the data from sensor based
* on timer ticks
*
* @return result of the processing
*/
void initialize_sensor()
{
return_values_init ret;
esp_err_t err = i2c_master_init();
ESP_ERROR_CHECK(err);
ESP_LOGI(TAG, "I2C initialized");
/* Call to the function which initializes the BSEC library
* Switch on low-power mode and provide no temperature offset */
ret = bsec_iot_init(BSEC_SAMPLE_RATE_LP, 0.0f, bus_write, bus_read, bme680_sleep, state_load, config_load);
if (ret.bme680_status)
{
/* Could not initialize BME680 */
ESP_LOGE(TAG, "initializing BME680 failed %d", ret.bme680_status);
//return (int)ret.bme680_status;
}
else if (ret.bsec_status)
{
/* Could not intialize BSEC library */
ESP_LOGE(TAG, "initializing BSEC failed %d", ret.bsec_status);
//return (int)ret.bsec_status;
}
//ESP_LOGI(TAG, "Entering into the loop");
/* Call to endless loop function which reads and processes data based on sensor settings */
/* State is saved every 10.000 samples, which means every 10.000 * 3 secs = 500 minutes */
bsec_iot_loop(bme680_sleep, esp_timer_get_time, output_ready, state_save, 10000);
return; //0;
}
/*! @}*/
void app_main()
{
esp_err_t err = nvs_flash_init();
if (err == ESP_ERR_NVS_NO_FREE_PAGES || err == ESP_ERR_NVS_NEW_VERSION_FOUND)
{
// NVS partition was truncated and needs to be erased
// Retry nvs_flash_init
ESP_ERROR_CHECK(nvs_flash_erase());
err = nvs_flash_init();
}
ESP_ERROR_CHECK(err);
//initialize_sensor();
TaskHandle_t xHandle = NULL;
xTaskCreate(initialize_sensor, "Initialize_Sensor", 4096, NULL, 1, &xHandle);
}
/*
Current ESP-IDF 4.0 doesn't provide the function for newlib so the approximation
is provided here for __ieee754_sqrtf
Once the linker warning appears, feel free to delete the code
*/
float __ieee754_sqrtf(float number)
{
long i;
float x2, y;
const float threehalfs = 1.5F;
x2 = number * 0.5F;
y = number;
i = *(long *)&y; // floating point bit level hacking [sic]
i = 0x5f3759df - (i >> 1); // Newton's approximation
y = *(float *)&i;
y = y * (threehalfs - (x2 * y * y)); // 1st iteration
y = y * (threehalfs - (x2 * y * y)); // 2nd iteration
y = y * (threehalfs - (x2 * y * y)); // 3rd iteration
return 1 / y;
}
Log.
I (85) boot: 2 factory factory app 00 00 00010000 00100000
I (93) boot: 3 storage OTA data 01 00 00110000 00040000
I (100) boot: End of partition table
I (105) boot: Defaulting to factory image
I (109) boot_comm: chip revision: 1, min. application chip revision: 0
I (117) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x0936c ( 37740) map
I (140) esp_image: segment 1: paddr=0x00019394 vaddr=0x3ffb0000 size=0x0210c ( 8460) load
I (144) esp_image: segment 2: paddr=0x0001b4a8 vaddr=0x40080000 size=0x00404 ( 1028) load
I (147) esp_image: segment 3: paddr=0x0001b8b4 vaddr=0x40080404 size=0x04764 ( 18276) load
I (164) esp_image: segment 4: paddr=0x00020020 vaddr=0x400d0020 size=0x21afc (137980) map
I (217) esp_image: segment 5: paddr=0x00041b24 vaddr=0x40084b68 size=0x06fd4 ( 28628) load
I (236) boot: Loaded app from partition at offset 0x10000
I (236) boot: Disabling RNG early entropy source...
I (237) cpu_start: Pro cpu up.
I (241) cpu_start: Application information:
I (245) cpu_start: Project name: bme680_esp
I (251) cpu_start: App version: v4.2-351-gce2c615bb-dirty
I (257) cpu_start: Compile time: Apr 3 2021 17:00:20
I (263) cpu_start: ELF file SHA256: 2685d837d7b96ed2...
I (269) cpu_start: ESP-IDF: v4.2-351-gce2c615bb-dirty
I (276) cpu_start: Starting app cpu, entry point is 0x40081758
I (268) cpu_start: App cpu up.
I (286) heap_init: Initializing. RAM available for dynamic allocation:
I (293) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (299) heap_init: At 3FFB2ED8 len 0002D128 (180 KiB): DRAM
I (305) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (312) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (318) heap_init: At 4008BB3C len 000144C4 (81 KiB): IRAM
I (324) cpu_start: Pro cpu start user code
I (343) spi_flash: detected chip: generic
I (343) spi_flash: flash io: dio
I (343) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I2C initialize-->
I (10) bme680_sensor: I2C initialized
I (20) bme680_sensor: Loading configuration: buffer-size 454 config size 454
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x400d288e PS : 0x00060b33 A0 : 0x800d2c1d A1 : 0x3ffb5430
A2 : 0x00000000 A3 : 0x3ffb5450 A4 : 0x00000014 A5 : 0x000000a5
A6 : 0x000000a5 A7 : 0x00060023 A8 : 0x8005937d A9 : 0x3ffb5420
A10 : 0x3ffb5570 A11 : 0x00060b23 A12 : 0x00060b23 A13 : 0x00060b23
A14 : 0x00000001 A15 : 0x0000007f SAR : 0x00000000 EXCCAUSE: 0x0000001c
EXCVADDR: 0x8005937d LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000
Backtrace:0x400d288b:0x3ffb5430 0x400d2c1a:0x3ffb5450 0x400d2c47:0x3ffb5480 0x400d2ce5:0x3ffb54a0 0x4008682a:0x3ffb54c0 0x40085ead:0x3ffb54e0
ELF file SHA256: 2685d837d7b96ed2
Rebooting...
ets Jun 8 2016 00:22:57
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:4
load:0x3fff0034,len:7336
load:0x40078000,len:13212
load:0x40080400,len:4568
entry 0x400806f4
I did everything as instructed. First it rejected to find libm.a, but i found it and copied to the desired place.
idf.py build
Executing action: all (aliases: build)
Running ninja in directory /Users/dmg/tmp/bme680_esp_idf/build
Executing "ninja all"...
[11/933] cd /Users/dmg/tmp/bme680_esp_idf/build/esp-idf/partition_table && /usr/local/Cellar/cmake/3....1/bin/cmake -E echo "*******************************************************************************"
Partition table binary generated. Contents:
*******************************************************************************
# ESP-IDF Partition Table
# Name, Type, SubType, Offset, Size, Flags
nvs,data,nvs,0x9000,24K,
phy_init,data,phy,0xf000,4K,
factory,app,factory,0x10000,1M,
*******************************************************************************
[360/933] Performing configure step for 'bootloader'
-- Building ESP-IDF components for target esp32
-- Adding linker script /Users/dmg/esp/esp-idf/components/esp32/ld/esp32.peripherals.ld
-- Adding linker script /Users/dmg/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.ld
-- Adding linker script /Users/dmg/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
-- Adding linker script /Users/dmg/esp/esp-idf/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
-- Adding linker script /Users/dmg/esp/esp-idf/components/bootloader/subproject/main/ld/esp32/bootloader.ld
-- Adding linker script /Users/dmg/esp/esp-idf/components/bootloader/subproject/main/ld/esp32/bootloader.rom.ld
-- Components: bootloader bootloader_support efuse esp32 esp_common esp_rom esptool_py log main micro-ecc partition_table soc spi_flash xtensa
-- Component paths: /Users/dmg/esp/esp-idf/components/bootloader /Users/dmg/esp/esp-idf/components/bootloader_support /Users/dmg/esp/esp-idf/components/efuse /Users/dmg/esp/esp-idf/components/esp32 /Users/dmg/esp/esp-idf/components/esp_common /Users/dmg/esp/esp-idf/components/esp_rom /Users/dmg/esp/esp-idf/components/esptool_py /Users/dmg/esp/esp-idf/components/log /Users/dmg/esp/esp-idf/components/bootloader/subproject/main /Users/dmg/esp/esp-idf/components/bootloader/subproject/components/micro-ecc /Users/dmg/esp/esp-idf/components/partition_table /Users/dmg/esp/esp-idf/components/soc /Users/dmg/esp/esp-idf/components/spi_flash /Users/dmg/esp/esp-idf/components/xtensa
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/dmg/tmp/bme680_esp_idf/build/bootloader
[381/933] Performing build step for 'bootloader'
[1/2] Linking C executable bootloader.elf
[2/2] Generating binary image from built executable
esptool.py v3.0-dev
Generated /Users/dmg/tmp/bme680_esp_idf/build/bootloader/bootloader.bin
[932/933] Linking CXX executable bme680_esp.elf
FAILED: bme680_esp.elf
: && /Users/dmg/.espressif/tools/xtensa-esp32-elf/esp-2020r1-8.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++ -mlongcalls -Wno-frame-address -L/usr/local/opt/libxml2/lib CMakeFiles/bme680_esp.elf.dir/project_elf_src.c.obj -o bme680_esp.elf esp-idf/xtensa/libxtensa.a esp-idf/mbedtls/libmbedtls.a esp-idf/efuse/libefuse.a esp-idf/bootloader_support/libbootloader_support.a esp-idf/app_update/libapp_update.a esp-idf/spi_flash/libspi_flash.a esp-idf/esp_system/libesp_system.a esp-idf/soc/libsoc.a esp-idf/vfs/libvfs.a esp-idf/esp_eth/libesp_eth.a esp-idf/tcpip_adapter/libtcpip_adapter.a esp-idf/esp_netif/libesp_netif.a esp-idf/esp_event/libesp_event.a esp-idf/wpa_supplicant/libwpa_supplicant.a esp-idf/nvs_flash/libnvs_flash.a esp-idf/esp_wifi/libesp_wifi.a esp-idf/lwip/liblwip.a esp-idf/log/liblog.a esp-idf/heap/libheap.a esp-idf/esp_ringbuf/libesp_ringbuf.a esp-idf/driver/libdriver.a esp-idf/pthread/libpthread.a esp-idf/espcoredump/libespcoredump.a esp-idf/perfmon/libperfmon.a esp-idf/esp32/libesp32.a esp-idf/esp_common/libesp_common.a esp-idf/esp_timer/libesp_timer.a esp-idf/freertos/libfreertos.a esp-idf/newlib/libnewlib.a esp-idf/cxx/libcxx.a esp-idf/app_trace/libapp_trace.a esp-idf/asio/libasio.a esp-idf/cbor/libcbor.a esp-idf/coap/libcoap.a esp-idf/console/libconsole.a esp-idf/nghttp/libnghttp.a esp-idf/esp-tls/libesp-tls.a esp-idf/esp_adc_cal/libesp_adc_cal.a esp-idf/esp_gdbstub/libesp_gdbstub.a esp-idf/tcp_transport/libtcp_transport.a esp-idf/esp_http_client/libesp_http_client.a esp-idf/esp_http_server/libesp_http_server.a esp-idf/esp_https_ota/libesp_https_ota.a esp-idf/protobuf-c/libprotobuf-c.a esp-idf/protocomm/libprotocomm.a esp-idf/mdns/libmdns.a esp-idf/esp_local_ctrl/libesp_local_ctrl.a esp-idf/sdmmc/libsdmmc.a esp-idf/esp_serial_slave_link/libesp_serial_slave_link.a esp-idf/esp_websocket_client/libesp_websocket_client.a esp-idf/expat/libexpat.a esp-idf/wear_levelling/libwear_levelling.a esp-idf/fatfs/libfatfs.a esp-idf/freemodbus/libfreemodbus.a esp-idf/jsmn/libjsmn.a esp-idf/json/libjson.a esp-idf/libsodium/liblibsodium.a esp-idf/mqtt/libmqtt.a esp-idf/openssl/libopenssl.a esp-idf/spiffs/libspiffs.a esp-idf/ulp/libulp.a esp-idf/unity/libunity.a esp-idf/wifi_provisioning/libwifi_provisioning.a esp-idf/main/libmain.a esp-idf/bme680/libbme680.a -Wl,--cref -Wl,--Map=/Users/dmg/tmp/bme680_esp_idf/build/bme680_esp.map -fno-rtti -fno-lto esp-idf/asio/libasio.a esp-idf/cbor/libcbor.a esp-idf/coap/libcoap.a esp-idf/esp_adc_cal/libesp_adc_cal.a esp-idf/esp_gdbstub/libesp_gdbstub.a esp-idf/esp_https_ota/libesp_https_ota.a esp-idf/esp_local_ctrl/libesp_local_ctrl.a esp-idf/esp_serial_slave_link/libesp_serial_slave_link.a esp-idf/esp_websocket_client/libesp_websocket_client.a esp-idf/expat/libexpat.a esp-idf/fatfs/libfatfs.a esp-idf/sdmmc/libsdmmc.a esp-idf/wear_levelling/libwear_levelling.a esp-idf/freemodbus/libfreemodbus.a esp-idf/jsmn/libjsmn.a esp-idf/libsodium/liblibsodium.a esp-idf/mqtt/libmqtt.a esp-idf/openssl/libopenssl.a esp-idf/spiffs/libspiffs.a esp-idf/unity/libunity.a esp-idf/wifi_provisioning/libwifi_provisioning.a esp-idf/protocomm/libprotocomm.a esp-idf/protobuf-c/libprotobuf-c.a esp-idf/mdns/libmdns.a esp-idf/console/libconsole.a esp-idf/json/libjson.a esp-idf/xtensa/libxtensa.a esp-idf/mbedtls/libmbedtls.a esp-idf/efuse/libefuse.a esp-idf/bootloader_support/libbootloader_support.a esp-idf/app_update/libapp_update.a esp-idf/spi_flash/libspi_flash.a esp-idf/esp_system/libesp_system.a esp-idf/soc/libsoc.a esp-idf/vfs/libvfs.a esp-idf/esp_eth/libesp_eth.a esp-idf/tcpip_adapter/libtcpip_adapter.a esp-idf/esp_netif/libesp_netif.a esp-idf/esp_event/libesp_event.a esp-idf/wpa_supplicant/libwpa_supplicant.a esp-idf/nvs_flash/libnvs_flash.a esp-idf/esp_wifi/libesp_wifi.a esp-idf/lwip/liblwip.a esp-idf/log/liblog.a esp-idf/heap/libheap.a esp-idf/esp_ringbuf/libesp_ringbuf.a esp-idf/driver/libdriver.a esp-idf/pthread/libpthread.a esp-idf/espcoredump/libespcoredump.a esp-idf/perfmon/libperfmon.a esp-idf/esp32/libesp32.a esp-idf/esp_common/libesp_common.a esp-idf/esp_timer/libesp_timer.a esp-idf/freertos/libfreertos.a esp-idf/newlib/libnewlib.a esp-idf/cxx/libcxx.a esp-idf/app_trace/libapp_trace.a esp-idf/nghttp/libnghttp.a esp-idf/esp-tls/libesp-tls.a esp-idf/tcp_transport/libtcp_transport.a esp-idf/esp_http_client/libesp_http_client.a esp-idf/esp_http_server/libesp_http_server.a esp-idf/ulp/libulp.a esp-idf/mbedtls/mbedtls/library/libmbedtls.a esp-idf/mbedtls/mbedtls/library/libmbedcrypto.a esp-idf/mbedtls/mbedtls/library/libmbedx509.a esp-idf/soc/soc/esp32/libsoc_esp32.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libcoexist.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libcore.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libespnow.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libmesh.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libnet80211.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libpp.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/librtc.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libsmartconfig.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libphy.a esp-idf/xtensa/libxtensa.a esp-idf/mbedtls/libmbedtls.a esp-idf/efuse/libefuse.a esp-idf/bootloader_support/libbootloader_support.a esp-idf/app_update/libapp_update.a esp-idf/spi_flash/libspi_flash.a esp-idf/esp_system/libesp_system.a esp-idf/soc/libsoc.a esp-idf/vfs/libvfs.a esp-idf/esp_eth/libesp_eth.a esp-idf/tcpip_adapter/libtcpip_adapter.a esp-idf/esp_netif/libesp_netif.a esp-idf/esp_event/libesp_event.a esp-idf/wpa_supplicant/libwpa_supplicant.a esp-idf/nvs_flash/libnvs_flash.a esp-idf/esp_wifi/libesp_wifi.a esp-idf/lwip/liblwip.a esp-idf/log/liblog.a esp-idf/heap/libheap.a esp-idf/esp_ringbuf/libesp_ringbuf.a esp-idf/driver/libdriver.a esp-idf/pthread/libpthread.a esp-idf/espcoredump/libespcoredump.a esp-idf/perfmon/libperfmon.a esp-idf/esp32/libesp32.a esp-idf/esp_common/libesp_common.a esp-idf/esp_timer/libesp_timer.a esp-idf/freertos/libfreertos.a esp-idf/newlib/libnewlib.a esp-idf/cxx/libcxx.a esp-idf/app_trace/libapp_trace.a esp-idf/nghttp/libnghttp.a esp-idf/esp-tls/libesp-tls.a esp-idf/tcp_transport/libtcp_transport.a esp-idf/esp_http_client/libesp_http_client.a esp-idf/esp_http_server/libesp_http_server.a esp-idf/ulp/libulp.a esp-idf/mbedtls/mbedtls/library/libmbedtls.a esp-idf/mbedtls/mbedtls/library/libmbedcrypto.a esp-idf/mbedtls/mbedtls/library/libmbedx509.a esp-idf/soc/soc/esp32/libsoc_esp32.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libcoexist.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libcore.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libespnow.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libmesh.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libnet80211.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libpp.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/librtc.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libsmartconfig.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libphy.a esp-idf/xtensa/libxtensa.a esp-idf/mbedtls/libmbedtls.a esp-idf/efuse/libefuse.a esp-idf/bootloader_support/libbootloader_support.a esp-idf/app_update/libapp_update.a esp-idf/spi_flash/libspi_flash.a esp-idf/esp_system/libesp_system.a esp-idf/soc/libsoc.a esp-idf/vfs/libvfs.a esp-idf/esp_eth/libesp_eth.a esp-idf/tcpip_adapter/libtcpip_adapter.a esp-idf/esp_netif/libesp_netif.a esp-idf/esp_event/libesp_event.a esp-idf/wpa_supplicant/libwpa_supplicant.a esp-idf/nvs_flash/libnvs_flash.a esp-idf/esp_wifi/libesp_wifi.a esp-idf/lwip/liblwip.a esp-idf/log/liblog.a esp-idf/heap/libheap.a esp-idf/esp_ringbuf/libesp_ringbuf.a esp-idf/driver/libdriver.a esp-idf/pthread/libpthread.a esp-idf/espcoredump/libespcoredump.a esp-idf/perfmon/libperfmon.a esp-idf/esp32/libesp32.a esp-idf/esp_common/libesp_common.a esp-idf/esp_timer/libesp_timer.a esp-idf/freertos/libfreertos.a esp-idf/newlib/libnewlib.a esp-idf/cxx/libcxx.a esp-idf/app_trace/libapp_trace.a esp-idf/nghttp/libnghttp.a esp-idf/esp-tls/libesp-tls.a esp-idf/tcp_transport/libtcp_transport.a esp-idf/esp_http_client/libesp_http_client.a esp-idf/esp_http_server/libesp_http_server.a esp-idf/ulp/libulp.a esp-idf/mbedtls/mbedtls/library/libmbedtls.a esp-idf/mbedtls/mbedtls/library/libmbedcrypto.a esp-idf/mbedtls/mbedtls/library/libmbedx509.a esp-idf/soc/soc/esp32/libsoc_esp32.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libcoexist.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libcore.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libespnow.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libmesh.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libnet80211.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libpp.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/librtc.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libsmartconfig.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libphy.a esp-idf/xtensa/libxtensa.a esp-idf/mbedtls/libmbedtls.a esp-idf/efuse/libefuse.a esp-idf/bootloader_support/libbootloader_support.a esp-idf/app_update/libapp_update.a esp-idf/spi_flash/libspi_flash.a esp-idf/esp_system/libesp_system.a esp-idf/soc/libsoc.a esp-idf/vfs/libvfs.a esp-idf/esp_eth/libesp_eth.a esp-idf/tcpip_adapter/libtcpip_adapter.a esp-idf/esp_netif/libesp_netif.a esp-idf/esp_event/libesp_event.a esp-idf/wpa_supplicant/libwpa_supplicant.a esp-idf/nvs_flash/libnvs_flash.a esp-idf/esp_wifi/libesp_wifi.a esp-idf/lwip/liblwip.a esp-idf/log/liblog.a esp-idf/heap/libheap.a esp-idf/esp_ringbuf/libesp_ringbuf.a esp-idf/driver/libdriver.a esp-idf/pthread/libpthread.a esp-idf/espcoredump/libespcoredump.a esp-idf/perfmon/libperfmon.a esp-idf/esp32/libesp32.a esp-idf/esp_common/libesp_common.a esp-idf/esp_timer/libesp_timer.a esp-idf/freertos/libfreertos.a esp-idf/newlib/libnewlib.a esp-idf/cxx/libcxx.a esp-idf/app_trace/libapp_trace.a esp-idf/nghttp/libnghttp.a esp-idf/esp-tls/libesp-tls.a esp-idf/tcp_transport/libtcp_transport.a esp-idf/esp_http_client/libesp_http_client.a esp-idf/esp_http_server/libesp_http_server.a esp-idf/ulp/libulp.a esp-idf/mbedtls/mbedtls/library/libmbedtls.a esp-idf/mbedtls/mbedtls/library/libmbedcrypto.a esp-idf/mbedtls/mbedtls/library/libmbedx509.a esp-idf/soc/soc/esp32/libsoc_esp32.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libcoexist.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libcore.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libespnow.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libmesh.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libnet80211.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libpp.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/librtc.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libsmartconfig.a /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32/libphy.a /Users/dmg/esp/esp-idf/components/xtensa/esp32/libhal.a -u esp_app_desc -L /Users/dmg/esp/esp-idf/components/esp_rom/esp32/ld -T esp32.rom.newlib-time.ld -T esp32.rom.ld -T esp32.rom.libgcc.ld -T esp32.rom.newlib-data.ld -T esp32.rom.syscalls.ld -T esp32.rom.newlib-funcs.ld -u vfs_include_syscalls_impl -L /Users/dmg/esp/esp-idf/components/esp_wifi/lib/esp32 -u pthread_include_pthread_impl -u pthread_include_pthread_cond_impl -u pthread_include_pthread_local_storage_impl -L /Users/dmg/tmp/bme680_esp_idf/build/esp-idf/esp32 -T esp32_out.ld -u app_main -L /Users/dmg/tmp/bme680_esp_idf/build/esp-idf/esp32/ld -T esp32.project.ld -L /Users/dmg/esp/esp-idf/components/esp32/ld -T esp32.peripherals.ld -u call_user_start_cpu0 -u ld_include_panic_highint_hdl -Wl,--gc-sections -Wl,--undefined=uxTopUsedPriority -lm esp-idf/newlib/libnewlib.a -u newlib_include_locks_impl -u newlib_include_heap_impl -u newlib_include_syscalls_impl -u newlib_include_pthread_impl -lgcc -u __cxa_guard_dummy -lstdc++ esp-idf/pthread/libpthread.a -u __cxx_fatal_exception esp-idf/app_trace/libapp_trace.a -lgcov esp-idf/app_trace/libapp_trace.a -lgcov -lc ../bme680/algo/normal_version/bin/esp32/libalgobsec.a -lextra /Users/dmg/esp/esp-idf/components/newlib/lib/libm.a && :
/Users/dmg/.espressif/tools/xtensa-esp32-elf/esp-2020r1-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld: cannot find -lextra
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
Hello @mjaakkol
I m trying to run your repo on esp-idf 4.2,
I make the changes in the CMake file which is in the bm680 folder as per your instruction.
When I m building, it shows some error
Error:
-- Configuring done -- Generating done -- Build files have been written to: /home/horsemann/Desktop/WorkSpace/esp-version-4.2/esp-idf/examples/BME680/build Running ninja in directory /home/horsemann/Desktop/WorkSpace/esp-version-4.2/esp-idf/examples/BME680/build Executing "ninja all"... ninja: error: '../bme680/algo/normal_version/bin/esp32/libalgobsec.a', needed by 'bme680_esp.elf', missing and no known rule to make it ninja failed with exit code 1
Can you help me with this?
Thanks in advance.
Hi @mjaakkol, thank you for creating this repo to show newbs like me how to build the BSEC lib on the IDF Framework. I've managed to build the project but unfortunately, I'm getting this error code during initialization phase of the code. Any ideas how I can fix this probem?
E (1374) bme680_sensor: initializing BME680 failed -2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.