-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BACKPORT v1.13] Add Holybro Pixhawk Pi CM4 Baseboard Support #20182
Changes from all commits
b6ba97c
a19d05c
c65025a
476bcd1
0135f21
feec327
02f9ea1
3bc2020
3d10844
0c184d9
42038d2
7c846dc
cd7ac71
39f1dae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -185,12 +185,15 @@ | |
#define HW_INFO_INIT {'V','5','X','x', 'x',0} | ||
#define HW_INFO_INIT_VER 3 /* Offset in above string of the VER */ | ||
#define HW_INFO_INIT_REV 4 /* Offset in above string of the REV */ | ||
#define BOARD_NUM_SPI_CFG_HW_VERSIONS 6 | ||
#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 | ||
#define V5X01 HW_VER_REV(0x0,0x1) // FMUV5X I2C2 BMP388, Rev 1 | ||
#define V5X02 HW_VER_REV(0x0,0x2) // FMUV5X, Rev 2 | ||
#define V5X40 HW_VER_REV(0x4,0x0) // FMUV5X, HB CM4 base Rev 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this can be dropped. @nicovanduijn Please correct me but the FMUM REV 0 was not shipped other then in prototypes. Once the BMP 388 was moved to i2c2 the FMUM REV e was bumped to 1. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ^ that's incorrect, a batch of 40 FMUM REV0 was definitely shipped to early customers. I don't know how many of them are still operational There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. but if this is about being able to support those FMUs (RC13) on the holybro CM4 base board, we can probably ignore it. We shipped out full skynode assemblies and not single FMUs and I believe it to be safe to assume that those will not be mixed with other base boards |
||
#define V5X41 HW_VER_REV(0x4,0x1) // FMUV5X I2C2 BMP388, HB CM4 base Rev 1 | ||
#define V5X42 HW_VER_REV(0x4,0x2) // FMUV5X, HB CM4 base Rev 2 | ||
#define V5X50 HW_VER_REV(0x5,0x0) // FMUV5X, HB Mini Rev 0 | ||
#define V5X51 HW_VER_REV(0x5,0x1) // FMUV5X I2C2 BMP388, HB Mini Rev 1 | ||
#define V5X52 HW_VER_REV(0x5,0x2) // FMUV5X, HB Mini Rev 2 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,6 +84,30 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION | |
}), | ||
}), | ||
|
||
initSPIHWVersion(V6X43, { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add V6X43 and keep V6X50 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, that's plus around 700 B of flash, unfortunately. And note, this PR is just the backport to v1.13. |
||
initSPIBus(SPI::Bus::SPI1, { | ||
initSPIDevice(DRV_IMU_DEVTYPE_ICM42670P, 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::PortA, GPIO::Pin10}), | ||
}, {GPIO::PortF, GPIO::Pin4}), | ||
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}, SPI::DRDY{GPIO::PortI, GPIO::Pin6}), | ||
}, {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(V6X50, { | ||
initSPIBus(SPI::Bus::SPI1, { | ||
initSPIDevice(DRV_IMU_DEVTYPE_ICM20649, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}), | ||
|
@@ -107,6 +131,54 @@ constexpr px4_spi_bus_all_hw_t px4_spi_buses_all_hw[BOARD_NUM_SPI_CFG_HW_VERSION | |
initSPIConfigExternal(SPI::CS{GPIO::PortA, GPIO::Pin15}, SPI::DRDY{GPIO::PortD, GPIO::Pin12}), | ||
}), | ||
}), | ||
|
||
initSPIHWVersion(V6X44, { | ||
initSPIBus(SPI::Bus::SPI1, { | ||
initSPIDevice(DRV_IMU_DEVTYPE_ICM42670P, 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::PortA, GPIO::Pin10}), | ||
}, {GPIO::PortF, GPIO::Pin4}), | ||
initSPIBus(SPI::Bus::SPI3, { | ||
initSPIDevice(DRV_IMU_DEVTYPE_ICM20649, SPI::CS{GPIO::PortI, GPIO::Pin4}, SPI::DRDY{GPIO::PortI, GPIO::Pin7}), | ||
}, {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(V6X50, { | ||
// initSPIBus(SPI::Bus::SPI1, { | ||
// initSPIDevice(DRV_IMU_DEVTYPE_ICM20649, 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::PortA, GPIO::Pin10}), | ||
// }, {GPIO::PortF, GPIO::Pin4}), | ||
// 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}, SPI::DRDY{GPIO::PortI, GPIO::Pin6}), | ||
// }, {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(V6X04, { | ||
initSPIBus(SPI::Bus::SPI1, { | ||
initSPIDevice(DRV_IMU_DEVTYPE_ICM42670P, SPI::CS{GPIO::PortI, GPIO::Pin9}, SPI::DRDY{GPIO::PortF, GPIO::Pin2}), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is OK - we should ask @Igor-Misic @ThomasDebrunner what ID it is or to reserve it here in the PX4 V5X Spec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a bad feeling about this, but I'm unsure. We are using V5X010001 (VER 0x10, REV 0x01), that's actually the current gen. Just because VER 0x10 is read from EEPROM (according to the ADC it would be ver 07x), it doesn't change the startup script, right? I believe this would break the build for Skynode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nicovanduijn so this change is only for the
release/v1.13
branch, and will go into v1.13.1. Onmain
this should all be fine. Does that resolve it?My problem was that I don't know how
V5X010001
would map back to the oldV5Xabc
format.From what I can see, the counting seems to be 0,1,2,3,...,9,a,10, which would be base 11 which is a bit unusual, but maybe I don't understand it 😄.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's still conted as base16, we just skipped 0b,0c,0d,0e,0f and went to 0x10 after 0x0a to leave space for the remaining resistor space.
e.g. 0x00 - 0x0f : resistors
0x10 - 0xff: eeprom
at least that's my understanding of how it went.
But I can't tell you either how 0x010001 maps to the v5xabc format. I guess that just doesn't work, so we'll have to live with the fact that it won't boot on skynode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, got it, thanks! This is only v1.13, so I assume it doesn't really matter for you/Auterion anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are 11 code point that can be read from resistors.
0 - 0xb (0-11) are the values. 0x7 means read the EEPROM
In the EEPROM with current print format the using 3 digits each (see HW_INFO_REV_DIGITS and HW_INFO_VER_DIGITS and
the value are 0x10-0x3E7 (16-999)
Values are displayed and compared in HEX as
lllvvvrrr
where lll is the label (V5, V6X DH etc) vvv is 3 hex digits for version and rrr is 3 hex digits for revision.On X series the VER is the Base Board and the Rev is the FMUM.
In the code the #defines for the HW configs may use the abbreviated where thay fit.
#define V5X01 HW_VER_REV(0x0,0x1)
that is V5X0000001`This was done to prevent coupling if we compiled with HW_INFO_xxx_DIGITS 2 or 3 or 5 as the value are still valid.