From 99f8e5e9502ea15036194d96987ffc1bed720d7e Mon Sep 17 00:00:00 2001 From: Fabien Le Mentec Date: Sun, 16 Oct 2011 16:13:58 -0500 Subject: [PATCH] [fix] stlinkv2 missing initialisation --- src/stlink-common.h | 1 + src/stlink-usb.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/stlink-common.h b/src/stlink-common.h index cb6c6cc..9481609 100644 --- a/src/stlink-common.h +++ b/src/stlink-common.h @@ -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; diff --git a/src/stlink-usb.c b/src/stlink-usb.c index 6eb456c..2ed5320 100644 --- a/src/stlink-usb.c +++ b/src/stlink-usb.c @@ -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;