Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#75 cmsis_dap_vid_pid unusable.

0.9.0
closed
nobody
None
2014-06-27
2014-06-23
MURANAKA Masaki
No

There is no way to call cmsis_dap_vid_pid command.
As the script execution will be failed in cmsis_dap_usb_open() (in cmsis_dap_init() ).

Discussion

  • Paul Fertser
    Paul Fertser
    2014-06-23

    Hi. Thank you for reporting the issue.

    Is "cmsis_dap_vid_pid" command really needed for anything? Any CMSIS-DAP compliant adapter should have CMSIS-DAP in its USB description string and OpenOCD uses that feature. Are there any adapters that speak CMSIS-DAP but violate that rule? If no, then we should probably remove that command altogether and be done with it.

     
    • Hello.

      Are there any adapters that speak CMSIS-DAP but violate that rule?

      It exists. Spansion's FM4 Starter kit
      After applying this patch, the on-board CMSIS-DAP adapter was detected.

      diff --git a/src/jtag/drivers/cmsis_dap_usb.c b/src/jtag/drivers/cmsis_dap_usb.c
      index dc59fcf..c05ee22 100644
      --- a/src/jtag/drivers/cmsis_dap_usb.c
      +++ b/src/jtag/drivers/cmsis_dap_usb.c
      @@ -173,7 +173,11 @@ static int cmsis_dap_usb_open(void)
              devs = hid_enumerate(0x0, 0x0);
              cur_dev = devs;
              while (NULL != cur_dev) {
      -               if (0 == cmsis_dap_vid[0]) {
      +               if (0x1a6a == cur_dev->vendor_id &&
      +                   0x2000 == cur_dev->product_id) {
      +                       /* Spansion SK-FM4-U120-9B560 */
      +                       break;
      +               } else if (0 == cmsis_dap_vid[0]) {
                              if (NULL == cur_dev->product_string) {
                                      LOG_DEBUG("Cannot read product string of device 0x%x:0x%x",
                                                cur_dev->vendor_id, cur_dev->product_id);
      
       
      • Paul Fertser
        Paul Fertser
        2014-06-24

        On Mon, Jun 23, 2014 at 08:40:42PM +0000, MURANAKA Masaki wrote:

        Are there any adapters that speak CMSIS-DAP but violate that rule?

        It exists. [1]Spansion's FM4 Starter kit

        Ok, well... Please notify the manufacturer, hopefully they'll update
        the firmware eventually.

        Because of the issue outlined in the commit message of
        http://openocd.zylin.com/2191 we can neither fix custom vid/pid
        operation nor add a new feature to match by serial number. Sigh, can
        anybody please take a look at that one?

        --
        Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
        mailto:fercerpav@gmail.com

         
        • I already reported this issue to Spansion. I'm not sure if they fix this issue.

           
          • Paul Fertser
            Paul Fertser
            2014-06-25

            Hi,

            On Tue, Jun 24, 2014 at 10:49:07PM +0000, MURANAKA Masaki wrote:

            I already reported this issue to Spansion. I'm not sure if they fix this issue.

            Thank you. Please see if http://openocd.zylin.com/#/c/2192/ (the whole
            branch) fixes the issue for you. It seems to do the right thing here.

             
            • Your patch works well also on my FM4 starter kit. I agree this issue close.

               
  • Spencer Oliver
    Spencer Oliver
    2014-06-23

    Personally I would say it is still need for users that have more than one CMSIS-DAP adapter fitted. I do agree that this is not the case for most people so would class this as an advanced feature.

     
    • Paul Fertser
      Paul Fertser
      2014-06-23

      On Mon, Jun 23, 2014 at 07:07:33PM +0000, Spencer Oliver wrote:

      Personally I would say it is still need for users that have more than one
      CMSIS-DAP adapter fitted. I do agree that this is not the case for most people
      so would class this as an advanced feature.

      I wonder if advanced users are supposed to be using sane equipment :)

      At least MBED CMSIS-DAP (for K40) here seems to have a serial
      specified, but I haven't checked yet where it gets it from:

      idVendor 0x0d28
      idProduct 0x0204
      bcdDevice 1.00
      iManufacturer 1 MBED
      iProduct 2 MBED CMSIS-DAP
      iSerial 3 020002002418D1EBD9E72C13

      My point is that probably a command to match by serial should be
      introduced instead of matching by vid/pid.

      --
      Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
      mailto:fercerpav@gmail.com

       
  • Paul Fertser
    Paul Fertser
    2014-06-27

    • status: new --> closed
     
  • Paul Fertser
    Paul Fertser
    2014-06-27

    This issue will be handled when http://openocd.zylin.com/#/c/2192/ is merged. If anyone wants, feel free to create a wishlist ticket to add match on serial number in a separate ticket.