PSDK V3.5 / M300 RTK / FTDI FT4232H - UART issues
已完成Hello,
I'm using an FTDI FT4232H to connect to the UART port of the DJI M300 RTK. The USB part of the connection is fine. In Ubuntu I see the USB Ethernet with an interface name enxd2e780cae600 (it is the ttyACM1 in my case).
The FTDI FT4232H is shown in Ubuntu with /dev/ttyUSB0 to ttyUSB3. The port is manually configured by "sudo stty -F /dev/ttyUSB0 921600". If I controll the setting with "sudo stty -F /dev/ttyUSB0" I get the 921600 back. I can connect with "picocom -b 921600 /dev/ttyUSB0" and see that there is binary data received.
hal_network.h, hal_uart.h, hal_usb_bulk.h, dji_sdk_app_info.h and dji_sdk_config.h are configured with the settings. When the sample code is started with "sudo ./dji_sdk_demo_linux_cxx" the following information is printed on the screen:
sudo ./dji_sdk_demo_linux_cxx
[0.003][core]-[Info]-[DjiCore_Init:101) Payload SDK Version : V3.5.0-beta.0-build.1764
[1.685][adapter]-[Info]-[DjiAccessAdapter_Init:170) Try identify UART0 connection failed. Probably because SDK adapter or aircraft not finish init or UART connect error.
[3.417][adapter]-[Info]-[DjiAccessAdapter_Init:170) Try identify UART0 connection failed. Probably because SDK adapter or aircraft not finish init or UART connect error.
[5.151][adapter]-[Info]-[DjiAccessAdapter_Init:170) Try identify UART0 connection failed. Probably because SDK adapter or aircraft not finish init or UART connect error.
[6.376][linker]-[Error]-[DjiProtocol_sdkUnpack:228) protocol frame crc16 error:0x434F 0x8246
[6.885][adapter]-[Info]-[DjiAccessAdapter_Init:170) Try identify UART0 connection failed. Probably because SDK adapter or aircraft not finish init or UART connect error.
[8.616][adapter]-[Info]-[DjiAccessAdapter_Init:170) Try identify UART0 connection failed. Probably because SDK adapter or aircraft not finish init or UART connect error.
[10.352][adapter]-[Info]-[DjiAccessAdapter_Init:170) Try identify UART0 connection failed. Probably because SDK adapter or aircraft not finish init or UART connect error.
[11.595][linker]-[Error]-[DjiProtocol_sdkUnpack:228) protocol frame crc16 error:0xD2AA 0x5B29
[12.088][adapter]-[Info]-[DjiAccessAdapter_Init:170) Try identify UART0 connection failed. Probably because SDK adapter or aircraft not finish init or UART connect error.
[13.821][adapter]-[Info]-[DjiAccessAdapter_Init:170) Try identify UART0 connection failed. Probably because SDK adapter or aircraft not finish init or UART connect error.
[15.550][adapter]-[Info]-[DjiAccessAdapter_Init:170) Try identify UART0 connection failed. Probably because SDK adapter or aircraft not finish init or UART connect error.
[15.550][adapter]-[Error]-[DjiAccessAdapter_Init:175) Try identify UART0 connection timeout. Probably because SDK adapter or aircraft not finish init or UART connect error.
[15.550][core]-[Error]-[DjiCore_Init:121) Access adapter init error, stat:225
terminate called after throwing an instance of 'std::runtime_error'
what(): Core init error.
If I start "sudo stty -F /dev/ttyUSB0" again the baud rate is now set to 1000000.
What happens in the psdk_lib that the baudrate is changing? If I'm using a CP2102 USB to serial converter the sample code is running without any issue. What must be done that the FTDI FT4232H is working with the sample code?
BR, Michael
PS:
Output of lsusb:
lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 007: ID 8087:0026 Intel Corp. AX201 Bluetooth
Bus 001 Device 010: ID 2ca3:001f DJI Technology Co., Ltd. e1e
Bus 001 Device 009: ID 0403:6011 Future Technology Devices International, Ltd FT4232H Quad HS USB-UART/FIFO IC
Bus 001 Device 008: ID 0424:2507 Microchip Technology, Inc. (formerly SMSC) hub
Bus 001 Device 006: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 005: ID 3343:803a Unknown LattePanda Leonardo
Bus 001 Device 004: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
Bus 001 Device 003: ID 046a:00b6 Cherry GmbH USB Mouse
Bus 001 Device 002: ID 046a:0023 Cherry GmbH Keyboard
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
/dev/input/event3 - CHERRY_USB_Mouse
/dev/input/event4 - 046a_0023
/dev/input/event5 - 046a_0023
/dev/input/mouse0 - CHERRY_USB_Mouse
/dev/sda - Linux_File-Stor_Gadget_123456789ABCDEF-0:0
/dev/sdb - Linux_File-Stor_Gadget_123456789ABCDEF-0:1
/dev/ttyACM0 - Unknown_LattePanda_Leonardo
/dev/ttyACM1 - DJI_e1e_123456789ABCDEF
/dev/ttyUSB0 - FTDI_Quad_RS232-HS
/dev/ttyUSB1 - FTDI_Quad_RS232-HS
/dev/ttyUSB2 - FTDI_Quad_RS232-HS
/dev/ttyUSB3 - FTDI_Quad_RS232-HS
-
PSDK runs on the M300 OSDK port, there will be baud rate auto-negotiation, that is, there is no need to set the baud rate of the drone, the PSDK will use different baud rates to try to communicate with the drone, and finally the drone baud rate will be set to the baud rate specified by PSDK code. Set the baud rate on the DJI Assistant2 Onboard SDK interface same as the PSDK code, it will skip the negotiation.
请先登录再写评论。
评论
1 条评论