2014-11-30 04:00 AM
Dear All ,
I written a program in assembly to tern on bit 8 on GPOIC It is compiled well but LED does not on processor STM32F051R8T6 IDE KEILPRESERVE8
THUMB
RCC_APB2ENR EQU 0X40021018
GPIOC_CRH EQU 0x40011004
GPIOC_ODR EQU 0x4001100C
DEL1 EQU 0X10
DEL2 EQU 0X10
AREA RESET,DATA,READONLY
EXPORT __Vectors
__Vectors DCD 0X20002000
DCD Reset_Handler
ALIGN
AREA MYCODE,CODE,READONLY
ENTRY
EXPORT Reset_Handler
Reset_Handler PROC
clock_init
ldr R6, =RCC_APB2ENR
movs R0, #0x1C
str R0, [R6]
ldr R6, =GPIOC_CRH
ldr R0, =0x3333333
str R0, [R6]
LDR r1, =GPIOC_ODR
LDR r0, =0x0A00
STR r0, [r1]
ENDP
B DELAY
DELAY
SUBS R2,#1
BNE DELAY
DEL SUBS R3,#1
BNE DEL
B Reset_Handler
ALIGN
END
2014-12-06 09:28 PM
2014-12-07 01:01 AM
Dear Sir,
This is my SysTick Handler code, Now SysTick timer operation is working but it does not return from SysTick Handler ( I think)SysTick_Handler PROC
LDR R1, =GPIOC_ODR
LDR R0, =0x100
STR R0, [R1]
BX LR
ENDP
2014-12-07 06:58 AM
With the code you posted earlier you had commented out vectors, you can't do that, they have specific order and position. Use ''DCD 0'' instead of commenting out.
Suggest you toggle the GPIO2014-12-08 06:53 AM
Suggest you toggle the GPIO
Could you please advice me about assembly instruction for toggle the bit?Could you please advice me about debugger that we can use to check SysTick interrupt?( Exceptions )2014-12-08 09:01 AM
SysTick_Handler PROC
LDR R1, =GPIOC_ODR
LDR R2, =0x100
LDR R0, [R1]
EORS R0, R2
STR R0, [R1]
BX LR
ENDP
Wouldn't expect the Keil debugger to have any problem break-pointing the code, debug how exactly?
2014-12-08 05:35 PM
Dear Sir,
I would like to ask this question hear The following program toggle the bit of PORTC using RMW method Can we apply hear the bit banding method to change the bit What should be the code pattern please adviceSysTick_Handler PROC
LDR R1, =GPIOC_ODR
LDR R2, =0x100
LDR R0, [R1]
EORS R0, R2
STR R0, [R1]
BX LR
ENDP
2014-12-08 09:22 PM
I'm not sure bit-banding is implemented on the Cortex-M0 (STM32F0), you'd have to check.
It's not particularly efficient, as it still does an RMW under the hood. Perhaps you want to just do the SET/RESET as a singular write.GPIOC_BSRR EQU 0x48000818
SysTick_Handler PROC
LDR R1, =GPIOC_BSRR
LDR R0, =0x00000100 ; PC8
STR R0, [R1] ; Set
LDR R0, =0x01000000
STR R0, [R1] ; Reset
BX LR
ENDP
2014-12-10 08:28 AM
Dear Sir, I debugged KIEL with hardware which I am using STM Discovery board, it does not debugging interrupt part (SysTick Exceptions )
2014-12-10 08:50 AM
Dear Sir, I debugged KIEL with hardware which I am using STM Discovery board, it does not debugging interrupt part (SysTick Exceptions )
One might conclude that the interrupt is not actually occurring.2014-12-10 05:26 PM
Dear Sir,
One might conclude that the interrupt is not actually occurring.
I did not get it...At the normal run the SysTick exception is occurred that confirming LED ''ON'' in which the program written to LED ''ON'' in the SysTick handler