This is an automated email from Gerrit. Anonymous Coward ([email protected]) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/478
-- gerrit commit bfbc1b8a0e350e83de975fb57b3c7b2aa9adf3d9 Author: Szymon Modzelewski <[email protected]> Date: Tue Feb 21 13:44:00 2012 +0100 stlink-v1: fix memory writes change the stlink_usb_write_mem functions to use stlink_usb_send using two calls to stlink_usb_recv is inappropriate since each call issues a SG command on stlink-v1, resulting in errors Change-Id: I52ff9ee8f5d9ae0d47356477468eb98952205c99 Signed-off-by: Szymon Modzelewski <[email protected]> diff --git a/src/jtag/drivers/stlink_usb.c b/src/jtag/drivers/stlink_usb.c index c0a93c8..e3c005e 100644 --- a/src/jtag/drivers/stlink_usb.c +++ b/src/jtag/drivers/stlink_usb.c @@ -978,12 +978,7 @@ static int stlink_usb_write_mem8(void *handle, uint32_t addr, uint16_t len, h_u32_to_le(h->txbuf + 2, addr); h_u16_to_le(h->txbuf + 2 + 4, len); - res = stlink_usb_recv(handle, h->txbuf, STLINK_CMD_SIZE, 0, 0); - - if (res != ERROR_OK) - return res; - - res = stlink_usb_recv(handle, (uint8_t *) buffer, len, 0, 0); + res = stlink_usb_send(handle, h->txbuf, STLINK_CMD_SIZE, (uint8_t *) buffer, len); if (res != ERROR_OK) return res; @@ -1041,12 +1036,7 @@ static int stlink_usb_write_mem32(void *handle, uint32_t addr, uint16_t len, h_u32_to_le(h->txbuf + 2, addr); h_u16_to_le(h->txbuf + 2 + 4, len); - res = stlink_usb_recv(handle, h->txbuf, STLINK_CMD_SIZE, 0, 0); - - if (res != ERROR_OK) - return res; - - res = stlink_usb_recv(handle, (uint8_t *) buffer, len, 0, 0); + res = stlink_usb_send(handle, h->txbuf, STLINK_CMD_SIZE, (uint8_t *) buffer, len); if (res != ERROR_OK) return res; -- ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ OpenOCD-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openocd-devel
