From f05fccebb73c3e9d9c522970efe00bd0457833e2 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Wed, 7 Sep 2022 18:27:39 +1200 Subject: [PATCH] fmu-v5x: disable rev0 for HB Mini and CM4 base As I understand it, only Rev 1 and Rev 2 were shipped by HB, and likely to be used for the Mini and CM4. --- boards/px4/fmu-v5x/src/board_config.h | 2 +- boards/px4/fmu-v5x/src/manifest.c | 4 +-- boards/px4/fmu-v5x/src/spi.cpp | 49 ++++++++++++++------------- 3 files changed, 28 insertions(+), 27 deletions(-) diff --git a/boards/px4/fmu-v5x/src/board_config.h b/boards/px4/fmu-v5x/src/board_config.h index a7e2e40197..28abf341b9 100644 --- a/boards/px4/fmu-v5x/src/board_config.h +++ b/boards/px4/fmu-v5x/src/board_config.h @@ -185,7 +185,7 @@ #define GPIO_HW_REV_SENSE /* PF5 */ ADC3_GPIO(15) #define GPIO_HW_VER_SENSE /* PF4 */ ADC3_GPIO(14) #define HW_INFO_INIT_PREFIX "V5X" -#define BOARD_NUM_SPI_CFG_HW_VERSIONS 8 +#define BOARD_NUM_SPI_CFG_HW_VERSIONS 7 // Base FMUM #define V5X00 HW_VER_REV(0x0,0x0) // FMUV5X, Rev 0 #define V5X10 HW_VER_REV(0x1,0x0) // NO PX4IO, Rev 0 diff --git a/boards/px4/fmu-v5x/src/manifest.c b/boards/px4/fmu-v5x/src/manifest.c index 9a83c2f496..5c86630220 100644 --- a/boards/px4/fmu-v5x/src/manifest.c +++ b/boards/px4/fmu-v5x/src/manifest.c @@ -184,10 +184,10 @@ static px4_hw_mft_list_entry_t mft_lists[] = { {V5X01, hw_mft_list_v0500, arraySize(hw_mft_list_v0500)}, // FMUV5X, Rev 1 {V5X02, hw_mft_list_v0500, arraySize(hw_mft_list_v0500)}, // FMUV5X, Rev 2 {V5X10, hw_mft_list_v0510, arraySize(hw_mft_list_v0510)}, // NO PX4IO, Rev 0 - {V5X40, hw_mft_list_v0540, arraySize(hw_mft_list_v0540)}, // FMUV5X, HB CM4 base Rev 0 + //{V5X40, hw_mft_list_v0540, arraySize(hw_mft_list_v0540)}, // FMUV5X, HB CM4 base Rev 0, never shipped {V5X41, hw_mft_list_v0540, arraySize(hw_mft_list_v0540)}, // FMUV5X, HB CM4 base Rev 1 {V5X42, hw_mft_list_v0540, arraySize(hw_mft_list_v0540)}, // FMUV5X, HB CM4 base Rev 2 - {V5X50, hw_mft_list_v0550, arraySize(hw_mft_list_v0550)}, // FMUV5X, HB Mini Rev 0 + //{V5X50, hw_mft_list_v0550, arraySize(hw_mft_list_v0550)}, // FMUV5X, HB Mini Rev 0, never shipped {V5X51, hw_mft_list_v0550, arraySize(hw_mft_list_v0550)}, // FMUV5X, HB Mini Rev 1 {V5X52, hw_mft_list_v0550, arraySize(hw_mft_list_v0550)}, // FMUV5X, HB Mini Rev 2 {V5X90, hw_mft_list_v0509, arraySize(hw_mft_list_v0509)}, // NO USB, Rev 0 diff --git a/boards/px4/fmu-v5x/src/spi.cpp b/boards/px4/fmu-v5x/src/spi.cpp index b64cfa0218..2b654e9709 100644 --- a/boards/px4/fmu-v5x/src/spi.cpp +++ b/boards/px4/fmu-v5x/src/spi.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * - * Copyright (C) 2019 PX4 Development Team. All rights reserved. + * Copyright (C) 2019-2022 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -154,29 +154,30 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION }), }), - initSPIHWVersion(V5X50, { - initSPIBus(SPI::Bus::SPI1, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}), - }, {GPIO::PortI, GPIO::Pin11}), - initSPIBus(SPI::Bus::SPI2, { - initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortH, GPIO::Pin12}), - }, {GPIO::PortD, GPIO::Pin15}), - initSPIBus(SPI::Bus::SPI3, { - initSPIDevice(DRV_GYR_DEVTYPE_BMI088, SPI::CS{GPIO::PortI, GPIO::Pin8}, SPI::DRDY{GPIO::PortI, GPIO::Pin7}), - initSPIDevice(DRV_ACC_DEVTYPE_BMI088, SPI::CS{GPIO::PortI, GPIO::Pin4}), - }, {GPIO::PortE, GPIO::Pin7}), - // initSPIBus(SPI::Bus::SPI4, { - // // no devices - // TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h - // }, {GPIO::PortG, GPIO::Pin8}), - initSPIBus(SPI::Bus::SPI5, { - initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7}) - }), - initSPIBusExternal(SPI::Bus::SPI6, { - initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}, SPI::DRDY{GPIO::PortD, GPIO::Pin11}), - initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}), - }), - }), + // never shipped + //initSPIHWVersion(V5X50, { + // initSPIBus(SPI::Bus::SPI1, { + // initSPIDevice(DRV_IMU_DEVTYPE_ICM20602, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}), + // }, {GPIO::PortI, GPIO::Pin11}), + // initSPIBus(SPI::Bus::SPI2, { + // initSPIDevice(DRV_IMU_DEVTYPE_ICM42688P, SPI::CS{GPIO::PortH, GPIO::Pin5}, SPI::DRDY{GPIO::PortH, GPIO::Pin12}), + // }, {GPIO::PortD, GPIO::Pin15}), + // initSPIBus(SPI::Bus::SPI3, { + // initSPIDevice(DRV_GYR_DEVTYPE_BMI088, SPI::CS{GPIO::PortI, GPIO::Pin8}, SPI::DRDY{GPIO::PortI, GPIO::Pin7}), + // initSPIDevice(DRV_ACC_DEVTYPE_BMI088, SPI::CS{GPIO::PortI, GPIO::Pin4}), + // }, {GPIO::PortE, GPIO::Pin7}), + // // initSPIBus(SPI::Bus::SPI4, { + // // // no devices + // // TODO: if enabled, remove GPIO_VDD_3V3_SENSORS4_EN from board_config.h + // // }, {GPIO::PortG, GPIO::Pin8}), + // initSPIBus(SPI::Bus::SPI5, { + // initSPIDevice(SPIDEV_FLASH(0), SPI::CS{GPIO::PortG, GPIO::Pin7}) + // }), + // initSPIBusExternal(SPI::Bus::SPI6, { + // initSPIConfigExternal(SPI::CS{GPIO::PortI, GPIO::Pin10}, SPI::DRDY{GPIO::PortD, GPIO::Pin11}), + // initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}), + // }), + //}), initSPIHWVersion(V5X51, { initSPIBus(SPI::Bus::SPI1, {