Skip to content

Commit 454ab56

Browse files
authored
Merge pull request #278 from Polarisru/master
Fixed SysTick initialization problem in tx_initialize_low_level.s for Cortex-M0.
2 parents 4f1b9bf + 416dfac commit 454ab56

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

ports/cortex_m0/ac5/example_build/tx_initialize_low_level.s

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ _tx_initialize_low_level
169169
; /* Configure SysTick. */
170170
;
171171
LDR r0, =0xE000E000 ; Build address of NVIC registers
172+
LDR r1, =0
173+
STR r1, [r0, #0x10] ; Reset SysTick Control
174+
STR r1, [r0, #0x18] ; Reset SysTick Counter Value
172175
LDR r1, =SYSTICK_CYCLES
173176
STR r1, [r0, #0x14] ; Setup SysTick Reload Value
174177
MOVS r1, #0x7 ; Build SysTick Control Enable Value

ports/cortex_m0/gnu/example_build/tx_initialize_low_level.S

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ _tx_initialize_low_level:
123123
@ /* Configure SysTick for 100Hz clock, or 16384 cycles if no reference. */
124124
@
125125
LDR r0, =0xE000E000 @ Build address of NVIC registers
126+
LDR r1, =0
127+
STR r1, [r0, #0x10] // Reset SysTick Control
128+
STR r1, [r0, #0x18] // Reset SysTick Counter Value
126129
LDR r1, =SYSTICK_CYCLES
127130
STR r1, [r0, #0x14] // Setup SysTick Reload Value
128131
LDR r1, =0x7 // Build SysTick Control Enable Value

ports/cortex_m0/iar/example_build/tx_initialize_low_level.s

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ _tx_initialize_low_level:
118118
; /* Configure SysTick. */
119119
;
120120
LDR r0, =0xE000E000 ; Build address of NVIC registers
121+
LDR r1, =0
122+
STR r1, [r0, #0x10] ; Reset SysTick Control
123+
STR r1, [r0, #0x18] ; Reset SysTick Counter Value
121124
LDR r1, =SYSTICK_CYCLES
122125
STR r1, [r0, #0x14] ; Setup SysTick Reload Value
123126
MOVS r1, #0x7 ; Build SysTick Control Enable Value

ports/cortex_m0/keil/example_build/tx_initialize_low_level.s

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ _tx_initialize_low_level
169169
; /* Configure SysTick. */
170170
;
171171
LDR r0, =0xE000E000 ; Build address of NVIC registers
172+
LDR r1, =0
173+
STR r1, [r0, #0x10] ; Reset SysTick Control
174+
STR r1, [r0, #0x18] ; Reset SysTick Counter Value
172175
LDR r1, =SYSTICK_CYCLES
173176
STR r1, [r0, #0x14] ; Setup SysTick Reload Value
174177
MOVS r1, #0x7 ; Build SysTick Control Enable Value

0 commit comments

Comments
 (0)