h_u16_to_le(h->cmdbuf+h->cmdidx, len);
h->cmdidx += 2;
- res = stlink_usb_xfer(handle, (uint8_t *) buffer, len);
+ res = stlink_usb_xfer(handle, buffer, len);
if (res != ERROR_OK)
return res;
/** */
static int stlink_usb_read_mem32(void *handle, uint32_t addr, uint16_t len,
- uint32_t *buffer)
+ uint8_t *buffer)
{
int res;
struct stlink_usb_handle_s *h;
/** */
static int stlink_usb_write_mem32(void *handle, uint32_t addr, uint16_t len,
- const uint32_t *buffer)
+ const uint8_t *buffer)
{
int res;
struct stlink_usb_handle_s *h;
h_u16_to_le(h->cmdbuf+h->cmdidx, len);
h->cmdidx += 2;
- res = stlink_usb_xfer(handle, (uint8_t *) buffer, len);
+ res = stlink_usb_xfer(handle, buffer, len);
if (res != ERROR_OK)
return res;
const uint8_t *buffer);
/** */
int (*read_mem32) (void *handle, uint32_t addr, uint16_t len,
- uint32_t *buffer);
+ uint8_t *buffer);
/** */
int (*write_mem32) (void *handle, uint32_t addr, uint16_t len,
- const uint32_t *buffer);
+ const uint8_t *buffer);
/** */
int (*idcode) (void *fd, uint32_t *idcode);
/** */
int res;
uint32_t buffer_threshold = 128;
uint32_t addr_increment = 4;
- uint8_t *dst = buffer;
uint32_t c;
struct stlink_interface_s *stlink_if = target_to_stlink(target);
if (size != 4)
res = stlink_if->layout->api->read_mem8(stlink_if->fd,
- address, c, dst);
+ address, c, buffer);
else
res = stlink_if->layout->api->read_mem32(stlink_if->fd,
- address, c, (uint32_t *)dst);
+ address, c, buffer);
if (res != ERROR_OK)
return res;
address += (c * addr_increment);
- dst += (c * addr_increment);
+ buffer += (c * addr_increment);
count -= c;
}
int res;
uint32_t buffer_threshold = 128;
uint32_t addr_increment = 4;
- const uint8_t *dst = buffer;
uint32_t c;
struct stlink_interface_s *stlink_if = target_to_stlink(target);
if (size != 4)
res = stlink_if->layout->api->write_mem8(stlink_if->fd,
- address, c, dst);
+ address, c, buffer);
else
res = stlink_if->layout->api->write_mem32(stlink_if->fd,
- address, c, (uint32_t *)dst);
+ address, c, buffer);
if (res != ERROR_OK)
return res;
address += (c * addr_increment);
- dst += (c * addr_increment);
+ buffer += (c * addr_increment);
count -= c;
}