diff --git a/src/st-util/gdb-server.c b/src/st-util/gdb-server.c index dfe71cbb..9d06293e 100644 --- a/src/st-util/gdb-server.c +++ b/src/st-util/gdb-server.c @@ -355,7 +355,8 @@ char* make_memory_map(stlink_t *sl) { if (sl->chip_id == STM32_CHIPID_F4 || sl->chip_id == STM32_CHIPID_F446 || sl->chip_id == STM32_CHIPID_F411xx) { - strcpy(map, memory_map_template_F4); + snprintf(map, sz, memory_map_template_F4, + sl->sram_size); } else if (sl->chip_id == STM32_CHIPID_F4_DE) { strcpy(map, memory_map_template_F4_DE); } else if (sl->core_id == STM32_CORE_ID_M7F_SWD) { diff --git a/src/st-util/memory-map.h b/src/st-util/memory-map.h index 6f34eeda..37acb62e 100644 --- a/src/st-util/memory-map.h +++ b/src/st-util/memory-map.h @@ -8,7 +8,7 @@ static const char* const memory_map_template_F4 = "" " " // code = sram, bootrom or flash; flash is bigger " " // ccm ram - " " // sram + " " // sram " " // Sectors 0...3 " 0x4000" // 16 kB " "