Skip to content
Browse files

Merge pull request #102 from prattmic/master

Fix the stlink-sg backend to leave space for new functions
  • Loading branch information...
2 parents fde8b6b + ca0f89c commit f4a83ff3951e2f2203a25de72ecb417f432056bf @texane committed Jul 9, 2012
Showing with 7 additions and 2 deletions.
  1. +4 −2 src/stlink-common.c
  2. +3 −0 src/stlink-sg.c
View
6 src/stlink-common.c
@@ -936,7 +936,9 @@ int stlink_fread(stlink_t* sl, const char* path, stm32_addr_t addr, size_t size)
}
/* Ignore NULL Bytes at end of file */
- ftruncate(fd, size - num_empty);
+ if (!ftruncate(fd, size - num_empty)) {
+ error = -1;
+ }
/* success */
error = 0;
@@ -1452,7 +1454,7 @@ int stlink_write_flash(stlink_t *sl, stm32_addr_t addr, uint8_t* base, unsigned
for(off = 0; off < len;) {
size_t size = len - off > 0x8000 ? 0x8000 : len - off;
- printf("size: %u\n", size);
+ printf("size: %zu\n", size);
if (run_flash_loader(sl, &fl, addr + off, base + off, size) == -1) {
WLOG("run_flash_loader(%#zx) failed! == -1\n", addr + off);
View
3 src/stlink-sg.c
@@ -872,6 +872,9 @@ stlink_backend_t _stlink_sg_backend = {
_stlink_sg_write_mem8,
_stlink_sg_read_all_regs,
_stlink_sg_read_reg,
+ NULL, /* read_all_unsupported_regs */
+ NULL, /* read_unsupported_regs */
+ NULL, /* write_unsupported_regs */
_stlink_sg_write_reg,
_stlink_sg_step,
_stlink_sg_current_mode,

0 comments on commit f4a83ff

Please sign in to comment.
Something went wrong with that request. Please try again.