summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
4cfc1f6)
- when start is adjusted, count should also be adjusted,
- then, count is rounded to the next multiple of word size.
unsigned count = strtoul(s_count, NULL, 16);
unsigned adj_start = start % 4;
unsigned count = strtoul(s_count, NULL, 16);
unsigned adj_start = start % 4;
+ unsigned count_rnd = (count + adj_start + 4 - 1) / 4 * 4;
- stlink_read_mem32(sl, start - adj_start, (count % 4 == 0) ?
- count : count + 4 - (count % 4));
+ stlink_read_mem32(sl, start - adj_start, count_rnd);
reply = calloc(count * 2 + 1, 1);
for(unsigned int i = 0; i < count; i++) {
reply = calloc(count * 2 + 1, 1);
for(unsigned int i = 0; i < count; i++) {