Closed bradgrissom closed 1 year ago
I forgot to paste the output from running it:
pi ~/Payload-SDK_vanilla/Payload-SDK/samples/sample_c/platform/linux/manifold2/bin ..) sudo ./dji_sdk_demo_linux-
[0.008][core]-[Info]-[DjiCore_Init:96) Payload SDK Version : V3.4.0-beta.0-build.1749-
[0.157][adapter]-[Info]-[DjiAccessAdapter_Init:180) Identify aircraft series is Matrice 300 Series-
[0.157][adapter]-[Info]-[DjiAccessAdapter_Init:198) Identify mount position type is Payload Port Type-
[0.163][adapter]-[Info]-[DjiPayloadNegotiate_Init:200) Waiting payload negotiate finished.-
[1.195][adapter]-[Info]-[DjiPayloadNegotiate_Init:200) Waiting payload negotiate finished.-
[2.195][adapter]-[Info]-[DjiPayloadNegotiate_Init:200) Waiting payload negotiate finished.-
[3.195][adapter]-[Info]-[DjiPayloadNegotiate_Init:200) Waiting payload negotiate finished.-
[4.195][adapter]-[Info]-[DjiPayloadNegotiate_Init:200) Waiting payload negotiate finished.-
[5.195][adapter]-[Info]-[DjiPayloadNegotiate_Init:200) Waiting payload negotiate finished.-
[7.658][core]-[Info]-[DjiIdentityVerify_UpdatePolicy:445) Updating dji sdk policy file...-
[8.658][core]-[Info]-[DjiIdentityVerify_UpdatePolicy:448) Update dji sdk policy file successfully-
[9.718][infor]-[Info]-[DjiAircraftInfo_GetAdapterSerialNumber:669) Get serial number of Skyport V2 or X-Port is 34DDH5L000007H-
[9.721][core]-[Info]-[DjiCore_Init:164) Identify AircraftType = Matrice 300 RTK, MountPosition = Payload Port NO1, SdkAdapterType = X-Port-
[10.056][time_sync]-[Info]-[DjiTimeSync_PushAppTimeHandle:111) Current time: 2023.05.17 11:24:13.-
[11.128][user]-[Info]-[DjiTest_WidgetStartService:105) BAG cfgdELSE widget file path [/home/pi/Payload-SDK_vanilla/Payload-SDK/samples/sample_>
[11.130][core]-[Info]-[DjiCore_ApplicationStart:231) Start dji sdk application-
[12.407][infor]-[Info]-[DjiAircraftInfo_NotifyMobileAppInfoHandle:578) Set mobile app info, language is English, screen type is Big Screen-
Segmentation fault
Here is the GDB backtrace:
[Detaching after vfork from child process 14295] [Detaching after vfork from child process 14299] [31.381][infor]-[Info]-[DjiAircraftInfo_NotifyMobileAppInfoHandle:578) Set mobile app info, language is English, screen type is Big Screen
Thread 10 "downloader_task" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fe77fe1c0 (LWP 14266)] 0x0000007ff7ebac50 in GI_pthread_mutex_lock (mutex=mutex@entry=0x0) at pthread_mutex_lock.c:67 67 pthread_mutex_lock.c: No such file or directory. (gdb) bt
at /home/pi/Payload-SDK_vanilla/Payload-SDK/samples/sample_c/platform/linux/common/osal/osal.c:139
(gdb) info frame Stack level 0, frame at 0x7fe77fd810: pc = 0x7ff7ebac50 in GI_pthread_mutex_lock (pthread_mutex_lock.c:67); saved pc = 0x5555594b9c called by frame at 0x7fe77fd830 source language c. Arglist at 0x7fe77fd7e0, args: mutex=mutex@entry=0x0 Locals at 0x7fe77fd7e0, Previous frame's sp is 0x7fe77fd810 Saved registers: x21 at 0x7fe77fd800, x22 at 0x7fe77fd808, x29 at 0x7fe77fd7e0, x30 at 0x7fe77fd7e8 (gdb)
Pulling in the latest DJI Payload-SDK version 3.5 code (as of 2023.05.22) , I don't get the crash, but I get endless (millions) messages like these:
[121.376][channel]-[Error]-[DjiHighSpeedDataChannel_GetDownloadStreamState:643) Lock mutex error. [121.376][downloader]-[Error]-[DjiDataDownloader_GetDownloadChannelBandWidth:889) get download channel state error: 227. [121.376][downloader]-[Error]-[DjiDataDownloader_GetSendFlowControlParam:914) Get download channel bandwidth error, 0x000000E3 [121.376][downloader]-[Error]-[DjiDataDownloader_DataSending:503) Get send flow control param error, stat = 0x000000E3 [121.377][channel]-[Error]-[DjiHighSpeedDataChannel_GetDownloadStreamState:643) Lock mutex error.
This is the fix from DJI email support. It worked:
Please enable the data transmission,widget functions are multiplexed within data transmission channels.
Problem description: Payload SDK v3.4 segfault running Linux test_widget.c example
Payload SDK: Latest v3.4 DJI Payload SDK from: https://github.com/dji-sdk/Payload-SDK Payload SDK Version : V3.4.0-beta.0-build.1749
DJI Aircraft: Matrice 300 Series
Gimbal: Get serial number of Skyport V2 or X-Port is 34DDH5L000007H Identify AircraftType = Matrice 300 RTK, MountPosition = Payload Port NO1, SdkAdapterType = X-Portfile:///root/Desktop/2023.05.17_dji_payload_sdk.diff
Host Platform: Raspberry Pi CM4 Serial port: /dev/serial0 at 115200 baud Ethernet: eth0
Attached is a .diff file showing exactly what I changed from the default code, which is the serial port device, ethernet device, and a few print statements.
I'm having a hard time attaching a file, here is the diff below: