BME688 sensor library for nRF52832

Hi,

I'm developing a project with nRF52832 and BOSH BME688 sensor.

I downloaded the library from github to use the sensor (here it is the link https://github.com/BoschSensortec/BME68x-Sensor-API).

I found a big problem: the libraries refer to another library, called coines, that is not included in the github repository, because it is a low level library specific for each microprocessor (here the explanation https://www.bosch-sensortec.com/software-tools/tools/coines/).

I try to download the installer but it creates a multiple other library that creates problem.

So, I was wondering if someone already has the coines.h and coines.c files to import in my project.

Thanks for helping.

  • Hi, Thanks for the help.

    After deeper search, I understand that I have to adapt the common.c file to the platform that I'm using, so I have to replace all the generic function (with coines) with the specific one for my microcontroller.

    For example, I replace

    BME68X_INTF_RET_TYPE bme68x_i2c_write(uint8_t reg_addr, const uint8_t *reg_data, uint32_t len, void *intf_ptr)
    {
        uint8_t dev_addr = *(uint8_t*)intf_ptr;
        return coines_write_i2c(dev_addr, reg_addr, (uint8_t *)reg_data, (uint16_t)len);
    }
    with 
    BME68X_INTF_RET_TYPE bme68x_i2c_write(uint8_t reg_addr, const uint8_t *reg_data, uint32_t len, void *intf_ptr)
    {
    uint8_t dev_addr = *(uint8_t*)intf_ptr;
    return nrf_drv_twi_tx(dev_addr, reg_addr, (uint8_t *)reg_data, (uint16_t)len, false);
    }
    (I hope that I put correctly the various parameters, if not, I would be very glad if you can tell me which are the correct ones).
    But I cannot understand how to replace this command
    coines_config_i2c_bus(COINES_I2C_BUS_0, COINES_I2C_STANDARD_MODE);
    I don't know if this information is important, but in my project I have already initialized the twi comunication for transmit data to other sensors.
  • Again, my advice is to chuck the whole COINES thing out the window as it does not seem to add anything useful for your project. The COINES framework is used to talk to bosch sensors from a PC via an MCU. If you don't need to do that you should not use that framework. 

    If you do need COINES for your project I suggest you ask Bosch for assistance in setting it up.

  • Yes, I have deleted the coines file to my project.

    Now I have to adapt the common file to nRF52832 in order to make the Bosch API working (I asked also help at Bosh assistance and they confirm).

    https://github.com/BoschSensortec/BME68x-Sensor-API/tree/master/examples/common

    Here there is the common file. I have to do that because some Bosch function are based on this file. So if I can adapt this file to nRF, also the Bosch API will work

  • Hi Andrea,

    I am currently dealing with the exact same issue for the exact same situation. Were you ever able to rewrite the common.c and common.h files for this application? If so, could you please share them so I could learn how to do this for my application as well?

    Thanks so much!

Related