From c2aae4ccb63158f197c3d0629082e7699dfe8e25 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Mon, 14 Dec 2015 07:51:19 +0100 Subject: correct linking, putting the assembly code in .text with proper linking script made ld recognise the functions as thumb instructions. --- init.s | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'init.s') diff --git a/init.s b/init.s index 5897202..122a6ad 100644 --- a/init.s +++ b/init.s @@ -1,12 +1,14 @@ -; https://github.com/dwelch67/stm32_samples -; http://stackoverflow.com/questions/9565921/cortex-m3-initialisation +/* +https://github.com/dwelch67/stm32_samples +http://stackoverflow.com/questions/9565921/cortex-m3-initialisation +*/ .syntax unified .cpu cortex-m3 .thumb -.section isr_vectors -.thumb_func +.section .isr_vectors + .global vectors vectors: stacktop: .word 0x20001000 @@ -26,9 +28,8 @@ stacktop: .word 0x20001000 .word hang2 .word hang2 -.global fault_code -fault_code: -.word 0 +/* VERY significant */ +.section .text .thumb_func .global _Reset_Handler @@ -42,7 +43,6 @@ hang2: .thumb_func NMI_Handler: - movs r0, #1 b hang2 .thumb_func @@ -55,15 +55,14 @@ HardFault_Handler: .thumb_func MemManage_Handler: - movs r0, #3 b hang2 .thumb_func BusFault_Handler: - movs r0, #4 b hang2 .thumb_func UsageFault_Handler: - mov r0, #5 b hang2 + +.end -- cgit v1.2.3