__initial_sp EQU 0x20000800
PRESERVE8 ;8byte alignment of the stack (required by ARM)
THUMB ; will use THUMB2 instructions
AREA RESET, DATA, READONLY
__Vectors DCD __initial_sp ; Top of Stack
DCD Reset_Handler ; Reset Handler
AREA |.text|, CODE, READONLY
ENTRY
Reset_Handler PROC
LDR r1, =0x4002144C ;address of RCC_AHBENR register
LDR r0, =0x1
LDR r2, [r1]
ORRS r2,r0,r2
STR r2, [r1]
LDR r1, =0x48000000 ;address of GPIOA_MODER register
LDR r0, =0x400 ;configure PA5 as output
LDR r2, [r1]
ORRS r2,r0,r2
STR r2, [r1]
LDR r1, = 0x48000018 ;address of GPIOA_BSRR register
LDR r0, =0x20 ;pin 5 on GPIOA set
LDR r2, =0x200000 ;pin 5 on GPIOA clear
loop
STR r0, [r1]
STR r2, [r1]
B loop
ENDP
END
The code flashes onto the MCU(1 warning during compilation) but LED doesn't Blink.While debugging ORRS r2,r0,r2 in the GPIOA_MODER raises the Negative Flag in the PSR and the value is not loaded into GPIOA_MODER.The same happens with BSRR.
The LED is connected to PA5.