From cf52ba9841b484a2d7c94bd266249ecd91927031 Mon Sep 17 00:00:00 2001 From: Jukka Laitinen Date: Tue, 14 Dec 2021 13:45:28 +0200 Subject: [PATCH 1/5] Add initial ssrc target for Pixhawk 5 and Pixhawk 5x - Add TOC to fmu-v5x (to the beginning) - Enable crypto - Enable uxrce_dds_client - Remove some useless modules to make up flash space Signed-off-by: Jukka Laitinen --- .../px4/fmu-v5/nuttx-config/scripts/script.ld | 6 +- boards/px4/fmu-v5/nuttx-config/scripts/toc.ld | 6 +- boards/px4/fmu-v5/nuttx-config/ssrc/defconfig | 83 ++++++++++--------- boards/px4/fmu-v5/ssrc.px4board | 19 +---- .../fmu-v5x/nuttx-config/scripts/script.ld | 6 +- .../px4/fmu-v5x/nuttx-config/scripts/toc.ld | 6 +- .../px4/fmu-v5x/nuttx-config/ssrc/defconfig | 12 +-- boards/px4/fmu-v5x/ssrc.px4board | 30 +++++-- 8 files changed, 87 insertions(+), 81 deletions(-) diff --git a/boards/px4/fmu-v5/nuttx-config/scripts/script.ld b/boards/px4/fmu-v5/nuttx-config/scripts/script.ld index 4aa8307a9b8f..0d7c9d34199b 100644 --- a/boards/px4/fmu-v5/nuttx-config/scripts/script.ld +++ b/boards/px4/fmu-v5/nuttx-config/scripts/script.ld @@ -104,20 +104,20 @@ SECTIONS PROVIDE(_boot_signature = 0); /* Make a hole for the ToC and signature */ - .toc (NOLOAD) : { + toc (NOLOAD) : { *(.main_toc) *(.main_toc_sig) FILL(0xff); - . = ALIGN(0x1000); + . = ALIGN(8); } > FLASH_AXIM .vectors : { _stext = ABSOLUTE(.); *(.vectors) - . = ALIGN(32); } > FLASH_AXIM .text : { + . = ALIGN(32); /* This signature provides the bootloader with a way to delay booting */ diff --git a/boards/px4/fmu-v5/nuttx-config/scripts/toc.ld b/boards/px4/fmu-v5/nuttx-config/scripts/toc.ld index b68869ab9fb6..0653e72606b4 100644 --- a/boards/px4/fmu-v5/nuttx-config/scripts/toc.ld +++ b/boards/px4/fmu-v5/nuttx-config/scripts/toc.ld @@ -20,8 +20,7 @@ MEMORY { - /* -64 <- Leave room for the signature */ - progmem (r) : ORIGIN = 0x08008000, LENGTH = 2016K - 64 + progmem (r) : ORIGIN = 0x08008000, LENGTH = 2016K } OUTPUT_ARCH("arm") @@ -36,7 +35,7 @@ SECTIONS KEEP(*(.main_toc)); /* Padd the rest */ FILL(0xff); - . = 0x1000 - 64; + . = ALIGN(8); _toc_end = ABSOLUTE(.); } > progmem @@ -52,7 +51,6 @@ SECTIONS /* The application firmware payload */ _app_start = ABSOLUTE(.); *(.firmware) - . = ALIGN(4); _app_end = ABSOLUTE(.); } > progmem diff --git a/boards/px4/fmu-v5/nuttx-config/ssrc/defconfig b/boards/px4/fmu-v5/nuttx-config/ssrc/defconfig index d4237fae83dc..e2205cfaa82d 100644 --- a/boards/px4/fmu-v5/nuttx-config/ssrc/defconfig +++ b/boards/px4/fmu-v5/nuttx-config/ssrc/defconfig @@ -7,51 +7,22 @@ # # CONFIG_DISABLE_ENVIRON is not set # CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -# CONFIG_DISABLE_PTHREAD is not set -# CONFIG_FS_ANONMAP is not set -# CONFIG_FS_PROCFS_EXCLUDE_MEMINFO is not set +# CONFIG_FS_PROCFS_EXCLUDE_ENVIRON is not set # CONFIG_MMCSD_HAVE_CARDDETECT is not set # CONFIG_MMCSD_HAVE_WRITEPROTECT is not set # CONFIG_MMCSD_MMCSUPPORT is not set # CONFIG_MMCSD_SPI is not set # CONFIG_NSH_DISABLEBG is not set # CONFIG_NSH_DISABLESCRIPT is not set -# CONFIG_NSH_DISABLE_CAT is not set -# CONFIG_NSH_DISABLE_CD is not set -# CONFIG_NSH_DISABLE_CP is not set -# CONFIG_NSH_DISABLE_DATE is not set # CONFIG_NSH_DISABLE_DF is not set -# CONFIG_NSH_DISABLE_ECHO is not set -# CONFIG_NSH_DISABLE_ENV is not set # CONFIG_NSH_DISABLE_EXEC is not set # CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_EXPORT is not set -# CONFIG_NSH_DISABLE_FREE is not set # CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HELP is not set # CONFIG_NSH_DISABLE_ITEF is not set -# CONFIG_NSH_DISABLE_KILL is not set # CONFIG_NSH_DISABLE_LOOPS is not set -# CONFIG_NSH_DISABLE_LS is not set -# CONFIG_NSH_DISABLE_MKDIR is not set # CONFIG_NSH_DISABLE_MKFATFS is not set -# CONFIG_NSH_DISABLE_MOUNT is not set -# CONFIG_NSH_DISABLE_MV is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_PSSTACKUSAGE is not set -# CONFIG_NSH_DISABLE_PWD is not set -# CONFIG_NSH_DISABLE_RM is not set -# CONFIG_NSH_DISABLE_RMDIR is not set # CONFIG_NSH_DISABLE_SEMICOLON is not set -# CONFIG_NSH_DISABLE_SET is not set -# CONFIG_NSH_DISABLE_SLEEP is not set -# CONFIG_NSH_DISABLE_SOURCE is not set -# CONFIG_NSH_DISABLE_TEST is not set # CONFIG_NSH_DISABLE_TIME is not set -# CONFIG_NSH_DISABLE_UMOUNT is not set -# CONFIG_NSH_DISABLE_UNSET is not set -# CONFIG_NSH_DISABLE_UPTIME is not set -# CONFIG_NSH_DISABLE_USLEEP is not set CONFIG_ARCH="arm" CONFIG_ARCH_BOARD_CUSTOM=y CONFIG_ARCH_BOARD_CUSTOM_DIR="../../../../boards/px4/fmu-v5/nuttx-config" @@ -60,7 +31,7 @@ CONFIG_ARCH_BOARD_CUSTOM_NAME="px4" CONFIG_ARCH_CHIP="stm32f7" CONFIG_ARCH_CHIP_STM32F765II=y CONFIG_ARCH_CHIP_STM32F7=y -CONFIG_ARCH_INTERRUPTSTACK=1024 +CONFIG_ARCH_INTERRUPTSTACK=512 CONFIG_ARCH_STACKDUMP=y CONFIG_ARMV7M_BASEPRI_WAR=y CONFIG_ARMV7M_DCACHE=y @@ -70,11 +41,11 @@ CONFIG_ARMV7M_MEMCPY=y CONFIG_ARMV7M_USEBASEPRI=y CONFIG_ARM_MPU_EARLY_RESET=y CONFIG_BOARDCTL_RESET=y -CONFIG_BOARD_ASSERT_RESET_VALUE=0 CONFIG_BOARD_CRASHDUMP=y CONFIG_BOARD_LOOPSPERMSEC=22114 CONFIG_BOARD_RESET_ON_ASSERT=2 CONFIG_BUILTIN=y +CONFIG_C99_BOOL8=y CONFIG_CDCACM=y CONFIG_CDCACM_IFLOWCONTROL=y CONFIG_CDCACM_PRODUCTID=0x0032 @@ -92,17 +63,20 @@ CONFIG_DEFAULT_SMALL=y CONFIG_DEV_FIFO_SIZE=0 CONFIG_DEV_PIPE_MAXSIZE=1024 CONFIG_DEV_PIPE_SIZE=70 +CONFIG_DISABLE_MQUEUE=y +CONFIG_EXAMPLES_CALIB_UDELAY=y +CONFIG_DISABLE_PTHREAD=n CONFIG_FAT_DMAMEMORY=y CONFIG_FAT_LCNAMES=y CONFIG_FAT_LFN=y CONFIG_FAT_LFN_ALIAS_HASH=y CONFIG_FDCLONE_STDIO=y -CONFIG_FILE_STREAM=y CONFIG_FS_BINFS=y CONFIG_FS_CROMFS=y CONFIG_FS_FAT=y CONFIG_FS_FATTIME=y CONFIG_FS_PROCFS=y +CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y CONFIG_FS_PROCFS_MAX_TASKS=64 CONFIG_FS_PROCFS_REGISTER=y CONFIG_FS_ROMFS=y @@ -114,11 +88,8 @@ CONFIG_HAVE_CXXINITIALIZE=y CONFIG_I2C=y CONFIG_I2C_RESET=y CONFIG_IDLETHREAD_STACKSIZE=750 -CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=2944 CONFIG_LIBC_LONG_LONG=y CONFIG_LIBC_STRERROR=y -CONFIG_LIBM_TOOLCHAIN=y CONFIG_MEMSET_64BIT=y CONFIG_MEMSET_OPTSPEED=y CONFIG_MMCSD=y @@ -129,13 +100,40 @@ CONFIG_MTD=y CONFIG_MTD_BYTE_WRITE=y CONFIG_MTD_PARTITION=y CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=48 +CONFIG_NAME_MAX=40 CONFIG_NSH_ARCHINIT=y CONFIG_NSH_ARGCAT=y CONFIG_NSH_BUILTIN_APPS=y +CONFIG_NSH_CMDPARMS=y CONFIG_NSH_CROMFSETC=y CONFIG_NSH_CUSTOMROMFS=y CONFIG_NSH_CUSTOMROMFS_HEADER="../../include/nsh_romfsimg.h" +CONFIG_NSH_DISABLE_CAT=n +CONFIG_NSH_DISABLE_CD=n +CONFIG_NSH_DISABLE_CP=n +CONFIG_NSH_DISABLE_DATE=n +CONFIG_NSH_DISABLE_ECHO=n +CONFIG_NSH_DISABLE_ENV=n +CONFIG_NSH_DISABLE_EXPORT=n +CONFIG_NSH_DISABLE_FREE=n +CONFIG_NSH_DISABLE_HELP=n +CONFIG_NSH_DISABLE_KILL=n +CONFIG_NSH_DISABLE_LS=n +CONFIG_NSH_DISABLE_MKDIR=n +CONFIG_NSH_DISABLE_MOUNT=n +CONFIG_NSH_DISABLE_MV=n +CONFIG_NSH_DISABLE_PS=n +CONFIG_NSH_DISABLE_PSSTACKUSAGE=n +CONFIG_NSH_DISABLE_PWD=n +CONFIG_NSH_DISABLE_RM=n +CONFIG_NSH_DISABLE_RMDIR=n +CONFIG_NSH_DISABLE_SET=n +CONFIG_NSH_DISABLE_SOURCE=n +CONFIG_NSH_DISABLE_SLEEP=n +CONFIG_NSH_DISABLE_TEST=n +CONFIG_NSH_DISABLE_UMOUNT=n +CONFIG_NSH_DISABLE_UNSET=n +CONFIG_NSH_DISABLE_USLEEP=n CONFIG_NSH_LINELEN=128 CONFIG_NSH_MAXARGUMENTS=15 CONFIG_NSH_NESTDEPTH=8 @@ -146,6 +144,7 @@ CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y CONFIG_OTG_ID_GPIO_DISABLE=y CONFIG_PIPES=y +CONFIG_PREALLOC_TIMERS=50 CONFIG_PRIORITY_INHERITANCE=y CONFIG_PTHREAD_MUTEX_ROBUST=y CONFIG_PTHREAD_STACK_MIN=512 @@ -156,24 +155,29 @@ CONFIG_RAW_BINARY=y CONFIG_READLINE_CMD_HISTORY=y CONFIG_READLINE_TABCOMPLETION=y CONFIG_RTC_DATETIME=y +CONFIG_SCHED_ATEXIT=y CONFIG_SCHED_HPWORK=y CONFIG_SCHED_HPWORKPRIORITY=249 CONFIG_SCHED_HPWORKSTACKSIZE=1280 CONFIG_SCHED_INSTRUMENTATION=y +CONFIG_SCHED_INSTRUMENTATION_EXTERNAL=y CONFIG_SCHED_INSTRUMENTATION_SWITCH=y CONFIG_SCHED_LPWORK=y CONFIG_SCHED_LPWORKPRIORITY=50 CONFIG_SCHED_LPWORKSTACKSIZE=1632 CONFIG_SCHED_WAITPID=y +CONFIG_SDCLONE_DISABLE=y CONFIG_SDMMC1_SDIO_MODE=y CONFIG_SDMMC1_SDIO_PULLUP=y -CONFIG_SEM_PREALLOCHOLDERS=32 +CONFIG_SEM_NNESTPRIO=8 +CONFIG_SEM_PREALLOCHOLDERS=0 CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y CONFIG_SERIAL_TERMIOS=y CONFIG_SIG_DEFAULT=y CONFIG_SIG_SIGALRM_ACTION=y CONFIG_SIG_SIGUSR1_ACTION=y CONFIG_SIG_SIGUSR2_ACTION=y +CONFIG_SIG_SIGWORK=4 CONFIG_STACK_COLORATION=y CONFIG_START_DAY=30 CONFIG_START_MONTH=11 @@ -210,6 +214,7 @@ CONFIG_STM32F7_SPI2=y CONFIG_STM32F7_SPI4=y CONFIG_STM32F7_SPI5=y CONFIG_STM32F7_SPI6=y +CONFIG_STM32F7_SPI_DMA=y CONFIG_STM32F7_SPI_DMATHRESHOLD=8 CONFIG_STM32F7_TIM10=y CONFIG_STM32F7_TIM11=y @@ -264,3 +269,5 @@ CONFIG_USBDEV=y CONFIG_USBDEV_BUSPOWERED=y CONFIG_USBDEV_MAXPOWER=500 CONFIG_USEC_PER_TICK=1000 +CONFIG_INIT_STACKSIZE=2944 +CONFIG_INIT_ENTRYPOINT="nsh_main" diff --git a/boards/px4/fmu-v5/ssrc.px4board b/boards/px4/fmu-v5/ssrc.px4board index ac15a9d41529..e3edc876c45d 100644 --- a/boards/px4/fmu-v5/ssrc.px4board +++ b/boards/px4/fmu-v5/ssrc.px4board @@ -1,21 +1,10 @@ CONFIG_BOARD_CRYPTO=y -CONFIG_COMMON_OPTICAL_FLOW=n -CONFIG_COMMON_OSD=n -CONFIG_DRIVERS_CAMERA_CAPTURE=n -CONFIG_DRIVERS_CAMERA_TRIGGER=n -CONFIG_DRIVERS_CAMERA_FEEDBACK=n -CONFIG_DRIVERS_STUB_KEYSTORE=y CONFIG_DRIVERS_SW_CRYPTO=y -CONFIG_EXAMPLES_FAKE_GPS=n -CONFIG_MODULES_ROVER_POS_CONTROL=n -CONFIG_SYSTEMCMDS_REFLECT=n -CONFIG_SYSTEMCMDS_SD_BENCH=n -CONFIG_SYSTEMCMDS_SD_STRESS=n -CONFIG_SYSTEMCMDS_SERIAL_TEST=n -CONFIG_SYSTEMCMDS_I2CDETECT=n +CONFIG_DRIVERS_STUB_KEYSTORE=y +CONFIG_MODULES_MICRORTPS_BRIDGE=y +CONFIG_DRIVERS_PROTOCOL_SPLITTER=y # Test keys to help local building # These can be overridden in CI with environment variables pointing to real keys CONFIG_PUBLIC_KEY0="../../../Tools/test_keys/key0.pub" -CONFIG_PUBLIC_KEY1="../../../Tools/test_keys/key0.pub" -CONFIG_PUBLIC_KEY2="../../../Tools/test_keys/rsa2048.pub" +CONFIG_PUBLIC_KEY1="../../../Tools/test_keys/rsa2048.pub" diff --git a/boards/px4/fmu-v5x/nuttx-config/scripts/script.ld b/boards/px4/fmu-v5x/nuttx-config/scripts/script.ld index 4aa8307a9b8f..0d7c9d34199b 100644 --- a/boards/px4/fmu-v5x/nuttx-config/scripts/script.ld +++ b/boards/px4/fmu-v5x/nuttx-config/scripts/script.ld @@ -104,20 +104,20 @@ SECTIONS PROVIDE(_boot_signature = 0); /* Make a hole for the ToC and signature */ - .toc (NOLOAD) : { + toc (NOLOAD) : { *(.main_toc) *(.main_toc_sig) FILL(0xff); - . = ALIGN(0x1000); + . = ALIGN(8); } > FLASH_AXIM .vectors : { _stext = ABSOLUTE(.); *(.vectors) - . = ALIGN(32); } > FLASH_AXIM .text : { + . = ALIGN(32); /* This signature provides the bootloader with a way to delay booting */ diff --git a/boards/px4/fmu-v5x/nuttx-config/scripts/toc.ld b/boards/px4/fmu-v5x/nuttx-config/scripts/toc.ld index b68869ab9fb6..0653e72606b4 100644 --- a/boards/px4/fmu-v5x/nuttx-config/scripts/toc.ld +++ b/boards/px4/fmu-v5x/nuttx-config/scripts/toc.ld @@ -20,8 +20,7 @@ MEMORY { - /* -64 <- Leave room for the signature */ - progmem (r) : ORIGIN = 0x08008000, LENGTH = 2016K - 64 + progmem (r) : ORIGIN = 0x08008000, LENGTH = 2016K } OUTPUT_ARCH("arm") @@ -36,7 +35,7 @@ SECTIONS KEEP(*(.main_toc)); /* Padd the rest */ FILL(0xff); - . = 0x1000 - 64; + . = ALIGN(8); _toc_end = ABSOLUTE(.); } > progmem @@ -52,7 +51,6 @@ SECTIONS /* The application firmware payload */ _app_start = ABSOLUTE(.); *(.firmware) - . = ALIGN(4); _app_end = ABSOLUTE(.); } > progmem diff --git a/boards/px4/fmu-v5x/nuttx-config/ssrc/defconfig b/boards/px4/fmu-v5x/nuttx-config/ssrc/defconfig index 6b77c09fc097..82a5563715e2 100644 --- a/boards/px4/fmu-v5x/nuttx-config/ssrc/defconfig +++ b/boards/px4/fmu-v5x/nuttx-config/ssrc/defconfig @@ -14,6 +14,7 @@ # CONFIG_MMCSD_HAVE_WRITEPROTECT is not set # CONFIG_MMCSD_MMCSUPPORT is not set # CONFIG_MMCSD_SPI is not set +# CONFIG_NET_TCP_RECV_PACK is not set # CONFIG_NSH_DISABLEBG is not set # CONFIG_NSH_DISABLESCRIPT is not set # CONFIG_NSH_DISABLE_ARP is not set @@ -97,7 +98,6 @@ CONFIG_DEV_FIFO_SIZE=0 CONFIG_DEV_GPIO=y CONFIG_DEV_PIPE_MAXSIZE=1024 CONFIG_DEV_PIPE_SIZE=70 -CONFIG_DISABLE_PTHREAD=n CONFIG_ETH0_PHY_LAN8742A=y CONFIG_FAT_DMAMEMORY=y CONFIG_FAT_LCNAMES=y @@ -126,10 +126,9 @@ CONFIG_INIT_STACKSIZE=2944 CONFIG_IOB_NBUFFERS=24 CONFIG_IOB_THROTTLE=0 CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y CONFIG_LIBC_NETDB=y +CONFIG_LIBC_LONG_LONG=y CONFIG_LIBC_STRERROR=y -CONFIG_LIBM_TOOLCHAIN=y CONFIG_MEMSET_64BIT=y CONFIG_MEMSET_OPTSPEED=y CONFIG_MMCSD=y @@ -140,7 +139,7 @@ CONFIG_MTD=y CONFIG_MTD_BYTE_WRITE=y CONFIG_MTD_PARTITION=y CONFIG_MTD_RAMTRON=y -CONFIG_NAME_MAX=48 +CONFIG_NAME_MAX=40 CONFIG_NET=y CONFIG_NETDEV_IFINDEX=y CONFIG_NETDEV_PHY_IOCTL=y @@ -152,6 +151,7 @@ CONFIG_NET_BROADCAST=y CONFIG_NET_ETH_PKTSIZE=1518 CONFIG_NET_ICMP=y CONFIG_NET_ICMP_SOCKET=y +CONFIG_NET_NACTIVESOCKETS=16 CONFIG_NET_SOCKOPTS=y CONFIG_NET_TCP=y CONFIG_NET_TCPBACKLOG=y @@ -165,6 +165,7 @@ CONFIG_NET_UDP_WRITE_BUFFERS=y CONFIG_NSH_ARCHINIT=y CONFIG_NSH_ARGCAT=y CONFIG_NSH_BUILTIN_APPS=y +CONFIG_NSH_CMDPARMS=y CONFIG_NSH_CROMFSETC=y CONFIG_NSH_CUSTOMROMFS=y CONFIG_NSH_CUSTOMROMFS_HEADER="../../include/nsh_romfsimg.h" @@ -178,6 +179,7 @@ CONFIG_NSH_STRERROR=y CONFIG_NSH_VARS=y CONFIG_OTG_ID_GPIO_DISABLE=y CONFIG_PIPES=y +CONFIG_PREALLOC_TIMERS=50 CONFIG_PRIORITY_INHERITANCE=y CONFIG_PTHREAD_MUTEX_ROBUST=y CONFIG_PTHREAD_STACK_MIN=512 @@ -205,6 +207,7 @@ CONFIG_SIG_DEFAULT=y CONFIG_SIG_SIGALRM_ACTION=y CONFIG_SIG_SIGUSR1_ACTION=y CONFIG_SIG_SIGUSR2_ACTION=y +CONFIG_SIG_SIGWORK=4 CONFIG_STACK_COLORATION=y CONFIG_START_DAY=30 CONFIG_START_MONTH=11 @@ -313,4 +316,3 @@ CONFIG_USART6_TXBUFSIZE=1500 CONFIG_USBDEV=y CONFIG_USBDEV_BUSPOWERED=y CONFIG_USBDEV_MAXPOWER=500 -CONFIG_USEC_PER_TICK=1000 diff --git a/boards/px4/fmu-v5x/ssrc.px4board b/boards/px4/fmu-v5x/ssrc.px4board index fbeef20f68b2..597909164e87 100644 --- a/boards/px4/fmu-v5x/ssrc.px4board +++ b/boards/px4/fmu-v5x/ssrc.px4board @@ -1,24 +1,36 @@ - -# In addition to default.px4foard - CONFIG_BOARD_CRYPTO=y +CONFIG_COMMON_OSD=n CONFIG_DRIVERS_SW_CRYPTO=y CONFIG_DRIVERS_STUB_KEYSTORE=y -CONFIG_MODULES_UXRCE_DDS_CLIENT=y - -# Removed to save space - -CONFIG_COMMON_OPTICAL_FLOW=n -CONFIG_COMMON_OSD=n +CONFIG_MODULES_MICRORTPS_BRIDGE=y +CONFIG_MODULES_MICRODDS_CLIENT=y +CONFIG_EXAMPLES_FAKE_GPS=n +CONFIG_MODULES_ROVER_POS_CONTROL=n +CONFIG_MODULES_SIH=n +CONFIG_SYSTEMCMDS_NETMAN=n +CONFIG_SYSTEMCMDS_REFLECT=n +CONFIG_SYSTEMCMDS_SD_BENCH=n +CONFIG_SYSTEMCMDS_SD_STRESS=n +CONFIG_SYSTEMCMDS_SERIAL_TEST=n CONFIG_DRIVERS_CAMERA_CAPTURE=n CONFIG_DRIVERS_CAMERA_TRIGGER=n CONFIG_DRIVERS_CAMERA_FEEDBACK=n CONFIG_MODULES_PAYLOAD_DELIVERER=n CONFIG_MODULES_ROVER_POS_CONTROL=n +CONFIG_MODULES_SIH=n +CONFIG_SYSTEMCMDS_I2CDETECT=n CONFIG_SYSTEMCMDS_NETMAN=n CONFIG_SYSTEMCMDS_REFLECT=n CONFIG_SYSTEMCMDS_SD_BENCH=n CONFIG_SYSTEMCMDS_SD_STRESS=n +CONFIG_SYSTEMCMDS_SERIAL_TEST=n +CONFIG_DRIVERS_ROBOCLAW=n +CONFIG_EXAMPLES_FAKE_GPS=n +CONFIG_COMMON_OPTICAL_FLOW=n +CONFIG_DRIVERS_OSD=n +CONFIG_DRIVERS_IMU_INVENSENSE_ICM20948=n +CONFIG_DRIVERS_POWER_MONITOR_INA228=n +CONFIG_DRIVERS_POWER_MONITOR_INA238=n # Test keys to help local building # These can be overridden in CI with environment variables pointing to real keys From 6de6c0c8a60c3076e136b4838e99c418ae62e38a Mon Sep 17 00:00:00 2001 From: Jari Nippula Date: Mon, 12 Dec 2022 12:40:36 +0200 Subject: [PATCH 2/5] px4-sitl: change microxrce port values --- ROMFS/px4fmu_common/init.d-posix/rcS | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/ROMFS/px4fmu_common/init.d-posix/rcS b/ROMFS/px4fmu_common/init.d-posix/rcS index fd64860011b5..c68b8f300134 100644 --- a/ROMFS/px4fmu_common/init.d-posix/rcS +++ b/ROMFS/px4fmu_common/init.d-posix/rcS @@ -265,12 +265,9 @@ manual_control start sensors start commander start -if [ "$VEHICLE_TYPE" != "rover" ] +if ! pwm_out_sim start -m sim then - if ! pwm_out_sim start -m sim - then - tune_control play error - fi + tune_control play error fi # @@ -299,26 +296,14 @@ then else param set UXRCE_DDS_DOM_ID 0 fi -uxrce_dds_port=2020 +uxrce_dds_port=8888 if [ -n "$PX4_UXRCE_DDS_PORT" ] then # Override port if environment variable is defined uxrce_dds_port="$PX4_UXRCE_DDS_PORT" fi -uxrce_dds_local_port=2019 -if [ -n "$PX4_UXRCE_DDS_LOCAL_PORT" ] -then - # Override port if environment variable is defined - uxrce_dds_local_port="$PX4_UXRCE_DDS_LOCAL_PORT" -fi -uxrce_dds_ip="127.0.0.1" -if [ -n "$PX4_UXRCE_DDS_IP" ] -then - # Override port if environment variable is defined - uxrce_dds_ip="$PX4_UXRCE_DDS_IP" -fi -uxrce_dds_client start -t udp -h $uxrce_dds_ip -r $uxrce_dds_local_port -p $uxrce_dds_port $uxrce_dds_ns +microdds_client start -t udp -h 127.0.0.1 -r 2019 -p 2020 $microdds_ns if param greater -s MNT_MODE_IN -1 then From 3200295bcc6409f20fe2c8cf461861f16037dc52 Mon Sep 17 00:00:00 2001 From: Jari Nippula Date: Thu, 15 Dec 2022 15:06:10 +0200 Subject: [PATCH 3/5] Do not handle hil_state_quaternion --- src/modules/mavlink/mavlink_receiver.cpp | 6 +++++- .../simulation/simulator_mavlink/SimulatorMavlink.cpp | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/modules/mavlink/mavlink_receiver.cpp b/src/modules/mavlink/mavlink_receiver.cpp index f44287955d3c..3057cac5f073 100644 --- a/src/modules/mavlink/mavlink_receiver.cpp +++ b/src/modules/mavlink/mavlink_receiver.cpp @@ -334,7 +334,11 @@ MavlinkReceiver::handle_message(mavlink_message_t *msg) break; case MAVLINK_MSG_ID_HIL_STATE_QUATERNION: - handle_message_hil_state_quaternion(msg); + /* Do not handle hil_state_quaternion, + but let ekf2 to take care of position + estimation. + */ + //handle_message_hil_state_quaternion(msg); break; case MAVLINK_MSG_ID_HIL_OPTICAL_FLOW: diff --git a/src/modules/simulation/simulator_mavlink/SimulatorMavlink.cpp b/src/modules/simulation/simulator_mavlink/SimulatorMavlink.cpp index 2b8916277a4e..45c0ac7b4b47 100644 --- a/src/modules/simulation/simulator_mavlink/SimulatorMavlink.cpp +++ b/src/modules/simulation/simulator_mavlink/SimulatorMavlink.cpp @@ -372,7 +372,11 @@ void SimulatorMavlink::handle_message(const mavlink_message_t *msg) break; case MAVLINK_MSG_ID_HIL_STATE_QUATERNION: - handle_message_hil_state_quaternion(msg); + /* Do not handle hil_state_quaternion, + but let ekf2 to take care of position + estimation. + */ + //handle_message_hil_state_quaternion(msg); break; case MAVLINK_MSG_ID_RAW_RPM: From 9fab676ec18789604226e722c6cf1c235aeea9dc Mon Sep 17 00:00:00 2001 From: Jukka Laitinen Date: Tue, 3 Oct 2023 14:51:58 +0300 Subject: [PATCH 4/5] platforms/nuttx/src/*/microchip: Add bootloader version passing from bl to px4 Signed-off-by: Jukka Laitinen --- .../microchip/microchip_common/include/px4_arch/device_info.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platforms/nuttx/src/px4/microchip/microchip_common/include/px4_arch/device_info.h b/platforms/nuttx/src/px4/microchip/microchip_common/include/px4_arch/device_info.h index ee7d3782197c..8b66d12593f2 100644 --- a/platforms/nuttx/src/px4/microchip/microchip_common/include/px4_arch/device_info.h +++ b/platforms/nuttx/src/px4/microchip/microchip_common/include/px4_arch/device_info.h @@ -33,7 +33,7 @@ #pragma once -#include +#define IMAGE_NUM_TYPES 4 typedef struct __attribute__((__packed__)) { From c3464bb9afc5e087a1732e7fdc54709a48e780a1 Mon Sep 17 00:00:00 2001 From: haitomatic Date: Wed, 4 Oct 2023 07:02:20 +0000 Subject: [PATCH 5/5] rover interface:use vehicle thrust and torque setpoint instead of actuator controls --- .../rover_interface/RoverInterface.cpp | 42 +++++++++++++------ .../rover_interface/RoverInterface.hpp | 16 ++++--- 2 files changed, 41 insertions(+), 17 deletions(-) diff --git a/src/drivers/rover_interface/RoverInterface.cpp b/src/drivers/rover_interface/RoverInterface.cpp index 171e9b5c1307..8d65ea989abd 100644 --- a/src/drivers/rover_interface/RoverInterface.cpp +++ b/src/drivers/rover_interface/RoverInterface.cpp @@ -200,7 +200,7 @@ void RoverInterface::Run() ActionRequestUpdate(); // Check for actuator controls command to rover - if (!_kill_switch && _armed) { ActuatorControlsUpdate(); } + if (!_kill_switch && _armed) { VehicleTorqueAndThrustUpdate(); } // Check for vehicle control mode VehicleControlModeUpdate(); @@ -219,18 +219,35 @@ void RoverInterface::Run() } -void RoverInterface::ActuatorControlsUpdate() +void RoverInterface::VehicleTorqueAndThrustUpdate() { - if (_actuator_controls_sub.updated()) { - actuator_controls_s actuator_controls_msg; - - if (_actuator_controls_sub.copy(&actuator_controls_msg)) { - auto throttle = (_is_manual_mode ? _manual_throttle_max : _mission_throttle_max) * - actuator_controls_msg.control[actuator_controls_s::INDEX_THROTTLE]; - auto steering = actuator_controls_msg.control[actuator_controls_s::INDEX_YAW]; - _scout->SetMotionCommand(throttle, steering); + bool do_update = false; + + // Check torque setppoint update + if (_vehicle_torque_setpoint_sub.updated()) { + vehicle_torque_setpoint_s vehicle_torque_setpoint_msg; + + if (_vehicle_torque_setpoint_sub.copy(&vehicle_torque_setpoint_msg)) { + _yaw_control = vehicle_torque_setpoint_msg.xyz[2]; + do_update = true; + } + } + + // Check thrust setpoint update + if (_vehicle_thrust_setpoint_sub.updated()) { + vehicle_thrust_setpoint_s vehicle_thrust_setpoint_msg; + + if (_vehicle_thrust_setpoint_sub.copy(&vehicle_thrust_setpoint_msg)) { + _throttle_control = vehicle_thrust_setpoint_msg.xyz[0]; + do_update = true; } } + + if (do_update) { + auto throttle = (_is_manual_mode ? _manual_throttle_max : _mission_throttle_max) * _throttle_control; + auto steering = _yaw_control; + _scout->SetMotionCommand(throttle, steering); + } } @@ -340,8 +357,9 @@ void RoverInterface::print_status() PX4_INFO("Rover is armed: %s. Kill switch: %s", _armed ? "true" : "false", _kill_switch ? "true" : "false"); // Subscription info - PX4_INFO("Subscribed to topics: %s, %s", - _actuator_controls_sub.get_topic()->o_name, + PX4_INFO("Subscribed to topics: %s, %s, %s", + _vehicle_thrust_setpoint_sub.get_topic()->o_name, + _vehicle_torque_setpoint_sub.get_topic()->o_name, _actuator_armed_sub.get_topic()->o_name); // Publication info diff --git a/src/drivers/rover_interface/RoverInterface.hpp b/src/drivers/rover_interface/RoverInterface.hpp index 3fa28989627e..c55a6d4695f1 100644 --- a/src/drivers/rover_interface/RoverInterface.hpp +++ b/src/drivers/rover_interface/RoverInterface.hpp @@ -11,7 +11,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -33,7 +34,7 @@ class RoverInterface : public ModuleParams, public px4::ScheduledWorkItem static constexpr uint64_t SystemVersionQueryLimitMs{10_ms}; - static constexpr uint64_t ActuatorControlSubIntervalMs{50_ms}; + static constexpr uint64_t ControlSubIntervalMs{50_ms}; public: static const char *const CAN_IFACE; @@ -51,7 +52,7 @@ class RoverInterface : public ModuleParams, public px4::ScheduledWorkItem void Init(); void Run() override; - void ActuatorControlsUpdate(); + void VehicleTorqueAndThrustUpdate(); void ActuatorArmedUpdate(); void ActionRequestUpdate(); void VehicleControlModeUpdate(); @@ -82,6 +83,10 @@ class RoverInterface : public ModuleParams, public px4::ScheduledWorkItem float _mission_throttle_max; + float _throttle_control; + + float _yaw_control; + scoutsdk::ProtocolVersion _protocol_version{scoutsdk::ProtocolVersion::AGX_V2}; const char *_can_iface{nullptr}; @@ -89,8 +94,9 @@ class RoverInterface : public ModuleParams, public px4::ScheduledWorkItem scoutsdk::ScoutRobot *_scout{nullptr}; // Subscription - uORB::SubscriptionInterval _actuator_controls_sub{ORB_ID(actuator_controls_0), ActuatorControlSubIntervalMs}; - uORB::SubscriptionInterval _actuator_armed_sub{ORB_ID(actuator_armed)}; + uORB::SubscriptionInterval _vehicle_thrust_setpoint_sub{ORB_ID(vehicle_thrust_setpoint), ControlSubIntervalMs}; + uORB::SubscriptionInterval _vehicle_torque_setpoint_sub{ORB_ID(vehicle_torque_setpoint), ControlSubIntervalMs}; + uORB::Subscription _actuator_armed_sub{ORB_ID(actuator_armed)}; uORB::Subscription _action_request_sub{ORB_ID(action_request)}; uORB::Subscription _vehicle_control_mode_sub{ORB_ID(vehicle_control_mode)};