]> git.gag.com Git - fw/stlink/blobdiff - gdbserver/gdb-server.c
be quicker about determining erased byte pattern when flashing
[fw/stlink] / gdbserver / gdb-server.c
index b272f4caa751bd418aad96448440134bf27ef79f..ef289f282a8789579cbeaa543330d36077284d1e 100644 (file)
@@ -9,7 +9,6 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-#include <signal.h>
 #include <unistd.h>
 #include <sys/types.h>
 #ifdef __MINGW32__
@@ -186,6 +185,7 @@ int main(int argc, char** argv) {
     connected_stlink = sl;
     signal(SIGINT, &cleanup);
     signal(SIGTERM, &cleanup);
+    signal(SIGSEGV, &cleanup);
 
     if (state.reset) {
         stlink_reset(sl);
@@ -752,7 +752,7 @@ static int flash_go(stlink_t *sl) {
             DLOG("flash_do: page %08x\n", page);
             unsigned send = length > FLASH_PAGE ? FLASH_PAGE : length;
             if(stlink_write_flash(sl, page, fb->data + (page - fb->addr),
-                        send) < 0)
+                        send, 0) < 0)
                 goto error;
             length -= send;