Skip to content

Commit

Permalink
Revert "Split linker files for STMs F2 and F4 (#817)" (#852)
Browse files Browse the repository at this point in the history
This reverts commit 5eddc18.
  • Loading branch information
briskspirit authored Feb 11, 2022
1 parent c3d89ed commit f56ebf5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 165 deletions.
4 changes: 2 additions & 2 deletions board/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if os.getenv("PEDAL"):
build_projects["pedal"] = {
"MAIN": "pedal/main.c",
"STARTUP_FILE": "stm32fx/startup_stm32f205xx.s",
"LINKER_SCRIPT": "stm32fx/stm32f2_flash.ld",
"LINKER_SCRIPT": "stm32fx/stm32fx_flash.ld",
"APP_START_ADDRESS": "0x8004000",
"PROJECT_FLAGS": [
"-mcpu=cortex-m3",
Expand All @@ -30,7 +30,7 @@ if os.getenv("PEDAL"):
build_projects["panda"] = {
"MAIN": "main.c",
"STARTUP_FILE": "stm32fx/startup_stm32f413xx.s",
"LINKER_SCRIPT": "stm32fx/stm32f4_flash.ld",
"LINKER_SCRIPT": "stm32fx/stm32fx_flash.ld",
"APP_START_ADDRESS": "0x8004000",
"PROJECT_FLAGS": [
"-mcpu=cortex-m4",
Expand Down
154 changes: 0 additions & 154 deletions board/stm32fx/stm32f4_flash.ld

This file was deleted.

17 changes: 14 additions & 3 deletions board/stm32fx/stm32f2_flash.ld → board/stm32fx/stm32fx_flash.ld
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ _estack = 0x2001FFFC; /* end of 128K RAM on AHB bus*/
_app_start = 0x08004000; /* Reserve Sector 0(16K) for bootloader */

/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0x200; /* required amount of heap */
_Min_Heap_Size = 0; /* required amount of heap */
_Min_Stack_Size = 0x400; /* required amount of stack */

/* Specify the memory areas */
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K /* 112 SRAM1 + 16 SRAM2 */
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 128K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K
}

/* Define output sections */
Expand Down Expand Up @@ -150,5 +151,15 @@ SECTIONS
. = ALIGN(4);
} >RAM

/* MEMORY_bank1 section, code must be located here explicitly */
/* Example: extern int foo(void) __attribute__ ((section (".mb1text"))); */
.memory_b1_text :
{
*(.mb1text) /* .mb1text sections (code) */
*(.mb1text*) /* .mb1text* sections (code) */
*(.mb1rodata) /* read-only data (constants) */
*(.mb1rodata*)
} >MEMORY_B1

.ARM.attributes 0 : { *(.ARM.attributes) }
}
12 changes: 6 additions & 6 deletions board/stm32h7/stm32h7x5_flash.ld
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ _Min_Stack_Size = 0x400; /* required amount of stack */
/* Specify the memory areas */
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 320K
RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 32K
RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 16K
ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 320K
RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 32K
RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 16K
ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K
}

/* Define output sections */
Expand Down

0 comments on commit f56ebf5

Please sign in to comment.