[fix] stlinkv2 missing initialisation
authorFabien Le Mentec <texane@gmail.com>
Sun, 16 Oct 2011 21:13:58 +0000 (16:13 -0500)
committerFabien Le Mentec <texane@gmail.com>
Sun, 16 Oct 2011 21:13:58 +0000 (16:13 -0500)
src/stlink-common.h
src/stlink-usb.c

index cb6c6cc09705ddbdebc7d7d0cfbde60746027729..9481609f6fc616e03836a4d23c1197f8112ef116 100644 (file)
@@ -175,6 +175,7 @@ extern "C" {
         /* sram settings */
 #define STM32_SRAM_BASE 0x20000000
 #define STM32_SRAM_SIZE (8 * 1024)
+#define STM32L_SRAM_SIZE (16 * 1024)
         stm32_addr_t sram_base;
         size_t sram_size;
 
index 6eb456c88011d4f5687c69a696aac7c8751eb4df..2ed5320e971f920542bac6f1df05520d231c4850 100644 (file)
@@ -702,6 +702,20 @@ on_libusb_error:
 
     sl->backend = &_stlink_usb_backend;
     sl->backend_data = slu;
+
+    /* flash memory settings */
+    sl->flash_base = STM32_FLASH_BASE;
+    sl->flash_size = STM32_FLASH_SIZE;
+    sl->flash_pgsz = STM32_FLASH_PGSZ;
+
+    /* system memory */
+    sl->sys_base = STM32_SYSTEM_BASE;
+    sl->sys_size = STM32_SYSTEM_SIZE;
+
+    /* sram memory settings */
+    sl->sram_base = STM32_SRAM_BASE;
+    sl->sram_size = STM32L_SRAM_SIZE;
+
     /* success */
     return sl;