Category
Hardware Compatibility
Hardware
Other
Is this bug report about any UI component firmware like InkHUD or Meshtatic UI (MUI)?
Firmware Version
Newest Lately
Description
Sorry but I feel not capable to do a pull request so i try this way:
I found a logic bug when trying to use BMP390L in ScanI2CTwoWire.cpp
Cause:
Read 1: Register 0xD0 → gibt 0x00 zurück
↓
Code fällt in case 0x00:
↓
Read 2: Register 0x0D (DPS310!) → gibt 0x98 zurück
↓
0x98 != 0x10 (DPS310) → kein Match
↓
fällt in default → liest Register 0x00
The default with register 0x00 is never reached! The code does a break after DPS310-check and leavs the switch.
Solution:
case BME_ADDR:
case BME_ADDR_ALTERNATE:
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0xD0), 1); // GET_ID
switch (registerValue) {
case 0x61:
logFoundDevice("BME680", (uint8_t)addr.address);
type = BME_680;
break;
case 0x60:
logFoundDevice("BME280", (uint8_t)addr.address);
type = BME_280;
break;
case 0x55:
logFoundDevice("BMP085/BMP180", (uint8_t)addr.address);
type = BMP_085;
break;
case 0x00:
// DPS310 check
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x0D), 1);
if (registerValue == 0x10) {
logFoundDevice("DPS310", (uint8_t)addr.address);
type = DPS310;
break;
}
// NEU: kein DPS310 → prüfe BMP388/390
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x00), 1);
switch (registerValue) {
case 0x50:
logFoundDevice("BMP-388", (uint8_t)addr.address);
type = BMP_3XX;
break;
case 0x60:
logFoundDevice("BMP-390", (uint8_t)addr.address);
type = BMP_3XX;
break;
default:
logFoundDevice("BMP-280", (uint8_t)addr.address);
type = BMP_280;
break;
}
break;
}
break;
Relevant log output
Category
Hardware Compatibility
Hardware
Other
Is this bug report about any UI component firmware like InkHUD or Meshtatic UI (MUI)?
Firmware Version
Newest Lately
Description
Sorry but I feel not capable to do a pull request so i try this way:
I found a logic bug when trying to use BMP390L in ScanI2CTwoWire.cpp
Cause:
Read 1: Register 0xD0 → gibt 0x00 zurück
↓
Code fällt in case 0x00:
↓
Read 2: Register 0x0D (DPS310!) → gibt 0x98 zurück
↓
0x98 != 0x10 (DPS310) → kein Match
↓
fällt in default → liest Register 0x00
The default with register 0x00 is never reached! The code does a break after DPS310-check and leavs the switch.
Solution:
case BME_ADDR:
case BME_ADDR_ALTERNATE:
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0xD0), 1); // GET_ID
switch (registerValue) {
case 0x61:
logFoundDevice("BME680", (uint8_t)addr.address);
type = BME_680;
break;
case 0x60:
logFoundDevice("BME280", (uint8_t)addr.address);
type = BME_280;
break;
case 0x55:
logFoundDevice("BMP085/BMP180", (uint8_t)addr.address);
type = BMP_085;
break;
case 0x00:
// DPS310 check
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x0D), 1);
if (registerValue == 0x10) {
logFoundDevice("DPS310", (uint8_t)addr.address);
type = DPS310;
break;
}
// NEU: kein DPS310 → prüfe BMP388/390
registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0x00), 1);
switch (registerValue) {
case 0x50:
logFoundDevice("BMP-388", (uint8_t)addr.address);
type = BMP_3XX;
break;
case 0x60:
logFoundDevice("BMP-390", (uint8_t)addr.address);
type = BMP_3XX;
break;
default:
logFoundDevice("BMP-280", (uint8_t)addr.address);
type = BMP_280;
break;
}
break;
}
break;
Relevant log output