PX4-v2 with MPU9250 on arduplane 3.7

I have a PX4-v2 based ardupilot and am running arduplane 3.7 with some custom code/flight modes etc. I do not want to switch to 3.8 or higher because it would likely break the aforementioned custom code due to the significant config changes between 3.7 and 3.8.
How can I add support for the MPU9250 IMU/compass over SPI?

I have already tried changing:
#define HAL_INS_DEFAULT HAL_INS_PX4’
#define HAL_BARO_DEFAULT HAL_BARO_PX4’
#define HAL_COMPASS_DEFAULT HAL_COMPASS_PX4’

to:
#define HAL_INS_DEFAULT HAL_INS_MPU9250_SPI’
#define HAL_BARO_DEFAULT HAL_BARO_PX4’
#define HAL_COMPASS_DEFAULT HAL_COMPASS_AK8963_MPU9250 '
Thank you.

It appears as though there is no communication over SPI at all when using arduplane 3.7, However the IMU works correctly with 3.8 and the above changes.

currently the error occurs at initialization, giving the error:
MPU9250: unexpected WHOAMI 0x0

another breadcrumb that seems relevant is that it will try to start a l3gd20 driver, fail and fall into px4_sensor_error(“no l3gd20 found”) unless l3gd20 init code is commented out.

There is no l3gd20 as the mpu9250 is replacing it.