From 8774a9edaf5096ff7631a3033cd4d0790f8cae62 Mon Sep 17 00:00:00 2001 From: Adrian Negreanu Date: Wed, 8 Dec 2021 11:02:29 +0200 Subject: [PATCH] DAP: fill the UART capability info only when DAP_UART=1 OpenOCD ends up considering info[1] as capabilities, which in this case is equal zero. Signed-off-by: Adrian Negreanu --- source/daplink/cmsis-dap/DAP.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/daplink/cmsis-dap/DAP.c b/source/daplink/cmsis-dap/DAP.c index 0710f5478..317d5330d 100644 --- a/source/daplink/cmsis-dap/DAP.c +++ b/source/daplink/cmsis-dap/DAP.c @@ -110,9 +110,11 @@ static uint8_t DAP_Info(uint8_t id, uint8_t *info) { ((TIMESTAMP_CLOCK != 0U) ? (1U << 5) : 0U) | ((SWO_STREAM != 0U) ? (1U << 6) : 0U) | ((DAP_UART != 0U) ? (1U << 7) : 0U); - + length = 1U; +#if (DAP_UART != 0) info[1] = ((DAP_UART_USB_COM_PORT != 0) ? (1U << 0) : 0U); length = 2U; +#endif break; case DAP_ID_TIMESTAMP_CLOCK: #if (TIMESTAMP_CLOCK != 0U)