diff --git a/.gitmodules b/.gitmodules index fa1ddcbee2..bca504f69e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -49,11 +49,11 @@ [submodule "platforms/nuttx/NuttX/nuttx"] path = platforms/nuttx/NuttX/nuttx url = https://github.com/PX4/NuttX.git - branch = px4_firmware_nuttx-7.28+ + branch = px4_firmware_nuttx-7.29+ [submodule "platforms/nuttx/NuttX/apps"] path = platforms/nuttx/NuttX/apps url = https://github.com/PX4/NuttX-apps.git - branch = px4_firmware_nuttx-7.28+ + branch = px4_firmware_nuttx-7.29+ [submodule "cmake/configs/uavcan_board_ident"] path = cmake/configs/uavcan_board_ident url = https://github.com/PX4/uavcan_board_ident.git diff --git a/CMakeLists.txt b/CMakeLists.txt index ee42c30777..8ee7b3bb27 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -266,7 +266,7 @@ set(package-contact "px4users@googlegroups.com") set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_C_STANDARD 99) +set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD_REQUIRED ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) diff --git a/boards/av/x-v1/default.cmake b/boards/av/x-v1/default.cmake index 2001879335..97f01f9338 100644 --- a/boards/av/x-v1/default.cmake +++ b/boards/av/x-v1/default.cmake @@ -84,7 +84,7 @@ px4_add_board( wind_estimator SYSTEMCMDS - bl_update + #bl_update config dmesg dumpfile diff --git a/boards/av/x-v1/nuttx-config/nsh/defconfig b/boards/av/x-v1/nuttx-config/nsh/defconfig index 9e472351c8..83fc645d4a 100644 --- a/boards/av/x-v1/nuttx-config/nsh/defconfig +++ b/boards/av/x-v1/nuttx-config/nsh/defconfig @@ -1,3 +1,10 @@ +# +# This file is autogenerated: PLEASE DO NOT EDIT IT. +# +# You can use "make menuconfig" to make any modifications to the installed .config file. +# You can then do "make savedefconfig" to generate a new defconfig file that includes your +# modifications. +# # CONFIG_DISABLE_OS_API is not set # CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set # CONFIG_FS_PROCFS_EXCLUDE_ENVIRON is not set @@ -50,7 +57,7 @@ CONFIG_ARMV7M_USEBASEPRI=y CONFIG_BOARDCTL_FINALINIT=y CONFIG_BOARDCTL_RESET=y CONFIG_BOARD_CRASHDUMP=y -CONFIG_BOARD_LOOPSPERMSEC=43103 +CONFIG_BOARD_LOOPSPERMSEC=22114 CONFIG_BOARD_RESET_ON_ASSERT=2 CONFIG_BUILTIN=y CONFIG_C99_BOOL8=y @@ -73,7 +80,10 @@ 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_EXCLUDE_BLOCKS=y +CONFIG_FS_PROCFS_EXCLUDE_MOUNT=y +CONFIG_FS_PROCFS_EXCLUDE_MOUNTS=y +CONFIG_FS_PROCFS_EXCLUDE_USAGE=y CONFIG_FS_PROCFS_REGISTER=y CONFIG_FS_ROMFS=y CONFIG_GRAN=y @@ -105,7 +115,6 @@ CONFIG_NETUTILS_TELNETD=y CONFIG_NET_ARP_IPIN=y CONFIG_NET_ARP_SEND=y CONFIG_NET_BROADCAST=y -CONFIG_NET_HOSTNAME="px4" CONFIG_NET_ICMP=y CONFIG_NET_ROUTE=y CONFIG_NET_SOCKOPTS=y @@ -124,14 +133,11 @@ CONFIG_NSH_BUILTIN_APPS=y CONFIG_NSH_CMDPARMS=y CONFIG_NSH_CROMFSETC=y CONFIG_NSH_DISABLE_PSSTACKUSAGE=y -CONFIG_NSH_DRIPADDR=0xc0a85601 -CONFIG_NSH_IPADDR=0xc0a8560c CONFIG_NSH_LINELEN=128 CONFIG_NSH_LOGIN_PASSWORD="px4" CONFIG_NSH_LOGIN_USERNAME="px4" CONFIG_NSH_MAXARGUMENTS=12 CONFIG_NSH_NESTDEPTH=8 -CONFIG_NSH_NETINIT_THREAD=y CONFIG_NSH_QUOTE=y CONFIG_NSH_ROMFSETC=y CONFIG_NSH_ROMFSSECTSIZE=128 @@ -146,7 +152,7 @@ CONFIG_PREALLOC_WDOGS=50 CONFIG_PRIORITY_INHERITANCE=y CONFIG_PTHREAD_MUTEX_ROBUST=y CONFIG_PTHREAD_STACK_MIN=512 -CONFIG_RAM_SIZE=376832 +CONFIG_RAM_SIZE=245760 CONFIG_RAM_START=0x20010000 CONFIG_RAW_BINARY=y CONFIG_RTC_DATETIME=y diff --git a/boards/omnibus/f4sd/nuttx-config/nsh/defconfig b/boards/omnibus/f4sd/nuttx-config/nsh/defconfig index 25def0f8cd..26bfdaec37 100644 --- a/boards/omnibus/f4sd/nuttx-config/nsh/defconfig +++ b/boards/omnibus/f4sd/nuttx-config/nsh/defconfig @@ -1,3 +1,10 @@ +# +# This file is autogenerated: PLEASE DO NOT EDIT IT. +# +# You can use "make menuconfig" to make any modifications to the installed .config file. +# You can then do "make savedefconfig" to generate a new defconfig file that includes your +# modifications. +# # CONFIG_DEV_CONSOLE is not set # CONFIG_DISABLE_OS_API is not set # CONFIG_MMCSD_HAVE_CARDDETECT is not set diff --git a/boards/px4/fmu-v2/nuttx-config/nsh/defconfig b/boards/px4/fmu-v2/nuttx-config/nsh/defconfig index 8a51a5a869..ef97a53e5c 100644 --- a/boards/px4/fmu-v2/nuttx-config/nsh/defconfig +++ b/boards/px4/fmu-v2/nuttx-config/nsh/defconfig @@ -1,3 +1,10 @@ +# +# This file is autogenerated: PLEASE DO NOT EDIT IT. +# +# You can use "make menuconfig" to make any modifications to the installed .config file. +# You can then do "make savedefconfig" to generate a new defconfig file that includes your +# modifications. +# # CONFIG_DISABLE_OS_API is not set # CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set # CONFIG_MMCSD_HAVE_CARDDETECT is not set diff --git a/boards/px4/fmu-v3/nuttx-config/nsh/defconfig b/boards/px4/fmu-v3/nuttx-config/nsh/defconfig index 8a51a5a869..ef97a53e5c 100644 --- a/boards/px4/fmu-v3/nuttx-config/nsh/defconfig +++ b/boards/px4/fmu-v3/nuttx-config/nsh/defconfig @@ -1,3 +1,10 @@ +# +# This file is autogenerated: PLEASE DO NOT EDIT IT. +# +# You can use "make menuconfig" to make any modifications to the installed .config file. +# You can then do "make savedefconfig" to generate a new defconfig file that includes your +# modifications. +# # CONFIG_DISABLE_OS_API is not set # CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set # CONFIG_MMCSD_HAVE_CARDDETECT is not set diff --git a/boards/px4/fmu-v4/nuttx-config/nsh/defconfig b/boards/px4/fmu-v4/nuttx-config/nsh/defconfig index e38ad60ec5..10f1921d1e 100644 --- a/boards/px4/fmu-v4/nuttx-config/nsh/defconfig +++ b/boards/px4/fmu-v4/nuttx-config/nsh/defconfig @@ -1,3 +1,10 @@ +# +# This file is autogenerated: PLEASE DO NOT EDIT IT. +# +# You can use "make menuconfig" to make any modifications to the installed .config file. +# You can then do "make savedefconfig" to generate a new defconfig file that includes your +# modifications. +# # CONFIG_DISABLE_OS_API is not set # CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set # CONFIG_MMCSD_HAVE_CARDDETECT is not set diff --git a/boards/px4/fmu-v4pro/nuttx-config/nsh/defconfig b/boards/px4/fmu-v4pro/nuttx-config/nsh/defconfig index 4d91198259..aae494d2e7 100644 --- a/boards/px4/fmu-v4pro/nuttx-config/nsh/defconfig +++ b/boards/px4/fmu-v4pro/nuttx-config/nsh/defconfig @@ -1,3 +1,10 @@ +# +# This file is autogenerated: PLEASE DO NOT EDIT IT. +# +# You can use "make menuconfig" to make any modifications to the installed .config file. +# You can then do "make savedefconfig" to generate a new defconfig file that includes your +# modifications. +# # CONFIG_DISABLE_OS_API is not set # CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set # CONFIG_MMCSD_HAVE_CARDDETECT is not set diff --git a/boards/px4/fmu-v5/nuttx-config/nsh/defconfig b/boards/px4/fmu-v5/nuttx-config/nsh/defconfig index d9012eac45..34ffeb5511 100644 --- a/boards/px4/fmu-v5/nuttx-config/nsh/defconfig +++ b/boards/px4/fmu-v5/nuttx-config/nsh/defconfig @@ -1,3 +1,10 @@ +# +# This file is autogenerated: PLEASE DO NOT EDIT IT. +# +# You can use "make menuconfig" to make any modifications to the installed .config file. +# You can then do "make savedefconfig" to generate a new defconfig file that includes your +# modifications. +# # CONFIG_DISABLE_OS_API is not set # CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set # CONFIG_MMCSD_HAVE_CARDDETECT is not set diff --git a/boards/px4/fmu-v5x/nuttx-config/nsh/defconfig b/boards/px4/fmu-v5x/nuttx-config/nsh/defconfig index 7bb7fd138b..9e24d5f27a 100644 --- a/boards/px4/fmu-v5x/nuttx-config/nsh/defconfig +++ b/boards/px4/fmu-v5x/nuttx-config/nsh/defconfig @@ -1,3 +1,10 @@ +# +# This file is autogenerated: PLEASE DO NOT EDIT IT. +# +# You can use "make menuconfig" to make any modifications to the installed .config file. +# You can then do "make savedefconfig" to generate a new defconfig file that includes your +# modifications. +# # CONFIG_DISABLE_OS_API is not set # CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set # CONFIG_MMCSD_HAVE_CARDDETECT is not set @@ -143,7 +150,6 @@ CONFIG_SCHED_LPWORKPRIORITY=50 CONFIG_SCHED_LPWORKSTACKSIZE=1800 CONFIG_SCHED_WAITPID=y CONFIG_SDCLONE_DISABLE=y -CONFIG_SDMMC1_SDIO_MODE=y CONFIG_SEM_NNESTPRIO=8 CONFIG_SEM_PREALLOCHOLDERS=0 CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS=y @@ -222,8 +228,8 @@ CONFIG_UART7_RXDMA=y CONFIG_UART7_TXBUFSIZE=3000 CONFIG_UART8_BAUD=57600 CONFIG_UART8_RXBUFSIZE=600 -CONFIG_UART8_TXBUFSIZE=1500 CONFIG_UART8_RXDMA=y +CONFIG_UART8_TXBUFSIZE=1500 CONFIG_USART1_BAUD=57600 CONFIG_USART1_RXBUFSIZE=600 CONFIG_USART1_TXBUFSIZE=1500 @@ -232,9 +238,9 @@ CONFIG_USART2_IFLOWCONTROL=y CONFIG_USART2_OFLOWCONTROL=y CONFIG_USART2_RXBUFSIZE=600 CONFIG_USART2_TXBUFSIZE=3000 -CONFIG_USART3_SERIAL_CONSOLE=y CONFIG_USART3_BAUD=57600 CONFIG_USART3_RXBUFSIZE=180 +CONFIG_USART3_SERIAL_CONSOLE=y CONFIG_USART3_TXBUFSIZE=1500 CONFIG_USART6_BAUD=57600 CONFIG_USART6_RXBUFSIZE=600 diff --git a/boards/px4/io-v2/nuttx-config/nsh/defconfig b/boards/px4/io-v2/nuttx-config/nsh/defconfig index fbd8f22744..bb71ca56ff 100644 --- a/boards/px4/io-v2/nuttx-config/nsh/defconfig +++ b/boards/px4/io-v2/nuttx-config/nsh/defconfig @@ -1,3 +1,10 @@ +# +# This file is autogenerated: PLEASE DO NOT EDIT IT. +# +# You can use "make menuconfig" to make any modifications to the installed .config file. +# You can then do "make savedefconfig" to generate a new defconfig file that includes your +# modifications. +# # CONFIG_DEV_NULL is not set CONFIG_ARCH="arm" CONFIG_ARCH_BOARD_CUSTOM_DIR="../nuttx-config" diff --git a/platforms/nuttx/NuttX/Make.defs.in b/platforms/nuttx/NuttX/Make.defs.in index 0212ec6cd0..a76fd4d1b6 100644 --- a/platforms/nuttx/NuttX/Make.defs.in +++ b/platforms/nuttx/NuttX/Make.defs.in @@ -89,7 +89,7 @@ ifeq ($(CONFIG_ARMV7M_STACKCHECK),y) endif CFLAGS = $(ARCHINCLUDES) \ - -std=gnu99 \ + -std=gnu11 \ ${CMAKE_C_FLAGS} \ $(FLAGS) \ -Wno-bad-function-cast \ diff --git a/platforms/nuttx/NuttX/apps b/platforms/nuttx/NuttX/apps index 7db2a352fb..13eeff0ec3 160000 --- a/platforms/nuttx/NuttX/apps +++ b/platforms/nuttx/NuttX/apps @@ -1 +1 @@ -Subproject commit 7db2a352fb19438bb966e419c61e55092056d385 +Subproject commit 13eeff0ec3f23d84fabf1e9fe216846957ad15cf diff --git a/platforms/nuttx/NuttX/nuttx b/platforms/nuttx/NuttX/nuttx index 423371c7d4..b3a14ceb4e 160000 --- a/platforms/nuttx/NuttX/nuttx +++ b/platforms/nuttx/NuttX/nuttx @@ -1 +1 @@ -Subproject commit 423371c7d4012e725ac4ca51323a18df64e581b3 +Subproject commit b3a14ceb4e595f413e0fb2a66bfbad0373a8e20a diff --git a/platforms/nuttx/cmake/px4_impl_os.cmake b/platforms/nuttx/cmake/px4_impl_os.cmake index 11955e09cc..3c9b27ef58 100644 --- a/platforms/nuttx/cmake/px4_impl_os.cmake +++ b/platforms/nuttx/cmake/px4_impl_os.cmake @@ -66,9 +66,6 @@ function(px4_os_add_flags) ${PX4_BINARY_DIR}/NuttX/apps/include ) - # NuttX's disables inline below C99 (comiler.h), but __STDC_VERSION__ isn't set for C++ - add_compile_options($<$:-D__STDC_VERSION__=199901L>) - # prevent using the toolchain's std c++ library add_compile_options($<$:-nostdinc++>) diff --git a/src/drivers/boards/common/board_dcache_control.c b/src/drivers/boards/common/board_dcache_control.c index 2337a41fa8..c7b4644a9d 100644 --- a/src/drivers/boards/common/board_dcache_control.c +++ b/src/drivers/boards/common/board_dcache_control.c @@ -43,7 +43,7 @@ #include #include "nvic.h" -#include "cache.h" +#include #include "up_arch.h" #include @@ -93,7 +93,7 @@ void board_configure_dcache(int stage) /* On boot we should default to disabled on effected HW */ if (erratta && stage == 0) { - arch_disable_dcache(); + up_disable_dcache(); return; } @@ -106,15 +106,15 @@ void board_configure_dcache(int stage) switch (dcache) { default: case 0: - erratta ? arch_disable_dcache() : arch_enable_dcache(); + erratta ? up_disable_dcache() : up_enable_dcache(); break; case 1: - arch_disable_dcache(); + up_disable_dcache(); break; case 2: - arch_enable_dcache(); + up_enable_dcache(); break; return; } @@ -157,11 +157,11 @@ int board_dcache_info(int action, char **pmesg, bool *pstate) } if (action == 0) { - arch_disable_dcache(); + up_disable_dcache(); } if (action == 1) { - arch_enable_dcache(); + up_enable_dcache(); } if (pmesg) { diff --git a/src/drivers/px4io/px4io_serial_f7.cpp b/src/drivers/px4io/px4io_serial_f7.cpp index 3ad7be7418..c631dbbed3 100644 --- a/src/drivers/px4io/px4io_serial_f7.cpp +++ b/src/drivers/px4io/px4io_serial_f7.cpp @@ -42,7 +42,7 @@ #ifdef PX4IO_INTERFACE_F7 #include "stm32_uart.h" -#include "cache.h" +#include /* serial register accessors */ #define REG(_x) (*(volatile uint32_t *)(PX4IO_SERIAL_BASE + (_x))) @@ -288,8 +288,8 @@ PX4IO_serial_f7::_bus_exchange(IOPacket *_packet) stm32_dmastart(_rx_dma, _dma_callback, this, false); /* Clean _current_packet, so DMA can see the data */ - arch_clean_dcache((uintptr_t)_current_packet, - (uintptr_t)_current_packet + ALIGNED_IO_BUFFER_SIZE); + up_clean_dcache((uintptr_t)_current_packet, + (uintptr_t)_current_packet + ALIGNED_IO_BUFFER_SIZE); /* start TX DMA - no callback if we also expect a reply */ /* DMA setup time ~3µs */ @@ -458,8 +458,8 @@ PX4IO_serial_f7::_do_interrupt() /* if there is DMA reception going on, this is a short packet */ if (_rx_dma_status == _dma_status_waiting) { /* Invalidate _current_packet, so we get fresh data from RAM */ - arch_invalidate_dcache((uintptr_t)_current_packet, - (uintptr_t)_current_packet + ALIGNED_IO_BUFFER_SIZE); + up_invalidate_dcache((uintptr_t)_current_packet, + (uintptr_t)_current_packet + ALIGNED_IO_BUFFER_SIZE); /* verify that the received packet is complete */ size_t length = sizeof(*_current_packet) - stm32_dmaresidual(_rx_dma); diff --git a/src/drivers/stm32/armv7-m_dcache/armv7-m_dcache.cpp b/src/drivers/stm32/armv7-m_dcache/armv7-m_dcache.cpp index 37f800c7a6..a16a8ca843 100644 --- a/src/drivers/stm32/armv7-m_dcache/armv7-m_dcache.cpp +++ b/src/drivers/stm32/armv7-m_dcache/armv7-m_dcache.cpp @@ -46,7 +46,7 @@ #include -#include "cache.h" +#include #if defined(CONFIG_ARMV7M_DCACHE) && defined(CONFIG_ARMV7M_DCACHE_WRITETHROUGH) diff --git a/src/lib/systemlib/print_load_nuttx.c b/src/lib/systemlib/print_load_nuttx.c index e0a91cbc0d..06664b937e 100644 --- a/src/lib/systemlib/print_load_nuttx.c +++ b/src/lib/systemlib/print_load_nuttx.c @@ -147,7 +147,7 @@ void print_load_buffer(uint64_t t, char *buffer, int buffer_length, print_load_c print_state->interval_time_ms_inv = 1.f / ((float)((print_state->new_time - print_state->interval_start_time) / 1000)); /* header for task list */ - snprintf(buffer, buffer_length, "%4s %*-s %8s %6s %11s %10s %-5s %2s", + snprintf(buffer, buffer_length, "%4s %-*s %8s %6s %11s %10s %-5s %2s", "PID", CONFIG_TASK_NAME_SIZE, "COMMAND", "CPU(ms)", @@ -282,7 +282,7 @@ void print_load_buffer(uint64_t t, char *buffer, int buffer_length, print_load_c } // print output - int print_len = snprintf(buffer, buffer_length, "%4d %*-s %8d %2d.%03d %5u/%5u %3u (%3u) ", + int print_len = snprintf(buffer, buffer_length, "%4d %-*s %8d %2d.%03d %5u/%5u %3u (%3u) ", tcb_pid, CONFIG_TASK_NAME_SIZE, tcb_name, total_runtime[i],