... that I found here: github.com/BoschSensortec/BMP280_driver In bmp280.c, there is the function: static int8_t st_check_boundaries(int32_t utemperature, int32_t upressure) Which makes range checks like: if ((utemperature <= BMP280_ST_ADC_T_MIN || utemperature >= BMP280_ST_ADC_T_MAX) && (upressure <= BMP280_ST_ADC_P_MIN || upressure >= BMP280_ST_ADC_P_MAX)) { rslt = BMP280_E_UNCOMP_TEMP_AND_PRESS_RANGE; } Looking at how the macros are defined in bmp280_defs.h: /* 0x00000 is minimum output value */ #define BMP280_ST_ADC_T_MIN INT32_C(0x00000) If 0 is the minimum output value, i.e. utemperature is allowed to have the value of 0, then this check is wrong. It should use < || > instead of <= || >=. Maybe unlikely to encounter normally, but I've seen a uncompressed pressure/temp being 0 on the first read after activating the device. I have a suspicion that that's only a bug on my side with the i2c stuff. But anyway, that's how I found it, by this failing after the first read and working afterwards when only non-zero values are fetched via i2c.
... View more