sandbox/blue-pill/draugr/startup.s

38 lines
887 B
ArmAsm
Raw Normal View History

/*
* Startup code for the STM32F103-based blue pill board.
*
2018-03-08 19:31:00 +00:00
* The stack pointer is initialised to the top of the stack (which
* grows downward), so I pointed it to the end of the SRAM (where the
* stack should be).
*/
2018-03-08 03:50:01 +00:00
.cpu cortex-m3
.thumb
.section .text
.global vectors
2018-03-07 23:55:54 +00:00
vectors:
.align 2
2018-03-08 19:31:00 +00:00
.long 0x20005000 /* stack pointer points to top of SRAM */
.long reset_handler /* reset handler */
2018-03-08 03:50:01 +00:00
.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 */
2018-03-08 03:50:01 +00:00
.long hang /* svcall handler */
.long hang /* debug handler */
.skip 4 /* reserved */
2018-03-08 03:50:01 +00:00
.long hang /* pendsv handler */
.long hang /* systick handler */
.skip 0x100 /* remaining / IRQ vectors */
.thumb_func
hang: b .
.thumb_func
reset_handler:
bl main