PX4 on Crazyflie Bolt 1.1

I am trying to use PX4 on the new Crazyflie Bolt 1.1. I started from the port of PX4 for Crazyflie 2.1. The first issue I am encountering is that the IMU is now on SPI instead of I2C. My first crack at solving this was to change the SPI config file to the pins defined in the schematics

 constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = {
        initSPIBus(SPI::Bus::SPI1, {
                initSPIDevice(SPIDEV_MMCSD(0), SPI::CS{GPIO::PortC, GPIO::Pin12}),
-               initSPIDevice(DRV_FLOW_DEVTYPE_PMW3901, SPI::CS{GPIO::PortB, GPIO::Pin4}),
-               initSPIDevice(DRV_DEVTYPE_UNUSED, SPI::CS{GPIO::PortB, GPIO::Pin5}),
+               initSPIDevice(DRV_GYR_DEVTYPE_BMI088, SPI::CS{GPIO::PortB, GPIO::Pin0}, SPI::DRDY{GPIO::PortC, GPIO::Pin13}),
+               initSPIDevice(DRV_ACC_DEVTYPE_BMI088, SPI::CS{GPIO::PortB, GPIO::Pin1}, SPI::DRDY{GPIO::PortC, GPIO::Pin14}),
        }),
 };

and then modifying the startup script to launch the right drivers

-CONFIG_DRIVERS_IMU_BOSCH_BMI088_I2C=y
+CONFIG_DRIVERS_IMU_BOSCH_BMI088=y
-# Internal I2C bus
-bmp388 -I -a 0x77 -f 400 start
-bmi088_i2c -A -R 0 -I -a 0x18 start
-bmi088_i2c -G -R 0 -I -a 0x69 start
-
-# Optical flow deck
-vl53l1x start -X
+# Internal SPI bus
+bmp388 -s start
+bmi088 -A -s -R 0 start
+bmi088 -G -s -R 0 start

But still no dice…

ERROR [SPI_I2C] bmi088: no instance started (no device on bus?)

Anyone has any pointers?

Hey @robobo, We were just discussing of trying this today with our team. Did you manage to use PX4 on the Bolt?

Hi there ! I think the issue that you are having is associated with the BMI088 sensor on SPI2 not SPI1. This is the configuration I used in my spi.cpp file and managed to get it outputting sensor data.

constexpr px4_spi_bus_t px4_spi_buses[SPI_BUS_MAX_BUS_ITEMS] = {

initSPIBus(SPI::Bus::SPI1, {
	initSPIDevice(SPIDEV_MMCSD(0), SPI::CS{GPIO::PortC, GPIO::Pin12}),
	initSPIDevice(DRV_FLOW_DEVTYPE_PMW3901, SPI::CS{GPIO::PortB, GPIO::Pin4}),
	initSPIDevice(DRV_DEVTYPE_UNUSED, SPI::CS{GPIO::PortB, GPIO::Pin5}),
}),
initSPIBus(SPI::Bus::SPI2, {
	initSPIDevice(DRV_GYR_DEVTYPE_BMI088, SPI::CS{GPIO::PortB, GPIO::Pin0}, SPI::DRDY{GPIO::PortC, GPIO::Pin14}),
    initSPIDevice(DRV_ACC_DEVTYPE_BMI088, SPI::CS{GPIO::PortB, GPIO::Pin1}, SPI::DRDY{GPIO::PortC, GPIO::Pin13}),
}),

};

Your rc.board_sensor file looks good but you also have to allow SPI2 channel in your board.h file like so (this maps the spi2 channels to the specific location on the board as there are multiple possible spots for SPI2.

#define GPIO_SPI2_MISO|(GPIO_SPI2_MISO_1|GPIO_SPEED_50MHz)
#define GPIO_SPI2_MOSI|(GPIO_SPI2_MOSI_1|GPIO_SPEED_50MHz)
#define GPIO_SPI2_SCK|(GPIO_SPI2_SCK_2|GPIO_SPEED_50MHz)

then add the line CONFIG_STM32_SPI2=y into your defconfig file this can also be done by using the make MSG_PWM menuconfig command prompt in WSL. There is some documentation on the nuttx configurations in the PX4 docs.

and change

CONFIG_DRIVERS_IMU_BOSCH_BMI088_I2C=y to CONFIG_DRIVERS_IMU_BOSCH_BMI088=y in your default.px4board file. this can also be done by using the make MSG_PWM boardconfig command prompt in WSL