执行dji_sdk_demo_linux报错register osal handler error

Completed

Comments

31 comments

  • DJI Developer Support
    请提供报错的完整日志信息进行排查。
    0
    Comment actions Permalink
  • lss

    请问如何查看报错的完整日志信息

    0
    Comment actions Permalink
  • lss

    目前,dji_sdk_demo_linux运行报错,应用绑定不成功(DJI Assistant 2 还无法绑定负载,无法获取负载信息)的状态下可以导出报错日志吗?

     

    0
    Comment actions Permalink
  • DJI Developer Support
    可以在同级目录下的Logs目录查看日志。
    0
    Comment actions Permalink
  • lss

    同级目录无logs目录,只有dji_sdk_demo_linux

     

    0
    Comment actions Permalink
  • DJI Developer Support
    麻烦把终端进行截图,将终端中的日志打印出来
    0
    Comment actions Permalink
  • lss

     

    0
    Comment actions Permalink
  • DJI Developer Support
    早期版本有一些兼容性的问题,麻烦使用最新版本的PSDK示例代码进行重试。
    0
    Comment actions Permalink
  • lss

    使用最新版PSDK-master,make时报错:

    /usr/bin/ld: CMakeFiles/dji_sdk_demo_linux.dir/__/__/__/module_sample/camera_manager/test_camera_manager.c.o: in function `DjiTest_CameraManagerRunSample':
    test_camera_manager.c:(.text+0x3a20): undefined reference to `DjiCameraManager_ResetCameraSettings'
    collect2: error: ld returned 1 exit status

    0
    Comment actions Permalink
  • DJI Developer Support
    请使用以下链接中的PSDK示例代码进行测试: https://pan-sec.djicorp.com/s/BAPSZfobtgWkJd7 dji123
    0
    Comment actions Permalink
  • lss

    编译报错:error: ‘T_DjiHalUsbBulkDeviceInfo’ has no member named ‘bulkChannelNum’
      184 |     deviceInfo->bulkChannelNum = 2;

    硬件连接接口:无人机连接x_port连接负载,无usb接口。

    0
    Comment actions Permalink
  • DJI Developer Support
    可以说明这个问题是怎么出现的吗?使用的编译命令是什么?
    0
    Comment actions Permalink
  • lss

    这个问题是make的时候出错的。编译命令是make,在传cmakelist.txt文件里做了如下更改:

    0
    Comment actions Permalink
  • lss
    ## "uname -m" to auto distinguish Manifold2-G or Manifold2-C
    execute_process(COMMAND uname -m
    OUTPUT_VARIABLE DEVICE_SYSTEM_ID)
    if (DEVICE_SYSTEM_ID MATCHES x86_64)
    set(TOOLCHAIN_NAME x86_64-linux-gnu-gcc)
    add_definitions(-DPLATFORM_ARCH_x86_64=1)
    elseif (DEVICE_SYSTEM_ID MATCHES aarch64)
    set(TOOLCHAIN_NAME aarch64-linux-gnu-gcc)
    add_definitions(-DPLATFORM_ARCH_aarch64=1)
     
    ##树莓派命令行 unmade -m armv6l
    elseif (DEVICE_SYSTEM_ID MATCHES armv6l)
    set(TOOLCHAIN_NAME arm-linux-gnueabihf-gcc)
    ## add_definitions(-DPLATFORM_ARCH_x86_64=1)
     
    else ()
    message(FATAL_ERROR "FATAL: Please confirm your platform.")
    endif ()
     
    0
    Comment actions Permalink
  • DJI Developer Support
    我们已将您的问题提交给研发同事排查。
    0
    Comment actions Permalink
  • DJI Developer Support
    能上传修改的cmakelist.txt吗?目前做出附件所示的修改,编译是没有问题的。
    0
    Comment actions Permalink
  • lss

    cmake文件无其他更改内容

    0
    Comment actions Permalink
  • lss

    根目录下的cmakelist.txt

        set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
        set(CMAKE_ASM_COMPILER arm-none-eabi-gcc)
        set(CMAKE_AR arm-none-eabi-ar)
        set(CMAKE_OBJCOPY arm-none-eabi-objcopy)
        set(CMAKE_OBJDUMP arm-none-eabi-objdump)
        set(SIZE arm-none-eabi-size)
        set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
    endif ()
     
    project(entry)
     
    # Disable in-source builds to prevent source tree corruption.
    if (" ${CMAKE_SOURCE_DIR}" STREQUAL " ${CMAKE_BINARY_DIR}")
        message(FATAL_ERROR "FATAL: In-source builds are not allowed.
           You should create a separate directory for build files.")
    endif ()
     
    if (USE_SYSTEM_ARCH MATCHES LINUX)
        add_definitions(-DSYSTEM_ARCH_LINUX)
        add_subdirectory(samples/sample_c/platform/linux/manifold2)
    #    add_subdirectory(samples/sample_c++/platform/linux/manifold2)
        
        execute_process(COMMAND uname -m OUTPUT_VARIABLE DEVICE_SYSTEM_ID)
        if (DEVICE_SYSTEM_ID MATCHES x86_64)
            set(LIBRARY_PATH psdk_lib/lib/x86_64-linux-gnu-gcc)
        elseif (DEVICE_SYSTEM_ID MATCHES aarch64)
            set(LIBRARY_PATH psdk_lib/lib/aarch64-linux-gnu-gcc)
    elseif (DEVICE_SYSTEM_ID MATCHES armv6l)
            set(LIBRARY_PATH psdk_lib/lib/arm-linux-gnueabihf-gcc)
        else ()
            message(FATAL_ERROR "FATAL: Please confirm your platform.")
        endif ()
     
        install(FILES ${LIBRARY_PATH}/libpayloadsdk.a
                DESTINATION "${CMAKE_INSTALL_PREFIX}/lib"
                )
     
        install(DIRECTORY psdk_lib/include
                DESTINATION "${CMAKE_INSTALL_PREFIX}"
                )
    elseif (USE_SYSTEM_ARCH MATCHES RTOS)
        add_definitions(-DSYSTEM_ARCH_RTOS)
        add_subdirectory(samples/sample_c/platform/rtos_freertos/stm32f4_discovery/project/armgcc)
    endif ()
     
    add_custom_target(${PROJECT_NAME} ALL)
    0
    Comment actions Permalink
  • lss

    内cmakelist.txt文件

    cmake_minimum_required(VERSION 3.5)
    project(dji_sdk_demo_linux C)

    set(CMAKE_C_FLAGS "-pthread -std=gnu99")
    set(CMAKE_CXX_FLAGS "-std=c++11 -pthread")
    set(CMAKE_EXE_LINKER_FLAGS "-pthread")
    set(CMAKE_C_COMPILER "gcc")
    set(CMAKE_CXX_COMPILER "g++")
    add_definitions(-D_GNU_SOURCE)

    if (NOT USE_SYSTEM_ARCH)
        add_definitions(-DSYSTEM_ARCH_LINUX)
    endif ()

    if (BUILD_TEST_CASES_ON MATCHES TRUE)
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
        set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage -lgcov")
    endif ()

    set(PACKAGE_NAME payloadsdk)

    ## "uname -m" to auto distinguish Manifold2-G or Manifold2-C
    execute_process(COMMAND uname -m
            OUTPUT_VARIABLE DEVICE_SYSTEM_ID)

    if (DEVICE_SYSTEM_ID MATCHES x86_64)
        set(TOOLCHAIN_NAME x86_64-linux-gnu-gcc)
        add_definitions(-DPLATFORM_ARCH_x86_64=1)
    elseif (DEVICE_SYSTEM_ID MATCHES aarch64)
        set(TOOLCHAIN_NAME aarch64-linux-gnu-gcc)
        add_definitions(-DPLATFORM_ARCH_aarch64=1)
    elseif (DEVICE_SYSTEM_ID MATCHES armv6l)
        set(TOOLCHAIN_NAME arm-linux-gnueabihf-gcc)
        add_definitions(-DPLATFORM_ARCH_armv6l=1)
    else ()
        message(FATAL_ERROR "FATAL: Please confirm your platform.")
    endif ()

    file(GLOB_RECURSE MODULE_COMMON_SRC ../common/*.c)
    file(GLOB_RECURSE MODULE_HAL_SRC hal/*.c)
    file(GLOB_RECURSE MODULE_APP_SRC application/*.c)
    file(GLOB_RECURSE MODULE_SAMPLE_SRC ../../../module_sample/*.c)

    include_directories(../../../module_sample)
    include_directories(../common)
    include_directories(../manifold2/application)

    include_directories(../../../../../psdk_lib/include)
    link_directories(../../../../../psdk_lib/lib/${TOOLCHAIN_NAME})
    link_libraries(${CMAKE_CURRENT_LIST_DIR}/../../../../../psdk_lib/lib/${TOOLCHAIN_NAME}/lib${PACKAGE_NAME}.a)

    if (NOT EXECUTABLE_OUTPUT_PATH)
        set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
    endif ()

    add_executable(${PROJECT_NAME}
            ${MODULE_APP_SRC}
            ${MODULE_SAMPLE_SRC}
            ${MODULE_COMMON_SRC}
            ${MODULE_HAL_SRC})

    set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../common/3rdparty)
    find_package(OPUS REQUIRED)
    if (OPUS_FOUND)
        message(STATUS "Found OPUS installed in the system")
        message(STATUS " - Includes: ${OPUS_INCLUDE_DIR}")
        message(STATUS " - Libraries: ${OPUS_LIBRARY}")

        add_definitions(-DOPUS_INSTALLED)
        target_link_libraries(${PROJECT_NAME} /usr/local/lib/libopus.a)
    else ()
        message(STATUS "Cannot Find OPUS")
    endif (OPUS_FOUND)

    find_package(LIBUSB REQUIRED)
    if (LIBUSB_FOUND)
        message(STATUS "Found LIBUSB installed in the system")
        message(STATUS " - Includes: ${LIBUSB_INCLUDE_DIR}")
        message(STATUS " - Libraries: ${LIBUSB_LIBRARY}")

        add_definitions(-DLIBUSB_INSTALLED)
        target_link_libraries(${PROJECT_NAME} usb-1.0)
    else ()
        message(STATUS "Cannot Find LIBUSB")
    endif (LIBUSB_FOUND)

    target_link_libraries(${PROJECT_NAME} m)

    add_custom_command(TARGET ${PROJECT_NAME}
            PRE_LINK COMMAND cmake ..
            WORKING_DIRECTORY ${CMAKE_BINARY_DIR})

     

    0
    Comment actions Permalink
  • DJI Developer Support
    我们会尽快排查
    0
    Comment actions Permalink
  • DJI Developer Support
    可以使用我们提供的cmake文件试一下编译是否正常。
    0
    Comment actions Permalink
  • lss

    用psdk3.6版本的cmake直接编译报错:Please confirm your platform。

    0
    Comment actions Permalink
  • DJI Developer Support
    能上传您编译报错的截图吗?
    0
    Comment actions Permalink
  • lss

    第一,暂时无发提供截图。执行cmake ..命令,报错Please confirm your platform。
    第二,更改cmakelist.txt文件后,cmake未报错,具体改动如下所示:
    ## "uname -m" to auto distinguish Manifold2-G or Manifold2-C
    execute_process(COMMAND uname -m
    OUTPUT_VARIABLE DEVICE_SYSTEM_ID)
    if (DEVICE_SYSTEM_ID MATCHES x86_64)
    set(TOOLCHAIN_NAME x86_64-linux-gnu-gcc)
    add_definitions(-DPLATFORM_ARCH_x86_64=1)
    elseif (DEVICE_SYSTEM_ID MATCHES aarch64)
    set(TOOLCHAIN_NAME aarch64-linux-gnu-gcc)
    add_definitions(-DPLATFORM_ARCH_aarch64=1)

    ##树莓派命令行 unmade -m armv6l
    elseif (DEVICE_SYSTEM_ID MATCHES armv6l)
    set(TOOLCHAIN_NAME arm-linux-gnueabihf-gcc)
    ## add_definitions(-DPLATFORM_ARCH_x86_64=1)

    else ()
    message(FATAL_ERROR "FATAL: Please confirm your platform.")
    endif ()

    0
    Comment actions Permalink
  • DJI Developer Support
    可以将cmake里面相关的代码注释 直接设置变量,类似附件内容。
    0
    Comment actions Permalink
  • lss

    ## "uname -m" to auto distinguish Manifold2-G or Manifold2-C
    #execute_process(COMMAND uname -m
    OUTPUT_VARIABLE DEVICE_SYSTEM_ID)
    #if (DEVICE_SYSTEM_ID MATCHES x86_64)
    #set(TOOLCHAIN_NAME x86_64-linux-gnu-gcc)
    #add_definitions(-DPLATFORM_ARCH_x86_64=1)
    #elseif (DEVICE_SYSTEM_ID MATCHES aarch64)
    #set(TOOLCHAIN_NAME aarch64-linux-gnu-gcc)
    #add_definitions(-DPLATFORM_ARCH_aarch64=1)
    ##树莓派命令行 unmade -m armv6l use arm-linux-gnueabihf-gcc
    set(TOOLCHAIN_NAME arm-linux-gnueabihf-gcc)
    ##add_definitions(-DPLATFORM_ARCH_x86_64=1)
    #else ()
    #message(FATAL_ERROR "FATAL: Please confirm your platform.")
    #endif ()
    第一,请问是修改成如上代码吗?第二,不明确add_definitions(-DPLATFORM_ARCH_x86_64=1)语句该如何更改。

    0
    Comment actions Permalink
  • DJI Developer Support
    在命令行执行uname -a查看目前所在的平台。
    0
    Comment actions Permalink
  • lss

    Linux raspberrypi 6.1.21+ #1642 Mon Apr 3 17:19:14 BST 2023 armv6l GNU/L inux

    0
    Comment actions Permalink
  • DJI Developer Support
    您可以尝试修改附件中的aarch64为armv6l,并将对应的工具链进行替换。 目前PSDK没有对armv6l进行适配,建议您实际开发使用树莓派4B开发板。
    0
    Comment actions Permalink
  • lss

    已更改为armv6l,编译通过,执行报错register osal handler error。请问能提供适配armv6l的开发吗?

    0
    Comment actions Permalink

Please sign in to leave a comment.