Skip to content

Commit

Permalink
px4_fmu-v5x:Use BOARD_HAS_HW_SPLIT_VERSIONING & common PAB manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
davids5 committed Jan 27, 2024
1 parent 7ed20ec commit 10f3825
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 368 deletions.
6 changes: 3 additions & 3 deletions boards/px4/fmu-v5x/init/rc.board_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ param set-default SENS_EN_INA238 0
param set-default SENS_EN_INA228 0
param set-default SENS_EN_INA226 1

if ver hwtypecmp V5X009000 V5X009001 V5X00a000 V5X00a001 V5X008000 V5X008001 V5X010001
if ver hwbasecmp 008 009 00a 010
then
# Skynode: use the "custom participant" config for uxrce_dds_client
param set-default UXRCE_DDS_PTCFG 2
Expand All @@ -25,12 +25,12 @@ fi
safety_button start

# GPIO Expander driver on external I2C3
if ver hwtypecmp V5X009000 V5X009001
if ver hwbasecmp 009
then
# No USB
mcp23009 start -b 3 -X -D 0xf0 -O 0xf0 -P 0x0f -U 10
fi
if ver hwtypecmp V5X00a000 V5X00a001 V5X008000 V5X008001
if ver hwbasecmp 00a 008
then
mcp23009 start -b 3 -X -D 0xf1 -O 0xf0 -P 0x0f -U 10
fi
2 changes: 1 addition & 1 deletion boards/px4/fmu-v5x/init/rc.board_mavlink
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# board specific MAVLink startup script.
#------------------------------------------------------------------------------

if ver hwtypecmp V5X009000 V5X009001 V5X00a000 V5X00a001 V5X008000 V5X008001 V5X010001
if ver hwbasecmp 008 009 00a 010
then
# Start MAVLink on the UART connected to the mission computer
mavlink start -d /dev/ttyS4 -b 3000000 -r 290000 -m onboard_low_bandwidth -x -z
Expand Down
45 changes: 22 additions & 23 deletions boards/px4/fmu-v5x/init/rc.board_sensors
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

set HAVE_PM2 yes

if ver hwtypecmp V5X005000 V5X005001 V5X005002
if mft query -q -k MFT -s MFT_PM2 -v 0
then
set HAVE_PM2 no
fi
Expand Down Expand Up @@ -49,54 +49,53 @@ then
fi
fi

if ver hwtypecmp V5X000000 V5X000001 V5X000002 V5X001000 V5X004000 V5X004001 V5X004002 V5X005001 V5X005002
if ver hwbasecmp 008 009 00a 010
then
#FMUv5Xbase board orientation
#SKYNODE base fmu board orientation

if ver hwtypecmp V5X000000 V5X000001 V5X004000 V5X004001 V5X005001
if ver hwtypecmp V5X000 V5X001
then
# Internal SPI BMI088
bmi088 -A -R 4 -s start
bmi088 -G -R 4 -s start
bmi088 -A -R 2 -s start
bmi088 -G -R 2 -s start
else
# Internal SPI bus ICM20649
icm20649 -s -R 6 start
icm20649 -s -R 4 start
fi

# Internal SPI bus ICM42688p
icm42688p -R 6 -s start
icm42688p -R 4 -s start

# Internal SPI bus ICM-20602 (hard-mounted)
icm20602 -R 10 -s start
icm20602 -R 8 -s start

# Internal magnetometer on I2c
bmm150 -I start
bmm150 -I -R 6 start

# Auto start power monitors
pm_selector_auterion start

else
#SKYNODE base fmu board orientation
#FMUv5Xbase board orientation

if ver hwtypecmp V5X009000 V5X009001 V5X00a000 V5X00a001 V5X008000 V5X008001 V5X010001
if ver hwtypecmp V5X000 V5X001
then
# Internal SPI BMI088
bmi088 -A -R 2 -s start
bmi088 -G -R 2 -s start
bmi088 -A -R 4 -s start
bmi088 -G -R 4 -s start
else
# Internal SPI bus ICM20649
icm20649 -s -R 4 start
icm20649 -s -R 6 start
fi

# Internal SPI bus ICM42688p
icm42688p -R 4 -s start
icm42688p -R 6 -s start

# Internal SPI bus ICM-20602 (hard-mounted)
icm20602 -R 8 -s start
icm20602 -R 10 -s start

# Internal magnetometer on I2c
bmm150 -I -R 6 start

# Auto start power monitors
pm_selector_auterion start

bmm150 -I start
fi

# External compass on GPS1/I2C1 (the 3rd external bus): standard Holybro Pixhawk 4 or CUAV V5 GPS/compass puck (with lights, safety button, and buzzer)
Expand All @@ -108,7 +107,7 @@ ist8310 -X -b 1 -R 10 start
if param compare SENS_INT_BARO_EN 1
then
bmp388 -I -a 0x77 start
if ver hwtypecmp V5X000000 V5X001000 V5X008000 V5X009000 V5X00a000
if ver hwtypecmp V5X000
then
bmp388 -I start
else
Expand Down
1 change: 0 additions & 1 deletion boards/px4/fmu-v5x/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ add_library(drivers_board
i2c.cpp
init.cpp
led.c
manifest.c
mtd.cpp
sdio.c
spi.cpp
Expand Down
26 changes: 6 additions & 20 deletions boards/px4/fmu-v5x/src/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,31 +179,17 @@

/* HW Version and Revision drive signals Default to 1 to detect */

#define BOARD_HAS_HW_VERSIONING // migrate to Split
#define BOARD_HAS_HW_SPLIT_VERSIONING

#define GPIO_HW_VER_REV_DRIVE /* PG0 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN0)
#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 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
#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
#define V5X90 HW_VER_REV(0x9,0x0) // NO USB, Rev 0
#define V5X91 HW_VER_REV(0x9,0x1) // NO USB I2C2 BMP388, Rev 1
#define V5X92 HW_VER_REV(0x9,0x2) // NO USB I2C2 BMP388, Rev 2
#define V5Xa0 HW_VER_REV(0xa,0x0) // NO USB (Q), Rev 0
#define V5Xa1 HW_VER_REV(0xa,0x1) // NO USB (Q) I2C2 BMP388, Rev 1
#define V5Xa2 HW_VER_REV(0xa,0x2) // NO USB (Q) I2C2 BMP388, Rev 2
#define V5X101 HW_VER_REV(0x10,0x1) // NO USB (Q) I2C2 BMP388, Rev 1
#define BOARD_NUM_SPI_CFG_HW_VERSIONS 3

#define V5X_0 HW_FMUM_ID(0x0) // FMUV5X, Auterion FMUv5x RC13 (baro2 BMP388 on I2C4) Sensor Set Rev 0
#define V5X_1 HW_FMUM_ID(0x1) // FMUV5X, Auterion, HB FMUv5x RC15 (baro2 BMP388 on I2C2) Sensor Set Rev 1
#define V5X_2 HW_FMUM_ID(0x2) // FMUV5X, HB FMUv5x Sensor Set Rev 2

#define UAVCAN_NUM_IFACES_RUNTIME 1

Expand Down
222 changes: 0 additions & 222 deletions boards/px4/fmu-v5x/src/manifest.c

This file was deleted.

Loading

0 comments on commit 10f3825

Please sign in to comment.