From 0f414bee2f41468d1a7d13446a8960d45b8b091c Mon Sep 17 00:00:00 2001 From: ALTracer <11005378+ALTracer@users.noreply.github.com> Date: Wed, 18 Feb 2026 19:29:39 +0300 Subject: [PATCH 1/6] hosted: Allow Olimex adapters through the filter (VID is 0x15ba not 0x0403) --- src/platforms/hosted/bmp_libusb.c | 1 + src/platforms/hosted/platform.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/platforms/hosted/bmp_libusb.c b/src/platforms/hosted/bmp_libusb.c index 07b59ca4e82..c219aef0716 100644 --- a/src/platforms/hosted/bmp_libusb.c +++ b/src/platforms/hosted/bmp_libusb.c @@ -80,6 +80,7 @@ static const debugger_device_s debugger_devices[] = { {VENDOR_ID_FTDI, PRODUCT_ID_FTDI_FT2232, PROBE_TYPE_FTDI, NULL, "FTDI FT2232"}, {VENDOR_ID_FTDI, PRODUCT_ID_FTDI_FT4232, PROBE_TYPE_FTDI, NULL, "FTDI FT4232"}, {VENDOR_ID_FTDI, PRODUCT_ID_FTDI_FT232, PROBE_TYPE_FTDI, NULL, "FTDI FT232"}, + {VENDOR_ID_OLIMEX, PRODUCT_ID_ANY, PROBE_TYPE_FTDI, NULL, "Olimex FTDI-based"}, {0, 0, PROBE_TYPE_NONE, NULL, ""}, }; diff --git a/src/platforms/hosted/platform.h b/src/platforms/hosted/platform.h index e220166dffb..acb72988357 100644 --- a/src/platforms/hosted/platform.h +++ b/src/platforms/hosted/platform.h @@ -83,6 +83,8 @@ void platform_buffer_flush(void); #define PRODUCT_ID_WCHLINK_DAP 0x8011U /* WCH-Link in mode DAP */ #define PRODUCT_ID_WCHLINKE_DAP 0x8012U /* WCH-LinkE in mode DAP */ +#define VENDOR_ID_OLIMEX 0x15baU + typedef enum probe_type { PROBE_TYPE_NONE = 0, PROBE_TYPE_BMP, From c3d8182219390fad08236cd0479abed3f610725e Mon Sep 17 00:00:00 2001 From: ALTracer <11005378+ALTracer@users.noreply.github.com> Date: Wed, 18 Feb 2026 19:35:10 +0300 Subject: [PATCH 2/6] hosted/ftdi: Add Description string of "arm-usb-ocd-h", expand comments. --- src/platforms/hosted/ftdi_bmp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/platforms/hosted/ftdi_bmp.c b/src/platforms/hosted/ftdi_bmp.c index e664d466ead..71ef4f70854 100644 --- a/src/platforms/hosted/ftdi_bmp.c +++ b/src/platforms/hosted/ftdi_bmp.c @@ -278,15 +278,17 @@ const cable_desc_s cable_desc[] = { { /* * http://www.olimex.com/dev/pdf/ARM-USB-OCD.pdf. - * DBUS 4 global enables JTAG Buffer. - * TCK and TMS are not independently switchable. - * => SWD is not possible. + * https://www.olimex.com/Products/ARM/JTAG/_resources/ARM-USB-OCD_and_OCD_H_manual.pdf + * DBUS 4 (active low) enables JTAG output buffers. + * TCK and TMS are not independently switchable. => SWD is not possible. + * Because of strstr() matching HS devices against FS cable-desc (full prefix), HS cable-desc should come first. */ .vendor = 0x15baU, .product = 0x002bU, .interface = INTERFACE_A, .init.data = {0, PIN3 | PIN1 | PIN0}, .init.dirs = {PIN4, PIN4 | PIN3 | PIN1 | PIN0}, + .description = "Olimex OpenOCD JTAG ARM-USB-OCD-H", .name = "arm-usb-ocd-h", }, { From 934c31a059ac8d67ace279fa0d4132accabf1fce Mon Sep 17 00:00:00 2001 From: ALTracer <11005378+ALTracer@users.noreply.github.com> Date: Wed, 18 Feb 2026 19:40:45 +0300 Subject: [PATCH 3/6] hosted/ftdi: Fix Olimex PID of "arm-usb-tiny-h" * Olimex manual for them lists a VID:PID table, 15ba:002a is correct --- src/platforms/hosted/ftdi_bmp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/platforms/hosted/ftdi_bmp.c b/src/platforms/hosted/ftdi_bmp.c index 71ef4f70854..2c42b074c14 100644 --- a/src/platforms/hosted/ftdi_bmp.c +++ b/src/platforms/hosted/ftdi_bmp.c @@ -364,10 +364,11 @@ const cable_desc_s cable_desc[] = { { /* * https://www.olimex.com/Products/ARM/JTAG/ARM-USB-TINY-H/ + * https://www.olimex.com/Products/ARM/JTAG/_resources/ARM-USB-TINY_and_TINY_H_manual.pdf * * schematics not available */ - .vendor = 0x15b1U, + .vendor = 0x15baU, .product = 0x002aU, .interface = INTERFACE_A, .init.data = {PIN4, PIN2 | PIN4}, From 4de0976b8d62deb30da6174a9bd737aa4486edea Mon Sep 17 00:00:00 2001 From: ALTracer <11005378+ALTracer@users.noreply.github.com> Date: Wed, 18 Feb 2026 19:45:15 +0300 Subject: [PATCH 4/6] hosted/ftdi: Log the picked cable description --- src/platforms/hosted/ftdi_bmp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/platforms/hosted/ftdi_bmp.c b/src/platforms/hosted/ftdi_bmp.c index 2c42b074c14..ecef0ba8b3d 100644 --- a/src/platforms/hosted/ftdi_bmp.c +++ b/src/platforms/hosted/ftdi_bmp.c @@ -419,8 +419,10 @@ bool ftdi_lookup_cable_by_product(bmda_cli_options_s *cl_opts, const char *produ return true; for (const cable_desc_s *cable = &cable_desc[0]; cable->vendor; ++cable) { + /* USB Product string should contain partial BMD description as substring */ if (cable->description && strstr(product, cable->description) != 0) { cl_opts->opt_cable = cable->name; + DEBUG_INFO("%s matched %s: %s\n", __func__, cable->name, cable->description); return true; } } From 6640315072d0e2b5a44e1fe3ef0aab346b2fcc72 Mon Sep 17 00:00:00 2001 From: ALTracer <11005378+ALTracer@users.noreply.github.com> Date: Wed, 18 Feb 2026 19:52:38 +0300 Subject: [PATCH 5/6] hosted/ftdi: Block-move "arm-usb-ocd" below "arm-usb-ocd-h", add FS "arm-usb-tiny" * 15b1:0003 "olimex" is the original "Olimex OpenOCD JTAG" aka ARM-USB-OCD, so give it a specific name and reference its usermanual by hyperlinks. Add description string. This seems to be a full prefix of 3 others, so make it the last entry. * 15b1:0004 also exists, it's Olimex OpenOCD JTAG TINY" aka ARM-USB-TINY, the unbuffered version. No reason to omit support for it. --- src/platforms/hosted/ftdi_bmp.c | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/src/platforms/hosted/ftdi_bmp.c b/src/platforms/hosted/ftdi_bmp.c index ecef0ba8b3d..b9915866df4 100644 --- a/src/platforms/hosted/ftdi_bmp.c +++ b/src/platforms/hosted/ftdi_bmp.c @@ -187,13 +187,6 @@ const cable_desc_s cable_desc[] = { .name = "ftdiswd", .description = "FTDISWD", }, - { - .vendor = 0x15b1U, - .product = 0x0003U, - .interface = INTERFACE_A, - .init.dirs[0] = PIN5, - .name = "olimex", - }, { /* * Buffered connection from FTDI to JTAG/SWD. @@ -380,6 +373,32 @@ const cable_desc_s cable_desc[] = { .name = "arm-usb-tiny-h", .description = "Olimex OpenOCD JTAG ARM-USB-TINY-H", }, + { + /* + * https://www.olimex.com/Products/ARM/JTAG/_resources/ARM-USB-TINY_and_TINY_H_manual.pdf + * JTAG-only, unbuffered. + */ + .vendor = 0x15baU, + .product = 0x0004U, + .interface = INTERFACE_A, + .description = "Olimex OpenOCD JTAG TINY", + .name = "arm-usb-tiny", + }, + { + /* + * https://www.olimex.com/Products/ARM/JTAG/_resources/ARM-USB-OCD.pdf + * https://www.olimex.com/Products/ARM/JTAG/_resources/ARM-USB-OCD_and_OCD_H_manual.pdf + * DBUS 4 (active-low) enables output buffers. + * DBUS 6 is TSRST in (sense), CBUS 1 is TSRST out. + * CBUS 0 is TRST, CBUS 2 is TRST buffer-enable. CBUS 3 is red LED. + */ + .vendor = 0x15baU, + .product = 0x0003U, + .interface = INTERFACE_A, + .init.dirs[0] = PIN4, + .description = "Olimex OpenOCD JTAG", + .name = "arm-usb-ocd", + }, {0}, }; From 116a72e75204179bcdfa49e5426466652bb68437 Mon Sep 17 00:00:00 2001 From: ALTracer <11005378+ALTracer@users.noreply.github.com> Date: Wed, 18 Feb 2026 19:59:39 +0300 Subject: [PATCH 6/6] fixup! hosted: Allow Olimex adapters through the filter (VID is 0x15ba not 0x0403) --- src/platforms/hosted/bmp_libusb.c | 5 ++++- src/platforms/hosted/platform.h | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/platforms/hosted/bmp_libusb.c b/src/platforms/hosted/bmp_libusb.c index c219aef0716..fb5ad14d925 100644 --- a/src/platforms/hosted/bmp_libusb.c +++ b/src/platforms/hosted/bmp_libusb.c @@ -80,7 +80,10 @@ static const debugger_device_s debugger_devices[] = { {VENDOR_ID_FTDI, PRODUCT_ID_FTDI_FT2232, PROBE_TYPE_FTDI, NULL, "FTDI FT2232"}, {VENDOR_ID_FTDI, PRODUCT_ID_FTDI_FT4232, PROBE_TYPE_FTDI, NULL, "FTDI FT4232"}, {VENDOR_ID_FTDI, PRODUCT_ID_FTDI_FT232, PROBE_TYPE_FTDI, NULL, "FTDI FT232"}, - {VENDOR_ID_OLIMEX, PRODUCT_ID_ANY, PROBE_TYPE_FTDI, NULL, "Olimex FTDI-based"}, + {VENDOR_ID_OLIMEX, PRODUCT_ID_OLIMEX_ARM_USB_OCD, PROBE_TYPE_FTDI, NULL, "Olimex ARM-USB-OCD"}, + {VENDOR_ID_OLIMEX, PRODUCT_ID_OLIMEX_ARM_USB_TINY, PROBE_TYPE_FTDI, NULL, "Olimex ARM-USB-TINY"}, + {VENDOR_ID_OLIMEX, PRODUCT_ID_OLIMEX_ARM_USB_TINY_H, PROBE_TYPE_FTDI, NULL, "Olimex ARM-USB-TINY-H"}, + {VENDOR_ID_OLIMEX, PRODUCT_ID_OLIMEX_ARM_USB_OCD_H, PROBE_TYPE_FTDI, NULL, "Olimex ARM-USB-OCD-H"}, {0, 0, PROBE_TYPE_NONE, NULL, ""}, }; diff --git a/src/platforms/hosted/platform.h b/src/platforms/hosted/platform.h index acb72988357..57f3086b30e 100644 --- a/src/platforms/hosted/platform.h +++ b/src/platforms/hosted/platform.h @@ -83,7 +83,11 @@ void platform_buffer_flush(void); #define PRODUCT_ID_WCHLINK_DAP 0x8011U /* WCH-Link in mode DAP */ #define PRODUCT_ID_WCHLINKE_DAP 0x8012U /* WCH-LinkE in mode DAP */ -#define VENDOR_ID_OLIMEX 0x15baU +#define VENDOR_ID_OLIMEX 0x15baU +#define PRODUCT_ID_OLIMEX_ARM_USB_OCD 0x0003U +#define PRODUCT_ID_OLIMEX_ARM_USB_TINY 0x0004U +#define PRODUCT_ID_OLIMEX_ARM_USB_TINY_H 0x002aU +#define PRODUCT_ID_OLIMEX_ARM_USB_OCD_H 0x002bU typedef enum probe_type { PROBE_TYPE_NONE = 0,