Merge pull request #141 from mower7/master

A little mode tweaking for the STM32L Medium Density Devies
pull/142/head
texane 2013-04-05 09:12:06 -07:00
commit 4cea62e454
1 zmienionych plików z 8 dodań i 0 usunięć

Wyświetl plik

@ -452,6 +452,14 @@ int stlink_load_device_params(stlink_t *sl) {
sl->flash_size = 0x100000; /* Use maximum, User must care!*/ sl->flash_size = 0x100000; /* Use maximum, User must care!*/
} else if (sl->chip_id == STM32_CHIPID_F4) { } else if (sl->chip_id == STM32_CHIPID_F4) {
sl->flash_size = 0x100000; //todo: RM0090 error; size register same address as unique ID sl->flash_size = 0x100000; //todo: RM0090 error; size register same address as unique ID
} else if (sl->chip_id == STM32_CHIPID_L1_MEDIUM) {
// if the flash size is zero, we assume it is 128k, if not we calculate the real value
uint32_t flash_size = stlink_read_debug32(sl,params->flash_size_reg) & 0xffff;
if ( flash_size == 0 ) {
sl->flash_size = 128 * 1024;
} else {
sl->flash_size = flash_size * 1024;
}
} else if ((sl->chip_id & 0xFFF) == STM32_CHIPID_L1_MEDIUM_PLUS) { } else if ((sl->chip_id & 0xFFF) == STM32_CHIPID_L1_MEDIUM_PLUS) {
uint32_t flash_size = stlink_read_debug32(sl, params->flash_size_reg) & 0x1; uint32_t flash_size = stlink_read_debug32(sl, params->flash_size_reg) & 0x1;
// 0 is 384k and 1 is 256k // 0 is 384k and 1 is 256k