From: Fabien Le Mentec Date: Sun, 16 Oct 2011 21:28:29 +0000 (-0500) Subject: [fix] stlink_usb_read_mem32 len command field X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=7b0136b10fc4eb9a52f20a3bc1734d4585bd0bdd;p=fw%2Fstlink [fix] stlink_usb_read_mem32 len command field --- diff --git a/src/stlink-usb.c b/src/stlink-usb.c index 2ed5320..533a632 100644 --- a/src/stlink-usb.c +++ b/src/stlink-usb.c @@ -398,10 +398,8 @@ void _stlink_usb_read_mem32(stlink_t *sl, uint32_t addr, uint16_t len) { buf[0] = STLINK_DEBUG_COMMAND; buf[1] = STLINK_DEBUG_READMEM_32BIT; write_uint32(buf + 2, addr); - /* windows usb logs show only one byte is used for length ... */ - // Presumably, this is because usb transfers can't be 16 bits worth of bytes long... - assert (len < 256); buf[6] = (uint8_t) len; + buf[7] = (uint8_t) (len >> 8); size = send_recv(slu, buf, STLINK_CMD_SIZE, buf, sizeof (sl->q_buf)); if (size == -1) {