dap: add Konfig option to set maximum packet size
This also fixes a bug where the packet size returned was only 17 byte. Signed-off-by: Johan Carlsson <johan.carlsson@teenage.engineering>
This commit is contained in:
parent
7c9259abbc
commit
e46e72320e
2 changed files with 10 additions and 3 deletions
|
|
@ -17,6 +17,13 @@ config CMSIS_DAP_PACKET_COUNT
|
||||||
help
|
help
|
||||||
Maximum packet buffers for request and response data.
|
Maximum packet buffers for request and response data.
|
||||||
|
|
||||||
|
config CMSIS_DAP_PACKET_SIZE
|
||||||
|
int "Maximum packet size for request and response data."
|
||||||
|
default 64
|
||||||
|
range 64 512
|
||||||
|
help
|
||||||
|
Maximum packet size for request and response data.
|
||||||
|
|
||||||
module = DAP
|
module = DAP
|
||||||
module-str = dap
|
module-str = dap
|
||||||
source "subsys/logging/Kconfig.template.log_config"
|
source "subsys/logging/Kconfig.template.log_config"
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ struct dap_context {
|
||||||
atomic_t state;
|
atomic_t state;
|
||||||
uint8_t debug_port;
|
uint8_t debug_port;
|
||||||
uint8_t capabilities;
|
uint8_t capabilities;
|
||||||
uint8_t pkt_size;
|
uint16_t pkt_size;
|
||||||
struct {
|
struct {
|
||||||
/* Idle cycles after transfer */
|
/* Idle cycles after transfer */
|
||||||
uint8_t idle_cycles;
|
uint8_t idle_cycles;
|
||||||
|
|
@ -88,7 +88,7 @@ static uint16_t dap_info(struct dap_context *const ctx,
|
||||||
break;
|
break;
|
||||||
case DAP_ID_PACKET_SIZE:
|
case DAP_ID_PACKET_SIZE:
|
||||||
LOG_DBG("ID_PACKET_SIZE");
|
LOG_DBG("ID_PACKET_SIZE");
|
||||||
sys_put_le16(ctx->capabilities, &info[0]);
|
sys_put_le16(ctx->pkt_size, &info[0]);
|
||||||
length = 2U;
|
length = 2U;
|
||||||
break;
|
break;
|
||||||
case DAP_ID_PACKET_COUNT:
|
case DAP_ID_PACKET_COUNT:
|
||||||
|
|
@ -912,7 +912,7 @@ int dap_setup(const struct device *const dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Default settings */
|
/* Default settings */
|
||||||
dap_ctx[0].pkt_size = 64U;
|
dap_ctx[0].pkt_size = CONFIG_CMSIS_DAP_PACKET_SIZE;
|
||||||
dap_ctx[0].debug_port = 0U;
|
dap_ctx[0].debug_port = 0U;
|
||||||
dap_ctx[0].transfer.idle_cycles = 0U;
|
dap_ctx[0].transfer.idle_cycles = 0U;
|
||||||
dap_ctx[0].transfer.retry_count = 100U;
|
dap_ctx[0].transfer.retry_count = 100U;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue