Skip to content

Commit e31cdc0

Browse files
jfischer-noaescolar
authored andcommitted
dap: react properly to unsupported UART commands
Add ID_DAP_UART_* command definitions and react properly to unsupported UART commands. Signed-off-by: Maximilian Deubel <[email protected]> Signed-off-by: Johann Fischer <[email protected]>
1 parent 58d9d88 commit e31cdc0

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

subsys/dap/cmsis_dap.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,31 @@ static uint16_t dap_process_cmd(struct dap_context *const ctx,
922922
retval = 1;
923923
*response = DAP_ERROR;
924924
break;
925+
case ID_DAP_UART_TRANSPORT:
926+
LOG_ERR("UART Transport unsupported");
927+
retval = 1;
928+
*response = DAP_ERROR;
929+
break;
930+
case ID_DAP_UART_CONFIGURE:
931+
LOG_ERR("UART Configure unsupported");
932+
retval = 1;
933+
*response = DAP_ERROR;
934+
break;
935+
case ID_DAP_UART_CONTROL:
936+
LOG_ERR("UART Control unsupported");
937+
retval = 1;
938+
*response = DAP_ERROR;
939+
break;
940+
case ID_DAP_UART_STATUS:
941+
LOG_ERR("UART Status unsupported");
942+
retval = 1;
943+
*response = DAP_ERROR;
944+
break;
945+
case ID_DAP_UART_TRANSFER:
946+
LOG_ERR("UART Transfer unsupported");
947+
retval = 1;
948+
*response = DAP_ERROR;
949+
break;
925950

926951
default:
927952
*(response - 1) = ID_DAP_INVALID;

subsys/dap/cmsis_dap.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@
5454
#define ID_DAP_SWO_STATUS 0x1BU
5555
#define ID_DAP_SWO_DATA 0x1CU
5656

57+
#define ID_DAP_UART_TRANSPORT 0x1FU
58+
#define ID_DAP_UART_CONFIGURE 0x20U
59+
#define ID_DAP_UART_CONTROL 0x22U
60+
#define ID_DAP_UART_STATUS 0x23U
61+
#define ID_DAP_UART_TRANSFER 0x21U
62+
5763
#define ID_DAP_QUEUE_COMMANDS 0x7EU
5864
#define ID_DAP_EXECUTE_COMMANDS 0x7FU
5965

0 commit comments

Comments
 (0)