#BMP280 BF 4.5.0 Not detected

1 messages ยท Page 1 of 1 (latest)

analog quiver
#

Hello everyone. I have a CruxF405HD ELRS AIO which has a BMP280 on board. I am having trouble configuring. From the BMP280 manual the default i2c address is 0x76.

I have this configured:

get baro

baro_bustype = I2C
Allowed values: NONE, I2C, SPI, SLAVE

baro_spi_device = 0
Allowed range: 0 - 5

baro_i2c_device = 2
Allowed range: 0 - 5

baro_i2c_address = 118
Allowed range: 0 - 119
Default value: 0

baro_hardware = BMP280
Allowed values: AUTO, NONE, BMP085, MS5611, BMP280, LPS, QMP6988, BMP388, DPS310, 2SMPB_02B, LPS22DF, VIRTUAL
Default value: AUTO

altitude_prefer_baro = 100
Allowed range: 0 - 100

There was a small note from the vendor instructing me to set device=2 and did not mention i2c_address which defaulted to zero, both zero and 118 have no change, I've also tried all device values 0-5 for the heck of it.

Barometer is enabled in configuration as well. Is there anything I might be missing here? Any advice or debugging steps would be greatly appreciated! Thank you.

spice fractal
#

Did you include the BMP280 define when flashing Betaflight?

#

Post the output of status in the CLI

analog quiver
#

