Last active
September 16, 2021 16:01
-
-
Save isqad/3913428443cd96c7a43c84ea43ae1d5b to your computer and use it in GitHub Desktop.
Bootstrap for stm32f103
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ stm32f103 has 0x5000 (20K) SRAM | |
@ SRAM is starting from 0x20000000 | |
@ so stack is eq 0x20000000 + 0x5000 = 0x20005000 | |
@ flash starts from 0x08000000 | |
.syntax unified | |
.thumb | |
.cpu cortex-m3 | |
.equ Stack_up, 0x20005000 | |
.word Stack_up @ stack header | |
.word Reset + 1 @ start of program. +1 for format in Thumb instead ARM. | |
@ Stm32 understands only set of Thumb commands | |
Reset: B Reset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MEMORY | |
{ | |
rom : org = 0x08000000, l = 64K | |
ram : org = 0x20000000, l = 20K | |
} | |
SECTIONS | |
{ | |
.text : { | |
*(.text); | |
} > rom | |
.data : { | |
*(.data); | |
} > ram AT>rom = 0xff | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment