SPI connection issues between BMP390 barometer and custom FMU firmware (kakuteh7v2)

Hi all,
I’m currently working on building my custom firmware based on the kakuteh7v2 board. I’ve modified the board.h and rc.board_sensors files respectively, to accommodate the icm42670p ist8310 and bmp390.
bmp390 - SPI1
icm42670p - SPI2
ist8310 - i2c
Now, my problem arises here: Both, the icm42670p and ist8310 are detected on their respective buses when I check logs, but the board just cannot find the bmp390 on the SPI1 bus. To rule out the possibility of a hardware failure, I’ve used two separate boards and even performed unit testing of the bmp390 and I’m able to communicate with the device.

I’ve pasted my logs below:
[boot] Fault Log info File No 4 Length 3177 flags:0x01 state:1
[boot] Fault Log is Armed
ERROR [PX4_MTD] failed to locate spi bus
ERROR [PX4_MTD] mtd failure: -6 bus 2 address 0 class 1
HW arch: HOLYBRO_KAKUTEH7V2
PX4 git-hash: 74570d5abe04e3a30f28c174b7cd0a34c03462e6
PX4 version: 1.16.0 c0 (17825984)
PX4 git-branch: main
OS: NuttX
OS version: Release 11.0.0 (184549631)
OS git-hash: 886acbbdb4f061e5c0ce1a76afbcfa7cb7df9849
Build datetime: Jun 27 2025 15:34:03
Build uri: localhost
Build variant: default
Toolchain: GNU GCC, 10.3.1 20210621 (release)
PX4GUID: 0006000000003537323031335107002e0030
MCU: STM32H7[4|5]xxx, rev. V
nsh: bsondump: command not found
New /fs/mtd_caldata size is:
nsh: bsondump: command not found
Board architecture defaults: /etc/init.d/rc.board_arch_defaults
Board defaults: /etc/init.d/rc.board_defaults
ERROR [param] Parameter EKF2_IMU_CONTROL not found.
Loading airframe: /etc/init.d/airframes/4050_generic_250
INFO [dataman] data manager RAM size is 68528 bytes
Board sensors: /etc/init.d/rc.board_sensors
icm42670p #0 on SPI bus 2 rotation 6
ERROR [SPI_I2C] bmp388: no instance started (no device on bus?)
ist8310 #0 on I2C bus 1 address 0xE
nsh: icm20948_i2c_passthrough: command not found
WARN [SPI_I2C] Already running on bus 1
ekf2 [604:237]
nsh: px4io: command not found
Starting Main GPS on /dev/ttyS3
Starting RC Input Driver on /dev/ttyS4
Starting MAVLink on /dev/ttyS0
INFO [mavlink] mode: Normal, data rate: 1200 B/s on /dev/ttyS0 @ 57600B
INFO [cdcacm_autostart] Starting CDC/ACM autostart
Board extras: /etc/init.d/rc.board_extras

NuttShell (NSH) NuttX-11.0.0
nsh> WARN [health_and_arming_checks] Preflight Fail: barometer 0 missing
WARN [health_and_arming_checks] Preflight Fail: barometer 0 missing

I’ve attached the link to my boards directory below. Any advice would really be appreciated.
Git link to my PX4-Autopilot/boards directory

It looks like your BMP390 isn’t being detected on SPI1 due to a bus configuration issue. Double-check your board.h and rc.board_sensors to ensure SPI1 is correctly initialized and mapped. Also, verify that the correct SPI bus number and chip select are defined in your sensor driver config. Since hardware seems fine, it’s likely a firmware pin mapping or driver init order issue.

Hi Malik,
thanks for the reply. I have double checked my board.h and rc_board.sensors files and I can confirm that the pin mapping is correct. I’ve attached code snippets below for your reference.

board.h :

spi.cpp :

rc_board.sensors:
I have tried -c 0,1,2 for the bmp388 but no luck

I’ve initialized the drivers correctly as shown :

Please advise me where else I can look, or if I’ve missed out a configuration elsewhere. Thanks in advance

after doing some digging, tuns out the SPI driver for BMP388 is untested (as shown in the image below)

I will attempt at fixing this driver if needed, and will update any progress here