From 0644042b940cc281c67cc1b48844d7e3d7045673 Mon Sep 17 00:00:00 2001 From: Alex Taradov Date: Wed, 2 Mar 2022 16:04:07 -0800 Subject: [PATCH] Added new info strings and version information --- bin/free_dap_rp2040.uf2 | Bin 22528 -> 22528 bytes dap.c | 113 ++++++++++++++++++++----------- platform/rp2040/dap_config.h | 5 +- platform/samd11/dap_config.h | 34 +--------- platform/samd11_vcp/dap_config.h | 34 +--------- platform/samd21/dap_config.h | 34 +--------- platform/same70/dap_config.h | 40 +++-------- 7 files changed, 94 insertions(+), 166 deletions(-) diff --git a/bin/free_dap_rp2040.uf2 b/bin/free_dap_rp2040.uf2 index bdf70ef2053ffb8024becc1d4f4bd34797b2a1b0..0bdab3354feaba88b144616b1304cbcae61a78e1 100644 GIT binary patch delta 1754 zcmZ8iVN6q36u#&66?x7=3l>Uc@@OqQ5uqIwk)T!>wrg=#K&QeI>YQVV%Sxgdn=o0N zKX6&p-E1+LSzO|eX-q_~WG(?yr^$423k@TIi3x5dH7c8nS*q6gc228*B>CPs=R5bD zd(OGHmw_P|7=lC77OjG*449cQrjmZ^@NBjGX>{EsUJBQF3jQ%QEMaOkdY&MB;*qo( zOcA7r-i*+Av)r_TLUo<7Ff!nPkUbjpQxJ1VA$yk;vUNrMyU^}Mn1_9(5McMe(aocM z{GwcFJ^j#Esxo$eKQeAyF@oq5v+{BS#?eAf`P32jEP6i3BTsXhdiOdsyGVcROim7>TfwFTcQ@5jI8*k1z2s_0@ z&K^*bMmwA*i zbGWyfspo|yzXTwkd*=V7oOfeZatN^Q0gUZ0Xu|Ksf=GZ^ z#=$~47?{HpmW|lO-?W#QVwea*1FR?<^~c1ZyUQS`S41m|&ITV@atH7aSjfWL_-l7d1+t@&2+l{Km^x zgC;EHpF!I2@L#nYByMOOU>d@7ZbTo#%bP2lFeKis$d#%F|%= zqDt$@)rmNcXb>B!7DzAGJ)>#KQ3RzXH$@-ggKoca4K>$Yf`|#rvh`r04WHN7fO;qIsoks4hE&dR@u>D7q)qB+ znjfxn8mY@M{zF|2OpDn%KR_E_R$p$_kfsi&5wtjxhw;3pKHqo@t)pVF9dN+Z;tK@hJDhtOXgn{6cD{sb4!Ru_?*4eH0GA%c*CoiVvhCnUqh80)O z>dC&RV+rQGmjLITgyg)P0I!}LO5IMx)`s!UU*>PG?Rd2x-<9;)VyQF_DxGFSZKS7+ zk`CzkXqVwgX}r5p(ujvqW=i(Eis{;{$zrV2NbC`_gJc6Km z7eib@(2!}^b%-cG5$MR2^O{S7ajv!;=O=?(GgQdM?*wXjeap`odz~xm3k#bWRCq8L z;H|Hp$J0b?NIYoF7(VZ%MXP|fXrWXlw|q$P1Ik3LM6rrkpiC=P=YmU0Ml$weSxNS7oESBc z=_2O1geAtfgdd$T8Sae4CBxvxGM6~F#*s*z8;d5mOfpDxMXTODZ;OAt$#c*9KJR%y z@9Amx0Cf*g@9%bfnJ@$iT?k>YeD&mHmF3L+6_2EwZptK0XO}J)##Dtc?!f9%54DYy z-2{qhKcLG7OZ_@_HBBLWV5pdau4pvCPNG-~x*}T88Hon=VowCn2mNkp6jNtReW*iT zw&XiLpYgj5A*POiabib5(4i(RYbm>cMSz2q%IeHf8c=iQ*ev8z_W28F(_^nN4399p zNG$y1zY1^?PR73M$Hj4}9)Qc{6pdK9qbAv&^&b7L#}~T3~3F4LK($tVVP8 zk*yho_)Cnps8{p}aOGoU?kF;ci!*|)!WGengwR8g zDq);e_Ju`6R$0C1N84G{oiZqL>?8Q@&#TA#a$Y_~)L7mjvW}yxh-`P}(_Zy~^E%l% zh9Et}ZgYXX@>N$+b_{_i*ewb|(LhY~xXLvuP!|fTw2FRM-bN4(q+<*-fCW3h-=hzT z<@BpC`U3jU@Ya~J73CAfq}wRT`66iuGjU^v4bv5})u^0z7jb5QdtUjm;mTwc;yI%^ z_Z~z-8`B&e@?EdWbXU?mmPKPUfB<#HA8FGS>QeECq}}(Z+S1J$>2m+lop{HWZX{jV z%a2h?sg~C~IUsI%+9_wE34dyJ+51f{p zYSuo-9I2^)jv1|~N-^i*F#yDref4&-bHZo!l|tSkyVe}AaY8QVxO%we1f^8&X+)m% zl~}pUi}D-aDjHFfz5r2!TwPo4&_Q#DBLHu1&xOD2s$FP33hl7!sl^fKlNZ*nvT=9Z z*C{!&XC$0PGD>L!gQ+;U4lNtZlXC~sw48u%ZOFo!*>aoP1fVq++A$%AcmoDU9e~K})*iK$%?M=xP7+krls^ElEeyZPDg*b%qKvkiFqvBM;hzC49y6B`@%Y@f~5A%Q8ErYuZ(&*Fk9q3TGq9 P9lL*#k=<@-ygdFtf@tuz diff --git a/dap.c b/dap.c index 718967d..afb3fca 100644 --- a/dap.c +++ b/dap.c @@ -34,6 +34,8 @@ #include "dap.h" /*- Definitions -------------------------------------------------------------*/ +#define ARRAY_SIZE(x) ((int)(sizeof(x) / sizeof(0[x]))) + enum { ID_DAP_INFO = 0x00, @@ -83,17 +85,33 @@ enum DAP_INFO_VENDOR = 0x01, DAP_INFO_PRODUCT = 0x02, DAP_INFO_SER_NUM = 0x03, - DAP_INFO_FW_VER = 0x04, // DAP_INFO_CMSIS_DAP_VER + DAP_INFO_CMSIS_DAP_VER = 0x04, DAP_INFO_DEVICE_VENDOR = 0x05, DAP_INFO_DEVICE_NAME = 0x06, - DAP_INFO_PRODUCT_FW_VER = 0x07, + DAP_INFO_BOARD_VENDOR = 0x07, + DAP_INFO_BOARD_NAME = 0x08, + DAP_INFO_FW_VER = 0x09, DAP_INFO_CAPABILITIES = 0xf0, - DAP_INFO_TIMESTAMP_CLOCK = 0xf1, - DAP_INFO_SWO_BUFFER_SIZE = 0xfd, + DAP_INFO_TDT = 0xf1, + DAP_INFO_UART_RX_SIZE = 0xfb, + DAP_INFO_UART_TX_SIZE = 0xfc, + DAP_INFO_SWO_BUF_SIZE = 0xfd, DAP_INFO_PACKET_COUNT = 0xfe, DAP_INFO_PACKET_SIZE = 0xff, }; +enum +{ + DAP_CAP_SWD = (1 << 0), + DAP_CAP_JTAG = (1 << 1), + DAP_CAP_SWO_UART = (1 << 2), + DAP_CAP_SWO_MANCHESTER = (1 << 3), + DAP_CAP_ATOMIC_CMD = (1 << 4), + DAP_CAP_TDT = (1 << 5), + DAP_CAP_SWO_STREAMING = (1 << 6), + DAP_CAP_UART_COM_PORT = (1 << 7), +}; + enum { DAP_TRANSFER_APnDP = 1 << 0, @@ -172,14 +190,39 @@ enum #define ARM_JTAG_IR_LENGTH 4 /*- Constants ---------------------------------------------------------------*/ -static const char * const dap_info_strings[] = +static const struct { - [DAP_INFO_VENDOR] = DAP_CONFIG_VENDOR_STR, - [DAP_INFO_PRODUCT] = DAP_CONFIG_PRODUCT_STR, - [DAP_INFO_SER_NUM] = DAP_CONFIG_SER_NUM_STR, - [DAP_INFO_FW_VER] = DAP_CONFIG_FW_VER_STR, - [DAP_INFO_DEVICE_VENDOR] = DAP_CONFIG_DEVICE_VENDOR_STR, - [DAP_INFO_DEVICE_NAME] = DAP_CONFIG_DEVICE_NAME_STR, + int id; + char * const str; +} dap_info_strings[] = +{ +#ifdef DAP_CONFIG_VENDOR_STR + { DAP_INFO_VENDOR, DAP_CONFIG_VENDOR_STR }, +#endif +#ifdef DAP_CONFIG_PRODUCT_STR + { DAP_INFO_PRODUCT, DAP_CONFIG_PRODUCT_STR }, +#endif +#ifdef DAP_CONFIG_SER_NUM_STR + { DAP_INFO_SER_NUM, DAP_CONFIG_SER_NUM_STR }, +#endif +#ifdef DAP_CONFIG_CMSIS_DAP_VER_STR + { DAP_INFO_CMSIS_DAP_VER, DAP_CONFIG_CMSIS_DAP_VER_STR }, +#endif +#ifdef DAP_CONFIG_DEVICE_VENDOR_STR + { DAP_INFO_DEVICE_VENDOR, DAP_CONFIG_DEVICE_VENDOR_STR }, +#endif +#ifdef DAP_CONFIG_DEVICE_NAME_STR + { DAP_INFO_DEVICE_NAME, DAP_CONFIG_DEVICE_NAME_STR }, +#endif +#ifdef DAP_CONFIG_BOARD_VENDOR_STR + { DAP_INFO_BOARD_VENDOR, DAP_CONFIG_BOARD_VENDOR_STR }, +#endif +#ifdef DAP_CONFIG_BOARD_NAME_STR + { DAP_INFO_BOARD_NAME, DAP_CONFIG_BOARD_NAME_STR }, +#endif +#ifdef DAP_CONFIG_FW_VER_STR + { DAP_INFO_FW_VER, DAP_CONFIG_FW_VER_STR }, +#endif }; /*- Variables ---------------------------------------------------------------*/ @@ -753,30 +796,11 @@ static void dap_info(void) { int index = dap_req_get_byte(); - if (DAP_INFO_VENDOR <= index && index <= DAP_INFO_DEVICE_NAME) + if (DAP_INFO_CAPABILITIES == index) { - if (dap_info_strings[index]) - { - const char *str = dap_info_strings[index]; - - dap_resp_add_byte(0); // Size placeholder - - while (*str) - dap_resp_add_byte(*str++); - dap_resp_add_byte(0); - - dap_resp_set_byte(1, dap_resp_ptr-1); - } - else - { - dap_resp_add_byte(0); - } - } - else if (DAP_INFO_CAPABILITIES == index) - { - int cap = DAP_PORT_SWD; + int cap = DAP_CAP_SWD; #ifdef DAP_CONFIG_ENABLE_JTAG - cap |= DAP_PORT_JTAG; + cap |= DAP_CAP_JTAG; #endif dap_resp_add_byte(1); dap_resp_add_byte(cap); @@ -794,7 +818,23 @@ static void dap_info(void) } else { - dap_resp_add_byte(0); + dap_resp_add_byte(0); // Size placeholder + + for (int i = 0; i < ARRAY_SIZE(dap_info_strings); i++) + { + if (dap_info_strings[i].id == index) + { + const char *str = dap_info_strings[i].str; + + while (*str) + dap_resp_add_byte(*str++); + dap_resp_add_byte(0); + + dap_resp_set_byte(1, dap_resp_ptr-1); + + break; + } + } } } @@ -1411,7 +1451,6 @@ int dap_process_request(uint8_t *req, int req_size, uint8_t *resp, int resp_size { ID_DAP_JTAG_SEQUENCE, dap_jtag_sequence }, { ID_DAP_JTAG_CONFIGURE, dap_jtag_configure }, { ID_DAP_JTAG_IDCODE, dap_jtag_idcode }, - { -1, NULL }, }; int cmd; @@ -1426,7 +1465,7 @@ int dap_process_request(uint8_t *req, int req_size, uint8_t *resp, int resp_size cmd = dap_req_get_byte(); dap_resp_add_byte(cmd); - for (int i = 0; -1 != handlers[i].cmd; i++) + for (int i = 0; i < ARRAY_SIZE(handlers); i++) { if (cmd == handlers[i].cmd) { @@ -1468,5 +1507,3 @@ void dap_clock_test(int delay) dap_swj_run_fast(1<<30); } } - - diff --git a/platform/rp2040/dap_config.h b/platform/rp2040/dap_config.h index 042e4d3..8ddd1ab 100644 --- a/platform/rp2040/dap_config.h +++ b/platform/rp2040/dap_config.h @@ -19,14 +19,11 @@ #define DAP_CONFIG_JTAG_DEV_COUNT 8 -// Set the value to NULL if you want to disable a string // DAP_CONFIG_PRODUCT_STR must contain "CMSIS-DAP" to be compatible with the standard #define DAP_CONFIG_VENDOR_STR "Alex Taradov" #define DAP_CONFIG_PRODUCT_STR "Generic CMSIS-DAP Adapter" #define DAP_CONFIG_SER_NUM_STR usb_serial_number -#define DAP_CONFIG_FW_VER_STR "v1.0" -#define DAP_CONFIG_DEVICE_VENDOR_STR NULL -#define DAP_CONFIG_DEVICE_NAME_STR NULL +#define DAP_CONFIG_CMSIS_DAP_VER_STR "1.3.0" //#define DAP_CONFIG_RESET_TARGET_FN target_specific_reset_function //#define DAP_CONFIG_VENDOR_FN vendor_command_handler_function diff --git a/platform/samd11/dap_config.h b/platform/samd11/dap_config.h index 3616669..811f52e 100644 --- a/platform/samd11/dap_config.h +++ b/platform/samd11/dap_config.h @@ -1,30 +1,5 @@ -/* - * Copyright (c) 2017-2021, Alex Taradov - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2017-2022, Alex Taradov . All rights reserved. #ifndef _DAP_CONFIG_H_ #define _DAP_CONFIG_H_ @@ -50,14 +25,11 @@ HAL_GPIO_PIN(nRESET, A, 5) #define DAP_CONFIG_JTAG_DEV_COUNT 8 -// Set the value to NULL if you want to disable a string // DAP_CONFIG_PRODUCT_STR must contain "CMSIS-DAP" to be compatible with the standard #define DAP_CONFIG_VENDOR_STR "Alex Taradov" #define DAP_CONFIG_PRODUCT_STR "Generic CMSIS-DAP Adapter" #define DAP_CONFIG_SER_NUM_STR usb_serial_number -#define DAP_CONFIG_FW_VER_STR "v1.0" -#define DAP_CONFIG_DEVICE_VENDOR_STR NULL -#define DAP_CONFIG_DEVICE_NAME_STR NULL +#define DAP_CONFIG_CMSIS_DAP_VER_STR "1.3.0" //#define DAP_CONFIG_RESET_TARGET_FN target_specific_reset_function //#define DAP_CONFIG_VENDOR_FN vendor_command_handler_function diff --git a/platform/samd11_vcp/dap_config.h b/platform/samd11_vcp/dap_config.h index e40ef47..d7c1df6 100644 --- a/platform/samd11_vcp/dap_config.h +++ b/platform/samd11_vcp/dap_config.h @@ -1,30 +1,5 @@ -/* - * Copyright (c) 2017, Alex Taradov - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2017-2022, Alex Taradov . All rights reserved. #ifndef _DAP_CONFIG_H_ #define _DAP_CONFIG_H_ @@ -42,14 +17,11 @@ #define DAP_CONFIG_JTAG_DEV_COUNT 8 -// Set the value to NULL if you want to disable a string // DAP_CONFIG_PRODUCT_STR must contain "CMSIS-DAP" to be compatible with the standard #define DAP_CONFIG_VENDOR_STR "Alex Taradov" #define DAP_CONFIG_PRODUCT_STR "Generic CMSIS-DAP Adapter" #define DAP_CONFIG_SER_NUM_STR usb_serial_number -#define DAP_CONFIG_FW_VER_STR "v1.0" -#define DAP_CONFIG_DEVICE_VENDOR_STR NULL -#define DAP_CONFIG_DEVICE_NAME_STR NULL +#define DAP_CONFIG_CMSIS_DAP_VER_STR "1.3.0" //#define DAP_CONFIG_RESET_TARGET_FN target_specific_reset_function //#define DAP_CONFIG_VENDOR_FN vendor_command_handler_function diff --git a/platform/samd21/dap_config.h b/platform/samd21/dap_config.h index 04e81bf..063801c 100644 --- a/platform/samd21/dap_config.h +++ b/platform/samd21/dap_config.h @@ -1,30 +1,5 @@ -/* - * Copyright (c) 2016, Alex Taradov - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2016-2022, Alex Taradov . All rights reserved. #ifndef _DAP_CONFIG_H_ #define _DAP_CONFIG_H_ @@ -53,14 +28,11 @@ HAL_GPIO_PIN(LED, B, 30) #define DAP_CONFIG_JTAG_DEV_COUNT 8 -// Set the value to NULL if you want to disable a string // DAP_CONFIG_PRODUCT_STR must contain "CMSIS-DAP" to be compatible with the standard #define DAP_CONFIG_VENDOR_STR "Alex Taradov" #define DAP_CONFIG_PRODUCT_STR "Generic CMSIS-DAP Adapter" #define DAP_CONFIG_SER_NUM_STR "123456" -#define DAP_CONFIG_FW_VER_STR "v0.1" -#define DAP_CONFIG_DEVICE_VENDOR_STR NULL -#define DAP_CONFIG_DEVICE_NAME_STR NULL +#define DAP_CONFIG_CMSIS_DAP_VER_STR "1.3.0" //#define DAP_CONFIG_RESET_TARGET_FN target_specific_reset_function //#define DAP_CONFIG_VENDOR_FN vendor_command_handler_function diff --git a/platform/same70/dap_config.h b/platform/same70/dap_config.h index f92dc92..b6bdfb4 100644 --- a/platform/same70/dap_config.h +++ b/platform/same70/dap_config.h @@ -1,30 +1,5 @@ -/* - * Copyright (c) 2020, Alex Taradov - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2020-2022, Alex Taradov . All rights reserved. #ifndef _DAP_CONFIG_H_ #define _DAP_CONFIG_H_ @@ -48,14 +23,11 @@ HAL_GPIO_PIN(nRESET, D, 22) #define DAP_CONFIG_JTAG_DEV_COUNT 8 -// Set the value to NULL if you want to disable a string // DAP_CONFIG_PRODUCT_STR must contain "CMSIS-DAP" to be compatible with the standard #define DAP_CONFIG_VENDOR_STR "Alex Taradov" #define DAP_CONFIG_PRODUCT_STR "Generic CMSIS-DAP Adapter" #define DAP_CONFIG_SER_NUM_STR usb_serial_number -#define DAP_CONFIG_FW_VER_STR "v1.0" -#define DAP_CONFIG_DEVICE_VENDOR_STR NULL -#define DAP_CONFIG_DEVICE_NAME_STR NULL +#define DAP_CONFIG_CMSIS_DAP_VER_STR "1.3.0" //#define DAP_CONFIG_RESET_TARGET_FN target_specific_reset_function //#define DAP_CONFIG_VENDOR_FN vendor_command_handler_function @@ -87,6 +59,12 @@ static inline void DAP_CONFIG_SWDIO_TMS_write(int value) HAL_GPIO_SWDIO_TMS_write(value); } +//----------------------------------------------------------------------------- +static inline void DAP_CONFIG_TDI_write(int value) +{ + (void)value; +} + //----------------------------------------------------------------------------- static inline void DAP_CONFIG_TDO_write(int value) {