Merge pull request #6 from whitequark/master
authortexane <texane@gmail.com>
Tue, 28 Jun 2011 05:22:07 +0000 (22:22 -0700)
committertexane <texane@gmail.com>
Tue, 28 Jun 2011 05:22:07 +0000 (22:22 -0700)
Bugfixes

10-stlink.rules
AUTHORS
README
src/gdb-remote.c
src/stlink-hw.c
stlink.modprobe.conf [new file with mode: 0644]

index a47b2f9de30d33ba519e72fdf331ad4f4eb4864f..2413acd8eaeb26093dae7d81a1ddf6a8caafd03b 100644 (file)
@@ -32,7 +32,7 @@ SUBSYSTEMS=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="3744", \
 # Other possible settings:
 # OPTIONS="last_rule", ATTRS{vendor}=="STM32"
 
-KERNEL=="sg[0-9]*", STLINK=="1", MODE="0664", GROUP:="tape", \
+KERNEL=="sg[0-9]*", MODE="0664", GROUP:="tape", \
   NAME+="stlink-sg%n", SYMLINK+="stlink", \
   ENV{UDISKS_PRESENTATION_HIDE}:="1", \
   ENV{UDISKS_PRESENTATION_NOPOLICY}:="1", \
diff --git a/AUTHORS b/AUTHORS
index b7fbf6a401cfe7919f3ee6970a2c0454d994aecc..8335e9b49b920dc08e95de07f041dc470290ef99 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -2,3 +2,4 @@ Martin Capitanio <m@capitanio.org>
 Spencer Oliver <spen@spen-soft.co.uk>
 Le Mentec Fabien <fabien.lementec@gmail.com>
 Peter Zotov <whitequark@whitequark.org>
+Greg Alexander <grestm@galexander.org>
diff --git a/README b/README
index 58bd3ca2ae26236cd83c28fd9a38b13e19c93d26..fbd75c10744bdcd50f663a24d02378029c825693 100644 (file)
--- a/README
+++ b/README
@@ -4,6 +4,9 @@ HOWTO
 First, load the sg kernel module.
 # modprobe sg
 
+On Ubuntu you need to install the package libsgutils2-dev:
+# sudo apt-get install libsgutils2-dev
+
 To run the gdb server, do (you do not need sudo if you have set up
 permissions correctly):
 $ make -C build && sudo ./build/st-util 1234 /dev/sg1
index 474af9dcc46f9c04d1f799331466722194f8e1c1..f6bf02d26a82c0faaaa45196e885fe8d8eeddc25 100644 (file)
@@ -130,7 +130,7 @@ start:
        packet_buffer[packet_idx] = 0;
        *buffer = packet_buffer;
 
-       return packet_size;
+       return packet_idx;
 }
 
 // Here we skip any characters which are not \x03, GDB interrupt.
index dab59f1c1380710bd5cff7892a81c74ab59df705..9e9996c36688e68313e07e20fb0062d6418a2972 100644 (file)
@@ -1417,7 +1417,7 @@ int stlink_write_flash(struct stlink* sl, stm32_addr_t addr, uint8_t* base, unsi
       size = len - off;
 
     if(run_flash_loader(sl, &fl, addr + off, base + off, size) == -1) {
-      fprintf(stderr, "run_flash_loader(0x%x) == -1\n", addr + off);
+      fprintf(stderr, "run_flash_loader(0x%zx) == -1\n", addr + off);
       return -1;
     }
   }
@@ -1488,7 +1488,7 @@ static int stlink_fwrite_flash
     /* addr must be an addr inside the page */
     if (stlink_erase_flash_page(sl, addr + off) == -1)
     {
-      fprintf(stderr, "erase_flash_page(0x%x) == -1\n", addr + off);
+      fprintf(stderr, "erase_flash_page(0x%zx) == -1\n", addr + off);
       goto on_error;
     }
   }
@@ -1511,7 +1511,7 @@ static int stlink_fwrite_flash
 
     if (run_flash_loader(sl, &fl, addr + off, mf.base + off, size) == -1)
     {
-      fprintf(stderr, "run_flash_loader(0x%x) == -1\n", addr + off);
+      fprintf(stderr, "run_flash_loader(0x%zx) == -1\n", addr + off);
       goto on_error;
     }
   }
diff --git a/stlink.modprobe.conf b/stlink.modprobe.conf
new file mode 100644 (file)
index 0000000..e918c90
--- /dev/null
@@ -0,0 +1 @@
+options usb-storage quirks=483:3744:l