blue-pill: fix linker scripts and asm led turnon

This commit is contained in:
2018-03-12 22:16:18 -07:00
parent ca7eaec903
commit 943e2bfa93
5 changed files with 143 additions and 3 deletions

View File

@@ -9,6 +9,8 @@
.cpu cortex-m3
.thumb
.section .text
.global vectors
vectors:
.align 2
.long 0x20005000 /* stack pointer points to top of SRAM */

View File

@@ -1,11 +1,18 @@
MEMORY
{
flash (rx) : ORIGIN = 0x00000000, LENGTH = 128K
flash (rx) : ORIGIN = 0x08000000, LENGTH = 64K
sram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K
}
EXTERN(vectors);
ENTRY(reset_handler);
SECTIONS
{
.text : { *(.text*) } > flash
.bss : { *(.bss*) } > sram
.text : {
*(.vectors*)
*(.text*)
. = ALIGN(4);
} > flash
.bss : { *(.bss*) } > sram
}