diff --git a/boards/modalai/voxl2/default.px4board b/boards/modalai/voxl2/default.px4board index c4ed856574..5e26fb2fc7 100644 --- a/boards/modalai/voxl2/default.px4board +++ b/boards/modalai/voxl2/default.px4board @@ -3,3 +3,4 @@ CONFIG_BOARD_LINUX=y CONFIG_BOARD_TOOLCHAIN="aarch64-linux-gnu" CONFIG_MODULES_MUORB_APPS=y CONFIG_SYSTEMCMDS_PERF=y +CONFIG_SYSTEMCMDS_UORB=y diff --git a/boards/modalai/voxl2/qurt.px4board b/boards/modalai/voxl2/qurt.px4board index d1f4ebc048..ccbefb55e1 100644 --- a/boards/modalai/voxl2/qurt.px4board +++ b/boards/modalai/voxl2/qurt.px4board @@ -1,3 +1,4 @@ CONFIG_PLATFORM_QURT=y CONFIG_BOARD_TOOLCHAIN="qurt" CONFIG_MODULES_MUORB_SLPI=y +CONFIG_SYSTEMCMDS_UORB=y diff --git a/cmake/px4_add_module.cmake b/cmake/px4_add_module.cmake index 5c0ee1153d..1722641734 100644 --- a/cmake/px4_add_module.cmake +++ b/cmake/px4_add_module.cmake @@ -170,6 +170,9 @@ function(px4_add_module) if (${PX4_PLATFORM} STREQUAL "nuttx" AND NOT CONFIG_BUILD_FLAT AND KERNEL) target_link_libraries(${MODULE} PRIVATE kernel_parameters_interface px4_kernel_layer uORB_kernel) set_property(GLOBAL APPEND PROPERTY PX4_KERNEL_MODULE_LIBRARIES ${MODULE}) + elseif(${PX4_PLATFORM} STREQUAL "qurt") + target_link_libraries(${MODULE} PRIVATE px4_layer uORB) + set_property(GLOBAL APPEND PROPERTY PX4_MODULE_LIBRARIES ${MODULE}) else() target_link_libraries(${MODULE} PRIVATE parameters_interface px4_layer uORB) set_property(GLOBAL APPEND PROPERTY PX4_MODULE_LIBRARIES ${MODULE}) diff --git a/platforms/common/CMakeLists.txt b/platforms/common/CMakeLists.txt index 892ee1a0d4..a58e732ea5 100644 --- a/platforms/common/CMakeLists.txt +++ b/platforms/common/CMakeLists.txt @@ -33,7 +33,7 @@ set(SRCS) -if(NOT "${PX4_BOARD}" MATCHES "io-v2" AND NOT "${PX4_BOARD_LABEL}" MATCHES "bootloader") +if(NOT "${PX4_PLATFORM}" MATCHES "qurt" AND NOT "${PX4_BOARD}" MATCHES "io-v2" AND NOT "${PX4_BOARD_LABEL}" MATCHES "bootloader") list(APPEND SRCS px4_log.cpp px4_log_history.cpp diff --git a/platforms/common/include/px4_platform_common/log.h b/platforms/common/include/px4_platform_common/log.h index 7eacbd844e..529794576f 100644 --- a/platforms/common/include/px4_platform_common/log.h +++ b/platforms/common/include/px4_platform_common/log.h @@ -67,6 +67,7 @@ __END_DECLS #if defined(__PX4_QURT) #include "qurt_log.h" +#include /**************************************************************************** * Messages that should never be filtered or compiled out ****************************************************************************/ diff --git a/platforms/qurt/CMakeLists.txt b/platforms/qurt/CMakeLists.txt index 6cee634102..1c7e2bc869 100644 --- a/platforms/qurt/CMakeLists.txt +++ b/platforms/qurt/CMakeLists.txt @@ -31,12 +31,13 @@ # ############################################################################ -set(module_libraries modules__muorb__slpi) +get_property(module_libraries GLOBAL PROPERTY PX4_MODULE_LIBRARIES) QURT_LIB(LIB_NAME px4 SOURCES ${PX4_SOURCE_DIR}/platforms/qurt/unresolved_symbols.c LINK_LIBS + modules__muorb__slpi ${module_libraries} px4_layer ) diff --git a/platforms/qurt/include/qurt_reqs.h b/platforms/qurt/include/qurt_reqs.h index a3f6989b17..8ff3ce52c4 100644 --- a/platforms/qurt/include/qurt_reqs.h +++ b/platforms/qurt/include/qurt_reqs.h @@ -36,13 +36,13 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif +#include +#include + +__BEGIN_DECLS typedef unsigned long useconds_t; int usleep(useconds_t usec); +int pthread_setname_np(pthread_t __target_thread, const char *__name); -#ifdef __cplusplus -} -#endif +__END_DECLS diff --git a/platforms/qurt/src/px4/CMakeLists.txt b/platforms/qurt/src/px4/CMakeLists.txt index 020a44bfec..d2f19d4917 100644 --- a/platforms/qurt/src/px4/CMakeLists.txt +++ b/platforms/qurt/src/px4/CMakeLists.txt @@ -35,6 +35,7 @@ set(QURT_LAYER_SRCS drv_hrt.cpp tasks.cpp + px4_qurt_impl.cpp ) add_library(px4_layer diff --git a/platforms/qurt/src/px4/px4_qurt_impl.cpp b/platforms/qurt/src/px4/px4_qurt_impl.cpp new file mode 100644 index 0000000000..6feb754dec --- /dev/null +++ b/platforms/qurt/src/px4/px4_qurt_impl.cpp @@ -0,0 +1,39 @@ +/**************************************************************************** + * + * Copyright (C) 2022 ModalAI, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name PX4 nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ +#include + +__BEGIN_DECLS + +long PX4_TICKS_PER_SEC = 1000L; + +__END_DECLS