Auto-detect custom CMSIS-DAP probe

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Auto-detect custom CMSIS-DAP probe

2,566 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by devan on Tue Dec 29 03:04:29 MST 2015
Hi,

I've been working on a custom CMSIS-DAP implementation (derived from the mbed CMSIS-DAP sources). I've been able to get Keil and OpenOCD to detect my probe from the product/interface strings that contain "CMSIS-DAP", but LPCXpresso doesn't seem to detect it.

After doing some digging, I found that I can modify the probe matching rules in bin/Scripts/probetable.csv to include my VID/PID pair and it detects and uses my probe just fine after that. Since the fields in the table aren't really documented, I can't tell if the other fields would allow more sophisticated matching that doesn't rely on whitelisting every probe I want to use.

Are the rules that LPCXpresso uses to detect CMSIS-DAP probes documented somewhere?

I'm using LPCXpresso 8.0.0 Build 526 on 32-bit Debian Linux.

For reference, I've included the verbose lsusb output for my debug probe:


Bus 006 Device 096: ID 1209:da42 InterBiometrics 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          239 Miscellaneous Device
  bDeviceSubClass         2 ?
  bDeviceProtocol         1 Interface Association
  bMaxPacketSize0        64
  idVendor           0x1209 InterBiometrics
  idProduct          0xda42 
  bcdDevice            1.00
  iManufacturer           1 Devanarchy
  iProduct                2 DAP42 CMSIS-DAP
  iSerial                 3 383037201943425635001900
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          125
    bNumInterfaces          4
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xc0
      Self Powered
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              2 DAP42 CMSIS-DAP
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      33
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         1
      bInterfaceCount         2
      bFunctionClass          2 Communications
      bFunctionSubClass       2 Abstract (modem)
      bFunctionProtocol       0 None
      iFunction               4 DAP42 Composite CDC HID
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass      2 Abstract (modem)
      bInterfaceProtocol      1 AT-commands (v.25ter)
      iInterface              5 CDC Control
      CDC Header:
        bcdCDC               1.10
      CDC Call Management:
        bmCapabilities       0x00
        bDataInterface          2
      CDC ACM:
        bmCapabilities       0x02
          line coding and serial state
      CDC Union:
        bMasterInterface        1
        bSlaveInterface         2 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0 
      iInterface              6 CDC Data
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass       254 Application Specific Interface
      bInterfaceSubClass      1 Device Firmware Update
      bInterfaceProtocol      1 
      iInterface              7 DAP42 DFU
      Device Firmware Upgrade Interface Descriptor:
        bLength                             9
        bDescriptorType                    33
        bmAttributes                        9
          Will Detach
          Manifestation Intolerant
          Upload Unsupported
          Download Supported
        wDetachTimeout                    255 milliseconds
        wTransferSize                    1024 bytes
        bcdDFUVersion                   1.1a
Device Status:     0x0000
  (Bus Powered)
0 Kudos
Reply
3 Replies

2,458 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by devan on Tue Dec 29 23:15:52 MST 2015
Hi,

Thanks for the fast response. I know that I can always manually add entries to the probe table, but would it be possible to include a generic entry that matches CMSIS-DAP probes in a future release?

For example, after some experimentation, I've found that the following works for matching any probe using just the product description, ignoring the VID/PID:

0x0000, 0x0000, 64, 1, 0, 0, 0, "CMSIS-DAP", 0, -1


Admittedly, it would probably require some extra CMSIS-DAP queries to determine which capabilities the probe reports as available for SWD, JTAG, SWO, etc, but I think it would be useful to be able to use non-whitelisted probes, even with potentially reduced capabilities.

Thanks,
-Devan.
0 Kudos
Reply

2,458 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Dec 29 10:33:45 MST 2015


NXP has not advertised the probetable.csv format because we did not anticipate there would be regular additions. You might notice the probe table also contains entries for non CMSIS-DAP probes.

For CMSIS-DAP probes, LPCXpresso currently requires you add an entry to the probetable.csv file. Your CMSIS-DAP probe product string descriptor must embed the "CMSIS-DAP" sub-string within the USB product string descriptor.

We'll turn the attached information into a FAQ, but consider it a quick summary of the LPCXpresso probetable.csv format.

Thanks and regards,
LPCXpresso Support
0 Kudos
Reply

2,325 Views
Jelli
Contributor II

Hi,
In MCUXpressoIDE_11.4.0_6224 there was a change of the probetable.csv format. What is the additional parameter for?

Thanks,
Mirko

0 Kudos
Reply