PSDK 3.8 串口初始化失败, Try identify UART0 connection failed
已完成我使用的无人机是M3E,psdk版本是3.8.0,我按照官方文档编译并运行了dji_sdk_demo_linux_cxx,在串口初始化的步骤报错了,日志如下:
[0.009][core]-[Info]-[DjiCore_Init:101) Payload SDK Version : V3.8.0-beta.0-build.1929
[0.010][user]-[Info]-[HalUart_Init:143) set baud 115200, expected 921600
[0.010][utils]-[Debug]-[DjiCore_RootTask:131) work execution time:
[0.010][utils]-[Debug]-[DjiCore_RootTask:132) name execution time (ms) max execution time (ms)
[0.010][utils]-[Debug]-[DjiCore_RootTask:134) recorderWork 0 0
[0.010][utils]-[Debug]-[DjiCore_RootTask:134) flowControllerTask 0 0
[0.013][user]-[Info]-[HalUart_Init:158) set baud 921600
[0.016][linker]-[Debug]-[DjiLinker_Init:128) init linker success, protocol:2, channelId:0
[0.016][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[0.036][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[0.056][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[0.076][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[0.096][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[0.117][linker]-[Debug]-[DjiLinker_DeInit:170) deinit linker success, protocol:2, channelId:0
[0.117][user]-[Info]-[HalUart_Init:143) set baud 115200, expected 921600
[0.120][linker]-[Debug]-[DjiLinker_Init:128) init linker success, protocol:2, channelId:0
[0.120][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0507->0x0503 0x03FD
[0.140][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0507->0x0503 0x03FD
[0.160][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0507->0x0503 0x03FD
[0.180][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0507->0x0503 0x03FD
[0.201][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0507->0x0503 0x03FD
[0.221][linker]-[Debug]-[DjiLinker_DeInit:170) deinit linker success, protocol:2, channelId:0
[0.222][user]-[Info]-[HalUart_Init:148) set baud 230400, expected 921600
[0.224][linker]-[Debug]-[DjiLinker_Init:128) init linker success, protocol:2, channelId:0
[0.224][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0507->0x0503 0x03FD
[0.244][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0507->0x0503 0x03FD
[0.265][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0507->0x0503 0x03FD
[0.285][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0507->0x0503 0x03FD
[0.305][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0507->0x0503 0x03FD
[0.325][linker]-[Debug]-[DjiLinker_DeInit:170) deinit linker success, protocol:2, channelId:0
[0.326][user]-[Info]-[HalUart_Init:153) set baud 460800, expected 921600
[0.328][linker]-[Debug]-[DjiLinker_Init:128) init linker success, protocol:2, channelId:0
[0.329][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0507->0x0503 0x03FD
[0.349][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0507->0x0503 0x03FD
[0.369][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0507->0x0503 0x03FD
[0.389][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0507->0x0503 0x03FD
[0.409][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0507->0x0503 0x03FD
[0.429][linker]-[Debug]-[DjiLinker_DeInit:170) deinit linker success, protocol:2, channelId:0
[0.430][user]-[Info]-[HalUart_Init:158) set baud 921600
[0.433][linker]-[Debug]-[DjiLinker_Init:128) init linker success, protocol:2, channelId:0
[0.433][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0507->0x0503 0x03FD
[0.453][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0507->0x0503 0x03FD
[0.473][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0507->0x0503 0x03FD
[0.493][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0507->0x0503 0x03FD
[0.513][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0507->0x0503 0x03FD
[0.534][linker]-[Debug]-[DjiLinker_DeInit:170) deinit linker success, protocol:2, channelId:0
[0.534][user]-[Info]-[HalUart_Init:163) set baud 1000000, expected 921600
[0.537][linker]-[Debug]-[DjiLinker_Init:128) init linker success, protocol:2, channelId:0
[0.537][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0507->0x0503 0x03FD
[0.557][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0507->0x0503 0x03FD
[0.578][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0507->0x0503 0x03FD
[0.598][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0507->0x0503 0x03FD
[0.618][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0507->0x0503 0x03FD
[0.638][linker]-[Debug]-[DjiLinker_DeInit:170) deinit linker success, protocol:2, channelId:0
[0.639][user]-[Info]-[HalUart_Init:143) set baud 115200, expected 921600
[0.642][linker]-[Debug]-[DjiLinker_Init:128) init linker success, protocol:2, channelId:0
[0.642][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[0.662][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[0.682][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[0.702][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[0.722][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[0.742][linker]-[Debug]-[DjiLinker_DeInit:170) deinit linker success, protocol:2, channelId:0
[0.743][user]-[Info]-[HalUart_Init:148) set baud 230400, expected 921600
[0.746][linker]-[Debug]-[DjiLinker_Init:128) init linker success, protocol:2, channelId:0
[0.746][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[0.766][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[0.786][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[0.806][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[0.826][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[0.847][linker]-[Debug]-[DjiLinker_DeInit:170) deinit linker success, protocol:2, channelId:0
[0.848][user]-[Info]-[HalUart_Init:153) set baud 460800, expected 921600
[0.850][linker]-[Debug]-[DjiLinker_Init:128) init linker success, protocol:2, channelId:0
[0.850][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[0.870][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[0.890][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[0.911][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[0.931][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[0.951][linker]-[Debug]-[DjiLinker_DeInit:170) deinit linker success, protocol:2, channelId:0
[0.952][user]-[Info]-[HalUart_Init:158) set baud 921600
[0.954][linker]-[Debug]-[DjiLinker_Init:128) init linker success, protocol:2, channelId:0
[0.954][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[0.975][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[0.995][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[1.015][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[1.035][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[1.055][linker]-[Debug]-[DjiLinker_DeInit:170) deinit linker success, protocol:2, channelId:0
[1.056][user]-[Info]-[HalUart_Init:163) set baud 1000000, expected 921600
[1.059][linker]-[Debug]-[DjiLinker_Init:128) init linker success, protocol:2, channelId:0
[1.059][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[1.070][utils]-[Debug]-[DjiCore_RootTask:131) work execution time:
[1.070][utils]-[Debug]-[DjiCore_RootTask:132) name execution time (ms) max execution time (ms)
[1.070][utils]-[Debug]-[DjiCore_RootTask:134) recorderWork 1 1
[1.070][utils]-[Debug]-[DjiCore_RootTask:134) flowControllerTask 1 1
[1.079][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[1.099][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[1.119][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[1.139][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD
[1.159][linker]-[Debug]-[DjiLinker_DeInit:170) deinit linker success, protocol:2, channelId:0
[1.160][user]-[Info]-[HalUart_Init:143) set baud 115200, expected 921600
[1.163][linker]-[Debug]-[DjiLinker_Init:128) init linker success, protocol:2, channelId:0
[1.163][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A07->0x0300 0x03FD
[1.183][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A07->0x0300 0x03FD
[1.203][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A07->0x0300 0x03FD
[1.223][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A07->0x0300 0x03FD
[1.243][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A07->0x0300 0x03FD
[1.264][linker]-[Debug]-[DjiLinker_DeInit:170) deinit linker success, protocol:2, channelId:0
[1.265][user]-[Info]-[HalUart_Init:148) set baud 230400, expected 921600
[1.267][linker]-[Debug]-[DjiLinker_Init:128) init linker success, protocol:2, channelId:0
[1.267][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A07->0x0300 0x03FD
[1.287][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A07->0x0300 0x03FD
[1.308][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A07->0x0300 0x03FD
[1.328][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A07->0x0300 0x03FD
[1.348][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A07->0x0300 0x03FD
[1.368][linker]-[Debug]-[DjiLinker_DeInit:170) deinit linker success, protocol:2, channelId:0
[1.369][user]-[Info]-[HalUart_Init:153) set baud 460800, expected 921600
[1.372][linker]-[Debug]-[DjiLinker_Init:128) init linker success, protocol:2, channelId:0
[1.372][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A07->0x0300 0x03FD
[1.392][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A07->0x0300 0x03FD
[1.412][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A07->0x0300 0x03FD
[1.432][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A07->0x0300 0x03FD
[1.452][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A07->0x0300 0x03FD
[1.472][linker]-[Debug]-[DjiLinker_DeInit:170) deinit linker success, protocol:2, channelId:0
[1.473][user]-[Info]-[HalUart_Init:158) set baud 921600
[1.476][linker]-[Debug]-[DjiLinker_Init:128) init linker success, protocol:2, channelId:0
[1.476][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A07->0x0300 0x03FD
[1.496][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A07->0x0300 0x03FD
[1.516][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A07->0x0300 0x03FD
[1.536][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A07->0x0300 0x03FD
[1.556][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A07->0x0300 0x03FD
[1.577][linker]-[Debug]-[DjiLinker_DeInit:170) deinit linker success, protocol:2, channelId:0
[1.577][user]-[Info]-[HalUart_Init:163) set baud 1000000, expected 921600
[1.580][linker]-[Debug]-[DjiLinker_Init:128) init linker success, protocol:2, channelId:0
[1.580][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A07->0x0300 0x03FD
[1.600][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A07->0x0300 0x03FD
[1.620][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A07->0x0300 0x03FD
[1.640][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A07->0x0300 0x03FD
[1.661][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A07->0x0300 0x03FD
[1.665][linker]-[Warn]-[DjiProtocol_v1Unpack:177) protocol frame crc8 error
[1.681][linker]-[Debug]-[DjiLinker_DeInit:170) deinit linker success, protocol:2, channelId:0
中间的日志都是重复的,最后进程停止时的日志是
[20.123][adapter]-[Error]-[DjiAccessAdapter_Init:217) Try identify UART0 connection timeout. Probably because SDK adapter or aircraft not finish init or UART connect error.
[20.123][core]-[Error]-[DjiCore_Init:121) Access adapter init error, stat:225
我的负载与无人机的连接方式是仅uart,我在dji_sdk_config.h中指定了正确的连接方式。
我知道PSDK有自动设置波特率的功能,但我还是遵从源代码的提示(见附图),在dji_sdk_app_info.h中设置了波特率为921600。
另外,我在hal_uart.c中用USER_LOG_INFO添加了几行调试信息。除了这些,我没有对源代码做其它改动。
我翻阅了论坛上所有遇到相同问题的帖子,并尝试了他们的解决方案,但是没有一个对我的情况奏效的。
-
想和您确认拓展板电源是因为M3E如果检测到E-Port热插拔并且您在15秒内没有运行PSDK,M3E会断掉对外供电,我们先排除下这个原因导致的串口通讯失败。 另外日志中: [0.016][linker]-[Debug]-[DjiProtocol_v1Pack:122) V1-Send: 0x0A06->0x0300 0x03FD 这个实际上是一直在请求飞机类型 ,但是飞机端没有任何回应,说明串口完全没有通,没有任何数据回传。 您的尝试:如果用串口连接飞机,发现飞机串口一直在对外输出数据,并且数据如图,这个数据是正常的输出,这个说明飞机的串口硬件没有什么大问题,因此我们更倾向于您的平台可能存在问题,您方便使用PC安装一个虚拟机对比验证看看吗?可以排查下是否开发板的问题。
请先登录再写评论。
评论
8 条评论