BMP38x self-test v1.1.3 appears to suffer from multiple bugs. Bug 1 - Inappropriate plausible temperature range The maximum plausible temperature is defined as 40 degC on line 54 of bmp38x_selftest.c. The BMP388 datasheet specifies an operating temperature up to 85 degC. In practise, operating temperatures will often exceed 40 degC due to warm climates and/or heat generated by electronics. Bug 2 - Scaling errors for BMP3_DOUBLE_PRECISION_COMPENSATION If using BMP3_DOUBLE_PRECISION_COMPENSATION then the self-test will always fail with BMP3_IMPLAUSIBLE_PRESSURE due to scaling errors. This is because the API will provide measurements in units of degC and 100*hPa but the API defines the plausible ranges in units of 100*degC and 100*100*hPa (scaled once in definition and then again within if statement). I suggest the issue is fixed by defining different plausible limits when BMP3_DOUBLE_PRECISION_COMPENSATION is defined. Bug 3 - Corrupted variables when not using BMP3_DOUBLE_PRECISION_COMPENSATION This issue can be demonstrated by printing the measurement values inside the internal function, analyze_sensor_data, on line 185 of bmp38x_selftest.c as shown below. static int8_t analyze_sensor_data(const struct bmp3_data *sens_data)
int8_t rslt = BMP3_SENSOR_OK;
// **************** START OF DEBUG CODE ****************
printf("t=%f, p=%f\r\n", sens_data->temperature, sens_data->pressure);
printf("t=%ld, p=%lu\r\n", (long int)sens_data->temperature, (long unsigned int)sens_data->pressure);
// **************** END OF DEBUG CODE ****************
if ((sens_data->temperature < BMP3_MIN_TEMPERATURE) || (sens_data->temperature > BMP3_MAX_TEMPERATURE))
rslt = BMP3_IMPLAUSIBLE_TEMPERATURE;
if (rslt == BMP3_SENSOR_OK)
if ((sens_data->pressure / 100 < BMP3_MIN_PRESSURE) || (sens_data->pressure / 100 > BMP3_MAX_PRESSURE))
rslt = BMP3_IMPLAUSIBLE_PRESSURE;
} If using BMP3_DOUBLE_PRECISION_COMPENSATION then the above modification will result in the following typical output: t=58.103809, p=101310.782827 If not using BMP3_DOUBLE_PRECISION_COMPENSATION then the above modification will result in the following typical output: t=1, p=5752 It appears that the pressure value is the temperature measurement (100*degC), and the temperature value is always 1. This corruption only occurs within the function, analyze_sensor_data. There are no issues with values obtained using the function, bmp3_get_sensor_data.
... View more
The parts were soldered using a hot air rework station and low melting point solder. Care was taken to minimise thermal stresses. However, this assembly process cannot guarantee the recommended thermal profile. I will update this thread once we have tested boards soldered in a reflow oven with controlled thermal profile.
... View more
I suspect the parts are in spec and that issue is in the datasheet. The BMI160 datasheet states "Zero-rate offset" is ±3 dps for "TA=25°C, fast offset compensation". The BMI270 datasheet states "Zero-rate offset" is ±0.5 dps for "TA=25°C, nominal VDD soldered, over life time" I suspect the same parameter means very different things in each datasheet; That for the BMI160 it means the absolute zero-rate offset, and for the BMI270 it means the relative change in zero-rate offset over life time. Can anyone one from Bosch comment on this?
... View more