How to add an external i2c and/or SPI IMU?

The fmuv2 firmware is a stripped fmuv3 firmware for support of a smaller flash size.
Also both include only very general (basic) HW description.
Other firmware like Pixhawk1defining more details like search of external compasses on I2C-Bus.
Maybe this is the reason why your board is not searching for an external IMU on the I2C-Bus. If this is the case you have to modify according to your board the “hwdef.dat” file of your firmware

I just have learned on my ESP32 board that the firmware is detetcting the external MPU6050 (GY521) on the I2C if i add
#define HAL_INS_DEFAULT HAL_INS_MPU60x0_I2C
#define PROBE_IMU_I2C(driver, bus, addr, args …) ADD_BACKEND(AP_InertialSensor_ ## driver::probe(*this,GET_I2C_DEVICE(bus, addr),##args))
#define HAL_INS_PROBE_LIST PROBE_IMU_I2C(Invensense, 0, 0x68, ROTATION_NONE
As my board has only one I2C-Bus and your board has probably two (one internal and one external) it might be necessary to change last “define” to
#define HAL_INS_PROBE_LIST PROBE_IMU_I2C(Invensense, 1, 0x68, ROTATION_NONE

Thank you very much for your help, I will try! Thank you for your continuous reply these days. Thank you very much!

I would start by downloading the .apj file from here and flash it using Mission Planners “load custom firmware”
Pixhawk1