Conversation
The DPS310 answers on 0x77 when its SDO pin is pulled high and on 0x76 when it is pulled low. Both wirings are shipped on real boards, so the fixed default of 0x76 left every board of the other kind without a barometer. Register both addresses and probe them in the driver, the same way the IST8310 compass is handled. A target that pins the address down with DPS310_I2C_ADDR keeps using only that address. Fixes iNavFlight#9958
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
PR Summary by QodoDetect DPS310 barometers at both valid I2C addresses
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo
1.
|
|
RAM / Flash usage vs. base commit
See RAM/flash optimization guide for techniques to reduce usage. |
|
Test firmware build ready — commit Download firmware for PR #11906 250 targets built. Find your board's
|
Problem
A DPS310 barometer wired for I2C address 0x77 is not detected. The reporter of #9958 points at the Infineon datasheet, which lists 0x77 as the default address, while
common_hardware.chard-codes 0x76; a second user had a board with the DPS310 on 0x77 and only got a barometer after editing the address in the target, a third got no barometer at all after connecting an external DPS310. Only targets that pinDPS310_I2C_ADDRthemselves (BRAHMA_F405/F722) work on 0x77 today.Cause
src/main/target/common_hardware.c:183-186on maintenance-10.x: when a target does not defineDPS310_I2C_ADDRthe default is set to 0x76 and a single descriptor is registered.src/main/drivers/barometer/barometer_dps310.c:346opens only thatDEVHW_DPS310slot, so a sensor with SDO pulled high (0x77) is never probed.Change
bus.h:DEVHW_DPS310becomesDEVHW_DPS310_0andDEVHW_DPS310_1.common_hardware.c: with noDPS310_I2C_ADDRboth 0x76 and 0x77 are registered; a target that defines the address keeps one descriptor (BRAHMA_F405/F722, ORBITH743), and the SPI path stays a single slot.barometer_dps310.c:baroDPS310Detect()loops over both slots, skips a slot for whichbusDeviceInit()returns NULL and de-inits a slot whose ID check or configure fails.HUMMINGBIRD_FC305/target.c(own descriptor table) is renamed to the_0slot, anddocs/development/msp/inav_enums.json/inav_enums_ref.mdare regenerated for the new enum values.Test
Not run on hardware. Cause verified by reading
common_hardware.c:183-186andbarometer_dps310.c:346on maintenance-10.x; the NULL return for an unregistered slot isbus.c:174. No CI build of this branch exists: the fork has no Actions run for 7719c72 and the upstream checks have not run. A grep of the branch finds no remainingDEVHW_DPS310orbusdev_dps310reference.Flash / RAM
Not measured yet. The upstream firmware CI has not been released for this PR, so no size report exists.
Docs
docs/development/msp/inav_enums.jsonanddocs/development/msp/inav_enums_ref.mdregenerated withgen_docs.shbecausedevHardwareType_echanged. No other documentation states the DPS310 default address; theDPS310_I2C_ADDRoverride described indocs/development/targets/common-issues.mdstill applies.