Skip to content

Commit

Permalink
Dynamic SRAM size for F4 memory map
Browse files Browse the repository at this point in the history
- Instead of using a fixed size of 128 KB for the SRAM memory map for F4 chips it now uses the definied SRAM size from the chip configuration
  • Loading branch information
Rocky04 committed May 2, 2024
1 parent 40948aa commit 44c02d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/st-util/gdb-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,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) {
Expand Down
2 changes: 1 addition & 1 deletion src/st-util/memory-map.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ static const char* const memory_map_template_F4 =
"<memory-map>"
" <memory type=\"rom\" start=\"0x00000000\" length=\"0x100000\"/>" // code = sram, bootrom or flash; flash is bigger
" <memory type=\"ram\" start=\"0x10000000\" length=\"0x10000\"/>" // ccm ram
" <memory type=\"ram\" start=\"0x20000000\" length=\"0x20000\"/>" // sram
" <memory type=\"ram\" start=\"0x20000000\" length=\"0x%x\"/>" // sram
" <memory type=\"flash\" start=\"0x08000000\" length=\"0x10000\">" // Sectors 0...3
" <property name=\"blocksize\">0x4000</property>" // 16 kB
" </memory>"
Expand Down

0 comments on commit 44c02d9

Please sign in to comment.