Skip to content

Commit

Permalink
hosted/dap: Resized the block buffers in `dap_mem_{read,write}_block(…
Browse files Browse the repository at this point in the history
…)` to exactly fit the max amount transferrable in a go and nothing more
  • Loading branch information
dragonmux committed Nov 15, 2024
1 parent dae38ac commit d3f9f6f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/platforms/hosted/dap.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ bool dap_mem_read_block(
{
/* Try to read the 32-bit blocks requested */
const size_t blocks = len >> MIN(align, 2U);
uint32_t data[256U] = {0U};
uint32_t data[127U] = {0U};
const bool result = perform_dap_transfer_block_read(target_ap->dp, SWD_AP_DRW, blocks, data);

/* Unpack the data from those blocks */
Expand All @@ -287,7 +287,7 @@ bool dap_mem_write_block(
adiv5_access_port_s *const target_ap, target_addr64_t dest, const void *src, const size_t len, const align_e align)
{
const size_t blocks = len >> MIN(align, 2U);
uint32_t data[256U];
uint32_t data[126U];

/* Pack the data to send into 32-bit blocks */
if (align > ALIGN_16BIT)
Expand Down

0 comments on commit d3f9f6f

Please sign in to comment.