Skip to content

Instantly share code, notes, and snippets.

@isqad
Last active September 16, 2021 16:01
Show Gist options
  • Save isqad/3913428443cd96c7a43c84ea43ae1d5b to your computer and use it in GitHub Desktop.
Save isqad/3913428443cd96c7a43c84ea43ae1d5b to your computer and use it in GitHub Desktop.
Bootstrap for stm32f103
@ 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
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