blue-pill: fix bootloader.

This commit is contained in:
2018-03-07 19:50:01 -08:00
parent 524f860331
commit 5734a63997
10 changed files with 188 additions and 73 deletions

View File

@@ -5,24 +5,32 @@
* TODO: is the IRQv buffer actually needed right now?
*/
.cpu cortex-m3
.thumb
.globl vectors
vectors:
.align 2
.long 0x100 /* best guess at stack pointer */
.long 0x20002000 /* best guess at stack pointer */
.long reset_handler /* reset handler */
.long 0 /* NMI handler */
.long 0 /* hard_fault_handler */
.long 0 /* memory management handler */
.long 0 /* bus fault handler */
.long 0 /* usage fault handler */
.long hang /* NMI handler */
.long hang /* hard_fault_handler */
.long hang /* memory management handler */
.long hang /* bus fault handler */
.long hang /* usage fault handler */
.skip 0x20 /* reserved */
.long 0 /* svcall handler */
.long 0 /* debug handler */
.long hang /* svcall handler */
.long hang /* debug handler */
.skip 4 /* reserved */
.long 0 /* pendsv handler */
.long 0 /* systick handler */
.skip 0xf4 /* remaining / IRQ vectors */
.long hang /* pendsv handler */
.long hang /* systick handler */
.skip 0x100 /* remaining / IRQ vectors */
.globl reset_handler
.thumb_func
hang: b .
.thumb_func
reset_handler:
bl main

View File

@@ -1,19 +1,11 @@
/* from https://github.com/satoshinm/pill_blink/ */
MEMORY
{
rom (rx) : ORIGIN = 0x08000000, LENGTH = 128K
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K
flash (rx) : ORIGIN = 0x00000000, LENGTH = 128K
sram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K
}
EXTERN(vector_table);
ENTRY(reset_handler);
SECTIONS
{
.text : {
*(.vectors)
*(.text*)
. = ALIGN(4);
} >rom
.text : { *(.text*) } > flash
.bss : { *(.bss*) } > sram
}