Skip to content
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

ARKV6X 1.13 Backports #21104

Merged
merged 3 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions ROMFS/px4fmu_common/init.d/rcS
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ else
param select-backup /fs/microsd/parameters_backup.bson
fi

if ver hwcmp PX4_FMU_V5X PX4_FMU_V6X
if ver hwcmp PX4_FMU_V5X PX4_FMU_V6X ARK_FMU_V6X
then
netman update -i eth0
fi
Expand Down Expand Up @@ -282,28 +282,6 @@ else
param set SYS_AUTOCONFIG 0
fi

#
# Check if UAVCAN is enabled, default to it for ESCs.
#
if param greater -s UAVCAN_ENABLE 0
then
# Start core UAVCAN module.
if uavcan start
then
if param greater UAVCAN_ENABLE 2
then
set OUTPUT_MODE uavcan_esc
fi
else
tune_control play error
fi
else
if param greater -s UAVCAN_V1_ENABLE 0
then
uavcan_v1 start
fi
fi

#
# Check if PX4IO present and update firmware if needed.
# Assumption IOFW set to firmware file and IO_PRESENT = no
Expand Down Expand Up @@ -556,6 +534,28 @@ else
fi
unset BOARD_BOOTLOADER_UPGRADE

#
# Check if UAVCAN is enabled, default to it for ESCs.
#
if param greater -s UAVCAN_ENABLE 0
then
# Start core UAVCAN module.
if uavcan start
then
if param greater UAVCAN_ENABLE 2
then
set OUTPUT_MODE uavcan_esc
fi
else
tune_control play error
fi
else
if param greater -s UAVCAN_V1_ENABLE 0
then
uavcan_v1 start
fi
fi

#
# End of autostart.
#
Expand Down
2 changes: 2 additions & 0 deletions boards/ark/fmu-v6x/default.px4board
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ CONFIG_BOARD_SERIAL_GPS2="/dev/ttyS7"
CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS6"
CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS4"
CONFIG_BOARD_SERIAL_TEL3="/dev/ttyS1"
CONFIG_BOARD_SERIAL_TEL4="/dev/ttyS3"
CONFIG_DRIVERS_ADC_BOARD_ADC=y
CONFIG_DRIVERS_BAROMETER_BMP388=y
CONFIG_DRIVERS_BAROMETER_MS5611=y
Expand Down Expand Up @@ -85,6 +86,7 @@ CONFIG_SYSTEMCMDS_PERF=y
CONFIG_SYSTEMCMDS_PWM=y
CONFIG_SYSTEMCMDS_REBOOT=y
CONFIG_SYSTEMCMDS_SD_BENCH=y
CONFIG_SYSTEMCMDS_SD_STRESS=y
CONFIG_SYSTEMCMDS_SYSTEM_TIME=y
CONFIG_SYSTEMCMDS_TOP=y
CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y
Expand Down
7 changes: 7 additions & 0 deletions boards/ark/fmu-v6x/init/rc.board_defaults
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,11 @@ param set-default SENS_EN_INA238 0
param set-default SENS_EN_INA228 0
param set-default SENS_EN_INA226 1

if ver hwtypecmp ARKV6X001000 ARKV6X001001 ARKV6X001002 ARKV6X001003 ARKV6X001004 ARKV6X001005 ARKV6X001006 ARKV6X001007
then
param set-default SYS_USE_IO 0
else
param set-default SYS_USE_IO 1
fi

safety_button start
6 changes: 3 additions & 3 deletions boards/ark/fmu-v6x/nuttx-config/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,16 +379,16 @@

#define GPIO_UART5_RX GPIO_UART5_RX_3 /* PD2 */
#define GPIO_UART5_TX GPIO_UART5_TX_3 /* PC12 */
// GPIO_UART5_RTS no remap /* PC8 */
// GPIO_UART5_RTS No remap /* PC8 */
// GPIO_UART5_CTS No remap /* PC9 */

#define GPIO_USART6_RX GPIO_USART6_RX_1 /* PC7 */
#define GPIO_USART6_TX GPIO_USART6_TX_1 /* PC6 */

#define GPIO_UART7_RX GPIO_UART7_RX_4 /* PF6 */
#define GPIO_UART7_TX GPIO_UART7_TX_3 /* PE8 */
#define GPIO_UART7_RTS GPIO_UART7_RTS_2 /* PF8 */
#define GPIO_UART7_CTS GPIO_UART7_CTS_1 /* PE10 */
#define GPIO_UART7_RTS (GPIO_UART7_RTS_2 | GPIO_PULLDOWN) /* PF8 */
#define GPIO_UART7_CTS (GPIO_UART7_CTS_1 | GPIO_PULLDOWN) /* PE10 */

#define GPIO_UART8_RX GPIO_UART8_RX_1 /* PE0 */
#define GPIO_UART8_TX GPIO_UART8_TX_1 /* PE1 */
Expand Down
1 change: 0 additions & 1 deletion boards/ark/fmu-v6x/src/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@
/* RC Serial port */

#define RC_SERIAL_PORT "/dev/ttyS5"
#define RC_SERIAL_SINGLEWIRE

/* Input Capture Channels. */
#define INPUT_CAP1_TIMER 1
Expand Down
10 changes: 10 additions & 0 deletions boards/ark/fmu-v6x/src/bootloader_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include <stm32_uart.h>
#include <arch/board/board.h>
#include "arm_internal.h"
#include <px4_platform/gpio.h>
#include <px4_platform_common/init.h>

extern int sercon_main(int c, char **argv);
Expand All @@ -54,6 +55,15 @@ __EXPORT void board_on_reset(int status) {}

__EXPORT void stm32_boardinitialize(void)
{
/* configure pins */
const uint32_t list[] = PX4_GPIO_INIT_LIST;

for (size_t gpio = 0; gpio < arraySize(list); gpio++) {
if (list[gpio] != 0) {
px4_arch_configgpio(list[gpio]);
}
}

/* configure USB interfaces */
stm32_usbinitialize();
}
Expand Down
3 changes: 2 additions & 1 deletion boards/ark/fmu-v6x/src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ __EXPORT void board_peripheral_reset(int ms)
{
/* set the peripheral rails off */

VDD_5V_HIPOWER_EN(false);
VDD_5V_PERIPH_EN(false);
board_control_spi_sensors_power(false, 0xffff);
VDD_3V3_SENSORS4_EN(false);
Expand All @@ -123,6 +124,7 @@ __EXPORT void board_peripheral_reset(int ms)
VDD_3V3_SPEKTRUM_POWER_EN(last);
board_control_spi_sensors_power(true, 0xffff);
VDD_3V3_SENSORS4_EN(true);
VDD_5V_HIPOWER_EN(true);
VDD_5V_PERIPH_EN(true);

}
Expand Down Expand Up @@ -209,7 +211,6 @@ stm32_boardinitialize(void)
__EXPORT int board_app_initialize(uintptr_t arg)
{
/* Power on Interfaces */
VDD_3V3_SD_CARD_EN(true);
VDD_5V_PERIPH_EN(true);
VDD_5V_HIPOWER_EN(true);
VDD_3V3_SENSORS4_EN(true);
Expand Down
1 change: 0 additions & 1 deletion boards/ark/fmu-v6x/src/mtd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ static const px4_mft_device_t i2c3 = { // 24LC64T on Base 8K 32 X 2
.devid = PX4_MK_I2C_DEVID(3, 0x51)
};


static const px4_mtd_entry_t fmum_fram = {
.device = &spi5,
.npart = 2,
Expand Down