BMP280 always reporting BMP2_MAX_PRES_DOUBLE

Hello.

I have a PCB with a BMP280 connected via SPI to a ESP32. I am using also the API in https://github.com/BoschSensortec/BMP2-Sensor-API.

I have managed to read the temperature correctly, but I didn't get it with the pressure:

 

Data[0]:    Temperature: 22.1783 deg C  Pressure: 110000.0000 Pa

 Apparently I am able to read the registers 0x7F and the 5 next with the following results:

I (9107571) BMP280: bmp2_get_sensor_data result: 4 
Data[0]:    Temperature: 22.1783 deg C  Pressure: 110000.0000 Pa
----- BEGIN READ ----- 
READ -- length = 6
READ -- reg_addr = f7
READ -- rx_buffer[0] = 77 4d
READ -- rx_buffer[1] = 86 56
READ -- rx_buffer[2] = 160 a0
READ -- rx_buffer[3] = 125 7d
READ -- rx_buffer[4] = 220 dc
READ -- rx_buffer[5] = 129 81

 From this point I don't know what am I doing wrong. The values 4d 56 a0 are parsed to the compensate_pressure API function, that has some intimidating maths. The output from this function is this BMP2_MAX_PRES_DOUBLE.

Can you help me to find what am I doing wrong?

Thanks!

4 replies