Last night I attempted to build 4.5.0 with cloud build with custom defines "BARO BARO_BMP280 GYRO_SPI_ICM42688P ACC_SPI_ICM42688P" but the build failed, I had assumed those BARO includes were already being included elsewhere. I can post the build logs. (I'll go attempt a build now).

#

Here is my status:

#

status

MCU F40X Clock=168MHz (PLLP-HSE), Vref=3.34V, Core temp=49degC
Stack size: 2048, Stack address: 0x1000fff0
Configuration: CONFIGURED, size: 3789, max available: 16384
Devices detected: SPI:1, I2C:0
Gyros detected: gyro 1 locked
GYRO=ICM42688P, ACC=ICM42688P
OSD: MSP (50 x 18)
BUILD KEY: 428e10245d23abdbbcf4c45d5d04d58a (4.5.0)
System Uptime: 877 seconds, Current Time: 2024-04-30T16:21:27.197+00:00
CPU:49%, cycle time: 124, GYRO rate: 8064, RX rate: 15, System rate: 9
Voltage: 0 * 0.01V (0S battery - INIT)
I2C Errors: 0
FLASH: JEDEC ID=0x00ef4017 8M
GPS: NOT ENABLED
Arming disable flags: RXLOSS CLI MSP

spice fractal
analog quiver
#

Here is my build log:

spice fractal
#

Can you post a CLI dump?

#

dump in the CLI tab

analog quiver
#

Sure thing

spice fractal
#

Looks fine. Can you copy and paste this into the CLI?

set baro_i2c_address = 0
set baro_hardware = AUTO
save```
#

And then plug in a battery and post the output of status again

#

Also, your arm switch is not set properly. Arm must be on Aux1 high for ELRS

analog quiver
#

Will do! I have not taken flight with this unit yet, just spending a lot of time DD on betaflight in general. One question, before I make this change, would I expect the barometer not to work without battery power? This might be my issue?

spice fractal
#

It is possible the baro is only powered by the battery, not USB

#

But you should make the change above regardless, and also fix your arm switch

analog quiver
#

Regarding arm switch, i intentionally configured so that the switch would arm on AUX1 when it's away from me. It lights up and i haver my range configured properly in betaflight, are you saying this will not work the way I expected? I havre no probleming moving the range to the other switch position.

spice fractal
#

If you want the switch to be armed in that position, invert it on the mixer page of your radio

analog quiver
#

Understood.

#

I made the above suggested changes, saved, powered up battery, then plugged in usb cable. Baro = Not Detected

spice fractal
#

Can you post the output of status again and show a clear photo of your FC?

analog quiver
#

Yes

#

status
MCU F40X Clock=168MHz (PLLP-HSE), Vref=3.34V, Core temp=51degC
Stack size: 2048, Stack address: 0x1000fff0
Configuration: CONFIGURED, size: 3789, max available: 16384
Devices detected: SPI:1, I2C:0
Gyros detected: gyro 1 locked dma
GYRO=ICM42688P, ACC=ICM42688P
OSD: MSP (50 x 18)
BUILD KEY: 428e10245d23abdbbcf4c45d5d04d58a (4.5.0)
System Uptime: 222 seconds, Current Time: 2024-04-30T16:37:34.685+00:00
CPU:50%, cycle time: 124, GYRO rate: 8064, RX rate: 249, System rate: 9
Voltage: 0 * 0.01V (0S battery - INIT)
I2C Errors: 0
FLASH: JEDEC ID=0x00ef4017 8M
GPS: NOT ENABLED
Arming disable flags: CLI MSP

#

If you'd like a top down photo of the actual flight controller, I need to remove the VTX. Would you prefer a photo of the board from vendor?

spice fractal
#

No, I want to see your actual FC to verify it has a BMP280

#

Also, your voltage and current sensors aren't working. Copy and paste this into the CLI:

set battery_meter = ADC
set vbat_scale = 110
set ibata_scale = 470
save```
analog quiver
#

Will do. Getting photo now

#

brb

#

in the bottom left quadrant perhaps thats the pressure transducer? doesn't have the bosch BMP 280 markings on it...

spice fractal
#

Yes, this is the barometer

#

Save a config backup, flash again with "core only" checked in the firmware flasher, then restor your config

abstract copper
#

Missing I2C pins for I2C2

#define I2C2_SCL                PB10 // PB10, UART3_TX
#define I2C2_SDA                PB11 // PB11, UART3_RX

try adding

resource I2C_SCL 2 B10
resource I2C_SDA 2 B11
spice fractal
#

Per the happymodel instructions

abstract copper
#

Just entered the room ๐Ÿ˜›

spice fractal
#

HappyModel really should have made a new target for this

abstract copper
#

Then try core build - could be using SPI.

spice fractal
#

I doubt it's SPI because the resources are not assigned and the product page specifies I2C 2

analog quiver
#

resource I2C_SCL 2 B10
resource I2C_SDA 2 B11 (These were added per vendor instructions you mentioned. Just double checked: # resource
resource BEEPER 1 B04
resource MOTOR 1 B00
resource MOTOR 2 B01
resource MOTOR 3 C09
resource MOTOR 4 C08
resource MOTOR 5 B06
resource LED_STRIP 1 B06
resource SERIAL_TX 1 A09
resource SERIAL_TX 2 A02
resource SERIAL_TX 6 C06
resource SERIAL_RX 1 A10
resource SERIAL_RX 2 A03
resource SERIAL_RX 6 C07
resource INVERTER 2 C13
resource I2C_SCL 2 B10
resource I2C_SDA 2 B11
resource LED 1 B05
resource SPI_SCK 1 A05
resource SPI_SCK 2 B13
resource SPI_SCK 3 C10
resource SPI_SDI 1 A06
resource SPI_SDI 2 B14
resource SPI_SDI 3 C11
resource SPI_SDO 1 A07
resource SPI_SDO 2 B15
resource SPI_SDO 3 C12
resource ESCSERIAL 1 B08
resource ADC_BATT 1 C02
resource ADC_CURR 1 C01
resource FLASH_CS 1 A15
resource OSD_CS 1 B12
resource GYRO_EXTI 1 C04
resource GYRO_CS 1 A04
resource USB_DETECT 1 C05

#

I followed those last night to no avail. going back to review your above comments more closely

#

Yeah, this was where I was questioning if I had overlooked something ๐Ÿ™‚

#

There's nothing from the very very sparse information from happymodel that this would be SPI.

#

I could contact them separately to confirm though

#

When I first used the resource I2C_SCL 2 B10
resource I2C_SDA 2 B11 instructions they barked (warned) that they were assigned to UART3. but didn't seem to be an issue as I don't think UART3 is used anywhere on this FC board.

abstract copper
#

Please perform core build

analog quiver
#

Ok. Will do.

abstract copper
#

After flashing still need to add missing I2C resources:

resource I2C_SCL 2 B10
resource I2C_SDA 2 B11
save

Show status after that

analog quiver
#

status

MCU F40X Clock=168MHz (PLLP-HSE), Vref=3.34V, Core temp=50degC
Stack size: 2048, Stack address: 0x1000fff0
Configuration: CONFIGURED, size: 4134, max available: 16384
Devices detected: SPI:0, I2C:0
Gyros detected: locked

OSD: MSP (50 x 18)
BUILD KEY: bcbc7b9b6fc84e0b2d03ef58c77d5b0c (4.5.0)
System Uptime: 20 seconds, Current Time: 2024-04-30T17:31:00.735+00:00
CPU:0%, cycle time: 0, GYRO rate: 0, RX rate: 0, System rate: 9
Voltage: 0 * 0.01V (0S battery - INIT)
I2C Errors: 0
FLASH: JEDEC ID=0x00ef4017 8M
GPS: NOT ENABLED
Arming disable flags: NOGYRO BOOTGRACE CLI MSP

#

Just to clarify, I dumped cli, flashed core only and the restored dump... I have a feeling this is not what you wanted.. I can repeat and just set the two resources as requested?

#

It also appears my ACC and GYRO are not working either. Was this just a debug step to help diagnose? I have to include the custom defines in order to get those sensors functioning.

abstract copper
#

Step by step ๐Ÿ™‚

  • step 1: only flash core only - and apply my 3 lines - before showing status
  • step 2: otherwise need to have a working config to compare after that.
analog quiver
#

You got it One second.

#

status

MCU F40X Clock=168MHz (PLLP-HSE), Vref=3.34V, Core temp=50degC
Stack size: 2048, Stack address: 0x1000fff0
Configuration: CONFIGURED, size: 4134, max available: 16384
Devices detected: SPI:0, I2C:0
Gyros detected: locked

OSD: MSP (53 x 20)
BUILD KEY: bcbc7b9b6fc84e0b2d03ef58c77d5b0c (4.5.0)
System Uptime: 14 seconds, Current Time: 2024-04-30T17:37:12.572+00:00
CPU:0%, cycle time: 0, GYRO rate: 0, RX rate: 0, System rate: 9
Voltage: 0 * 0.01V (0S battery - INIT)
I2C Errors: 1
FLASH: JEDEC ID=0x00ef4017 8M
GPS: NOT ENABLED
Arming disable flags: NOGYRO BOOTGRACE CLI MSP

spice fractal
#

Is this with a battery plugged in?

analog quiver
#

no. without. one moment. i will get status with batter

spice fractal
#

Restore your saved config after if the gyro still isn't showing up

analog quiver
#

With battery boot, then usb plugged in:

#

status

MCU F40X Clock=168MHz (PLLP-HSE), Vref=3.34V, Core temp=49degC
Stack size: 2048, Stack address: 0x1000fff0
Configuration: CONFIGURED, size: 4134, max available: 16384
Devices detected: SPI:0, I2C:0
Gyros detected: locked

OSD: MSP (53 x 20)
BUILD KEY: bcbc7b9b6fc84e0b2d03ef58c77d5b0c (4.5.0)
System Uptime: 34 seconds, Current Time: 2024-04-30T17:40:29.362+00:00
CPU:0%, cycle time: 0, GYRO rate: 0, RX rate: 0, System rate: 9
Voltage: 0 * 0.01V (0S battery - INIT)
I2C Errors: 1
FLASH: JEDEC ID=0x00ef4017 8M
GPS: NOT ENABLED
Arming disable flags: NOGYRO BOOTGRACE CLI MSP

spice fractal
#

Restore the config backup you made earlier and try again

analog quiver
#

Ok. I noticed the "backup" that the flash utlity warned me to make is not a full dump. Can I assume a full dump includes everything (for future ref)

#

(i have full dump as well)

spice fractal
#

The backup is usually a diff, which is just the difference between the default settings and what you have configured

#

A dump is everything

analog quiver
#

Thank you

spice fractal
#

Here you can just apply the diff

analog quiver
#

I applied the diff and Gyro/Acc not functioning. # status
MCU F40X Clock=168MHz (PLLP-HSE), Vref=3.34V, Core temp=57degC
Stack size: 2048, Stack address: 0x1000fff0
Configuration: CONFIGURED, size: 4134, max available: 16384
Devices detected: SPI:0, I2C:0
Gyros detected: locked

OSD: MSP (50 x 18)
BUILD KEY: bcbc7b9b6fc84e0b2d03ef58c77d5b0c (4.5.0)
System Uptime: 36 seconds, Current Time: 2024-04-30T17:44:21.057+00:00
CPU:0%, cycle time: 0, GYRO rate: 0, RX rate: 0, System rate: 9
Voltage: 0 * 0.01V (0S battery - INIT)
I2C Errors: 0
FLASH: JEDEC ID=0x00ef4017 8M
GPS: NOT ENABLED
Arming disable flags: NOGYRO BOOTGRACE CLI MSP

spice fractal
#

๐Ÿค”

analog quiver
#

I appreciate your support and patience!

spice fractal
#

Can you type dump now and post the output?

analog quiver
spice fractal
#

Looks fine, I don't see any issues

#

@abstract copper any other ideas?

abstract copper
#

https://www.happymodel.cn/index.php/2023/12/30/cruxf405hd-elrs-aio-3in1-flight-controller-built-in-uart-2-4g-elrs-and-20a-esc-for-toothpick-20mmx20mm-mount-hole/

Indeed uses ICM42688P - so this needs to be added [in a new HM config for this board]. But core only should include all drivers and nothing shows up. This is the confusing parts as we had a working gyro here: #1234901402606899283 message

Maybe add BARO_DPS310 GYRO_SPI_ICM42688P ACC_SPI_ICM42688P might work from there.

But it should work with CORE ONLY

๐Ÿ˜•

analog quiver
#

I will verify without including ACC as suggested. Do you think DPS310 was used and they mis stated BMP280 ? Worth trying! brb

#

BARO_DPS310 GYRO_SPI_ICM42688P ACC_SPI_ICM42688P, and back to original functional state minus barometer (Still not detected).

#

status

MCU F40X Clock=168MHz (PLLP-HSE), Vref=3.34V, Core temp=50degC
Stack size: 2048, Stack address: 0x1000fff0
Configuration: CONFIGURED, size: 3789, max available: 16384
Devices detected: SPI:1, I2C:0
Gyros detected: gyro 1 locked dma
GYRO=ICM42688P, ACC=ICM42688P
OSD: MSP (50 x 18)
BUILD KEY: 93c3ffd3432ec4d1d2e41dab3e416373 (4.5.0)
System Uptime: 12 seconds, Current Time: 2024-04-30T18:03:20.850+00:00
CPU:48%, cycle time: 123, GYRO rate: 8130, RX rate: 15, System rate: 9
Voltage: 0 * 0.01V (0S battery - INIT)
I2C Errors: 1
FLASH: JEDEC ID=0x00ef4017 8M
GPS: NOT ENABLED
Arming disable flags: RXLOSS CLI MSP

get baro

baro_bustype = I2C
Allowed values: NONE, I2C, SPI, SLAVE

baro_spi_device = 0
Allowed range: 0 - 5

baro_i2c_device = 2
Allowed range: 0 - 5

baro_i2c_address = 0
Allowed range: 0 - 119

baro_hardware = AUTO
Allowed values: AUTO, NONE, BMP085, MS5611, BMP280, LPS, QMP6988, BMP388, DPS310, 2SMPB_02B, LPS22DF, VIRTUAL

altitude_prefer_baro = 100
Allowed range: 0 - 100

#

I do see an I2C error of 1

abstract copper
#

get i2c ?

analog quiver
#

Also added this to my config thank you for the catch "set current_meter = ADC
set battery_meter = ADC
set vbat_scale = 110
set ibata_scale = 470
save"

#

get i2c

baro_i2c_device = 2
Allowed range: 0 - 5

baro_i2c_address = 0
Allowed range: 0 - 119

gyro_1_i2cBus = 0
Allowed range: 0 - 3

gyro_1_i2c_address = 0
Allowed range: 0 - 119

gyro_2_i2cBus = 0
Allowed range: 0 - 3

gyro_2_i2c_address = 0
Allowed range: 0 - 119

i2c1_pullup = OFF
Allowed values: OFF, ON

i2c1_clockspeed_khz = 800
Allowed range: 100 - 1300

i2c2_pullup = OFF
Allowed values: OFF, ON

i2c2_clockspeed_khz = 800
Allowed range: 100 - 1300

i2c3_pullup = OFF
Allowed values: OFF, ON

i2c3_clockspeed_khz = 800
Allowed range: 100 - 1300

abstract copper
#

Add

resource I2C_SCL 2 B10
resource I2C_SDA 2 B11
save
analog quiver
#

Any chance we want to activate a pullup?

#

.. I swore i did that! will do!

#

done

#

Entering CLI Mode, type 'exit' to return, or 'help'

Building AutoComplete Cache ... Done!

status

MCU F40X Clock=168MHz (PLLP-HSE), Vref=3.34V, Core temp=51degC
Stack size: 2048, Stack address: 0x1000fff0
Configuration: CONFIGURED, size: 3789, max available: 16384
Devices detected: SPI:1, I2C:0
Gyros detected: gyro 1 locked dma
GYRO=ICM42688P, ACC=ICM42688P
OSD: MSP (50 x 18)
BUILD KEY: 93c3ffd3432ec4d1d2e41dab3e416373 (4.5.0)
System Uptime: 10 seconds, Current Time: 2024-04-30T18:06:55.711+00:00
CPU:40%, cycle time: 125, GYRO rate: 8000, RX rate: 15, System rate: 9
Voltage: 131 * 0.01V (0S battery - INIT)
I2C Errors: 1
FLASH: JEDEC ID=0x00ef4017 8M
GPS: NOT ENABLED
Arming disable flags: RXLOSS CLI MSP

get i2c

baro_i2c_device = 2
Allowed range: 0 - 5

baro_i2c_address = 0
Allowed range: 0 - 119

gyro_1_i2cBus = 0
Allowed range: 0 - 3

gyro_1_i2c_address = 0
Allowed range: 0 - 119

gyro_2_i2cBus = 0
Allowed range: 0 - 3

gyro_2_i2c_address = 0
Allowed range: 0 - 119

i2c1_pullup = OFF
Allowed values: OFF, ON

i2c1_clockspeed_khz = 800
Allowed range: 100 - 1300

i2c2_pullup = OFF
Allowed values: OFF, ON

i2c2_clockspeed_khz = 800
Allowed range: 100 - 1300

i2c3_pullup = OFF
Allowed values: OFF, ON

i2c3_clockspeed_khz = 800
Allowed range: 100 - 1300

abstract copper
#

There is no external GPS with baro or mag attached to the board?

analog quiver
#

No there is not.

#

The only external device is the VTX attached to UART1

#

Any chance activating an i2c pullup would be useful? Maybe not with only one device hanging out, may not matter?

abstract copper
#

i2c2_clockspeed_khz = 800 - could try 400 - but is normally not needed. Did baro work before? If so do you have any dump when it was working?

analog quiver
#

It has never worked, I just fired this unit up a few days ago on the bench, brand new.

abstract copper
#

And resource command shows I2C now?

analog quiver
#

I'm not sure how to answer that. ? resource results in cli:# resource
resource BEEPER 1 B04
resource MOTOR 1 B00
resource MOTOR 2 B01
resource MOTOR 3 C09
resource MOTOR 4 C08
resource MOTOR 5 B06
resource LED_STRIP 1 B06
resource SERIAL_TX 1 A09
resource SERIAL_TX 2 A02
resource SERIAL_TX 6 C06
resource SERIAL_RX 1 A10
resource SERIAL_RX 2 A03
resource SERIAL_RX 6 C07
resource INVERTER 2 C13
resource I2C_SCL 2 B10
resource I2C_SDA 2 B11
resource LED 1 B05
resource SPI_SCK 1 A05
resource SPI_SCK 2 B13
resource SPI_SCK 3 C10
resource SPI_SDI 1 A06
resource SPI_SDI 2 B14
resource SPI_SDI 3 C11
resource SPI_SDO 1 A07
resource SPI_SDO 2 B15
resource SPI_SDO 3 C12
resource ESCSERIAL 1 B08
resource ADC_BATT 1 C02
resource ADC_CURR 1 C01
resource FLASH_CS 1 A15
resource OSD_CS 1 B12
resource GYRO_EXTI 1 C04
resource GYRO_CS 1 A04
resource USB_DETECT 1 C05

abstract copper
#

set baro_bustype = I2C - oh already there

analog quiver
#

i set and saved: here is get baro

#

get baro

baro_bustype = I2C
Allowed values: NONE, I2C, SPI, SLAVE

baro_spi_device = 0
Allowed range: 0 - 5

baro_i2c_device = 2
Allowed range: 0 - 5

baro_i2c_address = 0
Allowed range: 0 - 119

baro_hardware = AUTO
Allowed values: AUTO, NONE, BMP085, MS5611, BMP280, LPS, QMP6988, BMP388, DPS310, 2SMPB_02B, LPS22DF, VIRTUAL

altitude_prefer_baro = 100
Allowed range: 0 - 100

abstract copper
#

Should contact HM for RMA

Return Material Authorization (RMA), also known by several other terms such as Return Goods, Product Return or Sales Return, is a part of the supply chain process where the seller agrees to take back the purchases made by the customer.