Skip to content

Commit

Permalink
boards: arkv6x migrate to split versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKlimaj authored and dagar committed Jan 30, 2024
1 parent dc73d5d commit d2a3ca2
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 379 deletions.
4 changes: 2 additions & 2 deletions boards/ark/fmu-v6x/init/rc.board_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ param set-default SENS_IMU_TEMP 10.0
#param set-default SENS_IMU_TEMP_I 0.025
#param set-default SENS_IMU_TEMP_P 1.0

if ver hwtypecmp ARKV6X000000 ARKV6X001000 ARKV6X002000 ARKV6X003000 ARKV6X004000 ARKV6X005000 ARKV6X006000 ARKV6X007000
if ver hwtypecmp ARKV6X000
then
param set-default SENS_TEMP_ID 2818058
fi

if ver hwtypecmp ARKV6X000001 ARKV6X001001 ARKV6X002001 ARKV6X003001 ARKV6X004001 ARKV6X005001 ARKV6X006001 ARKV6X007001
if ver hwtypecmp ARKV6X001
then
param set-default SENS_TEMP_ID 3014666
fi
Expand Down
6 changes: 3 additions & 3 deletions boards/ark/fmu-v6x/init/rc.board_sensors
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
set HAVE_PM2 yes
set HAVE_PM3 yes

if ver hwtypecmp ARKV6X005000 ARKV6X005001 ARKV6X005002 ARKV6X005003 ARKV6X005004
if mft query -q -k MFT -s MFT_PM2 -v 0
then
set HAVE_PM2 no
set HAVE_PM3 no
Expand Down Expand Up @@ -66,7 +66,7 @@ then
fi
fi

if ver hwtypecmp ARKV6X000000 ARKV6X001000 ARKV6X002000 ARKV6X003000 ARKV6X004000 ARKV6X005000 ARKV6X006000 ARKV6X007000
if ver hwtypecmp ARKV6X000
then
# Internal SPI bus IIM42652 with SPIX measured frequency of 32.051kHz
iim42652 -R 3 -s -b 1 -C 32051 start
Expand All @@ -78,7 +78,7 @@ then
icm42688p -R 6 -s -b 3 -C 32051 start
fi

if ver hwtypecmp ARKV6X000001 ARKV6X001001 ARKV6X002001 ARKV6X003001 ARKV6X004001 ARKV6X005001 ARKV6X006001 ARKV6X007001
if ver hwtypecmp ARKV6X001
then
# Internal SPI bus IIM42653 with SPIX measured frequency of 32.051kHz
#iim42653 -R 3 -s -b 1 -C 32051 start
Expand Down
1 change: 0 additions & 1 deletion boards/ark/fmu-v6x/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ else()
init.c
led.c
mtd.cpp
manifest.c
sdio.c
spi.cpp
spix_sync.c
Expand Down
18 changes: 5 additions & 13 deletions boards/ark/fmu-v6x/src/board_config.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/****************************************************************************
*
* Copyright (c) 2016-2022 PX4 Development Team. All rights reserved.
* Copyright (c) 2016-2024 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
Expand Down Expand Up @@ -204,25 +204,17 @@
#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f)

/* 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 /* PH4 */ GPIO_ADC3_INP15
#define GPIO_HW_VER_SENSE /* PH3 */ GPIO_ADC3_INP14
#define HW_INFO_INIT_PREFIX "ARKV6X"

#define BOARD_NUM_SPI_CFG_HW_VERSIONS 8 // Rev 0 and Rev 1
#define BOARD_NUM_SPI_CFG_HW_VERSIONS 2
// Base/FMUM
#define ARKV6X00 HW_VER_REV(0x0,0x0) // ARKV6X, Sensor Set Rev 0
#define ARKV6X01 HW_VER_REV(0x0,0x1) // ARKV6X, Sensor Set Rev 1
//#define ARKV6X03 HW_VER_REV(0x0,0x3) // ARKV6X, Sensor Set Rev 3
//#define ARKV6X04 HW_VER_REV(0x0,0x4) // ARKV6X, Sensor Set Rev 4
#define ARKV6X10 HW_VER_REV(0x1,0x0) // NO PX4IO, Sensor Set Rev 0
#define ARKV6X11 HW_VER_REV(0x1,0x1) // NO PX4IO, Sensor Set Rev 1
#define ARKV6X40 HW_VER_REV(0x4,0x0) // ARKV6X, Sensor Set Rev 0 HB CM4 base Rev 3
#define ARKV6X41 HW_VER_REV(0x4,0x1) // ARKV6X, Sensor Set Rev 1 HB CM4 base Rev 4
#define ARKV6X50 HW_VER_REV(0x5,0x0) // ARKV6X, Sensor Set Rev 0 HB Mini Rev 5
#define ARKV6X51 HW_VER_REV(0x5,0x1) // ARKV6X, Sensor Set Rev 1 HB Mini Rev 1 // never shipped
#define ARKV6X_0 HW_FMUM_ID(0x0) // ARKV6X, Sensor Set Rev 0
#define ARKV6X_1 HW_FMUM_ID(0x1) // ARKV6X, Sensor Set Rev 1

#define UAVCAN_NUM_IFACES_RUNTIME 1

Expand Down
216 changes: 0 additions & 216 deletions boards/ark/fmu-v6x/src/manifest.c

This file was deleted.

15 changes: 12 additions & 3 deletions boards/ark/fmu-v6x/src/mtd.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/****************************************************************************
*
* Copyright (C) 2022 PX4 Development Team. All rights reserved.
* Copyright (C) 2024 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
Expand Down Expand Up @@ -31,6 +31,9 @@
*
****************************************************************************/

#include <nuttx/config.h>
#include <board_config.h>

#include <nuttx/spi/spi.h>
#include <px4_platform_common/px4_manifest.h>
// KiB BS nB
Expand Down Expand Up @@ -86,10 +89,16 @@ static const px4_mft_entry_s mtd_mft = {
.pmft = (void *) &board_mtd_config,
};

static const px4_mft_entry_s mft_mft = {
.type = MFT,
.pmft = (void *) system_query_manifest,
};

static const px4_mft_s mft = {
.nmft = 1,
.nmft = 2,
.mfts = {
&mtd_mft
&mtd_mft,
&mft_mft,
}
};

Expand Down
Loading

0 comments on commit d2a3ca2

Please sign in to comment.