For the BUL node configuration in the PSDK code, you can refer to the following process. You need to configure the BULK node of the development board first. After successfully generating BULK, perform the following steps.
After generating the BULK node, you can connect the Device of the development board to another Linux or to its own Host interface. Use lsusb on another Linux to view the device information:
The device's VID PID is 0955:7020 (if you are not sure, you can confirm it by hot-plugging)
Then use the lsusb -d VID:PID -v command to view all USB nodes.
leon@leon-virtual-machine:~$ lsusb -d 0955:7020 -v
Bus 002 Device 002: ID 0955:7020 NVIDIA Corp. L4T (Linux for Tegra) running on Tegra
Couldn't open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 64
idVendor 0x0955 NVIDIA Corp.
idProduct 0x7020 L4T (Linux for Tegra) running on Tegra
bcdDevice 0.01
iManufacturer 1 raspberry
iProduct 2 PI4
iSerial 3 abcdefg1234567890
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0079
bNumInterfaces 4
bConfigurationValue 1
iConfiguration 4
bmAttributes 0x80
(Bus Powered)
MaxPower 250mA
Interface Association:
bLength 8
bDescriptorType 11
bFirstInterface 0
bInterfaceCount 2
bFunctionClass 2 Communications
bFunctionSubClass 6 Ethernet Networking
bFunctionProtocol 0
iFunction 7
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 2 Communications
bInterfaceSubClass 2 Abstract (modem)
bInterfaceProtocol 255 Vendor Specific (MSFT RNDIS?)
iInterface 5
CDC Header:
bcdCDC 1.10
CDC Call Management:
bmCapabilities 0x00
bDataInterface 1
CDC ACM:
bmCapabilities 0x00
CDC Union:
bMasterInterface 0
bSlaveInterface 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 9
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 10 CDC Data
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 6
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 2
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 9
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 10
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x84 EP 4 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x03 EP 3 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Then you can refer to the BULK configuration in the PSDK code (hal_usb_bulk.h)
First, we need to find all nodes of type BULK, that is, nodes with Transfer Type BULK.
Then we can compare the relationship. Take BULK1 as an example. In fact, BULK2 is the same. In the code,
LINUX_USB_BULK1_INTERFACE_NUM corresponds to bInterfaceNumber,
LINUX_USB_BULK1_END_POINT_IN corresponds to bEndpointAddress *** IN
LINUX_USB_BULK1_END_POINT_OUT corresponds to bEndpointAddress *** OUT (for example, fill 3 in 0x03)
Take this as an example, find all BULK type nodes, here are 0x81 0x83 0x84 respectively.
Then the configuration in the code should be as follows (if you are not sure, you can configure three groups separately and run PSDK to try them separately):
#define LINUX_USB_BULK1_INTERFACE_NUM (1)
#define LINUX_USB_BULK1_END_POINT_IN (0x81)
#define LINUX_USB_BULK1_END_POINT_OUT (1)
#define LINUX_USB_BULK1_INTERFACE_NUM (2)
#define LINUX_USB_BULK1_END_POINT_IN (0x83)
#define LINUX_USB_BULK1_END_POINT_OUT (2)
#define LINUX_USB_BULK1_INTERFACE_NUM (3)
#define LINUX_USB_BULK1_END_POINT_IN (0x84)
#define LINUX_USB_BULK1_END_POINT_OUT (3)
Note: The nodes of BULK1 and BULK2 cannot be the same. Different BULK nodes must be configured respectively.
At this time, you can use the liveview function to verify. Add printing to the following two functions, and then call DjiTest_LiveviewRunSample in main.c to see if there is a callback.
If the callback is not entered, it means that there is still a problem with the bulk node. You need to replace the configured node. If it is successfully printed, it means that the BULK1 node is no longer a problem.
The BULK2 node can be verified by downloading the media file. DjiTest_CameraManagerRunSample function, E_DJI_TEST_CAMERA_MANAGER_SAMPLE_SELECT_DOWNLOAD_AND_DELETE_MEDIA_FILE option.
Comments
0 comments
Please sign in to leave a comment.