2022-09-18 03:46 PM
Hello,
I have problems with implementation of weak default function and override with real function in assembler.
I have this in startup.s (usually all functions are defined like this):
.weak SysTick_Handler
.thumb_set SysTick_Handler,Default_Handler
and then have defined function in main.s:
.global SysTick_Handler
.type SysTick_Handler, %function
SysTick_Handler:
push {r3, r4, r5, r6, lr}
...
if I comment those two lines in startup,s, then proper SysTick_Handler gets triggered, otherwise it ends in Default_Handler. I'm obviously doing something wrong ?
Thanks.
Solved! Go to Solution.
2022-09-18 04:26 PM
.syntax unified
.cpu cortex-m7
.fpu softvfp
.thumb
...
.global SysTick_Handler
.section .text.SysTick_Handler,"ax",%progbits
.type SysTick_Handler, %function
SysTick_Handler:
push {r3, r4, r5, r6, lr}
...
.size SysTick_Handler, .-SysTick_Handler
2022-09-18 04:26 PM
.syntax unified
.cpu cortex-m7
.fpu softvfp
.thumb
...
.global SysTick_Handler
.section .text.SysTick_Handler,"ax",%progbits
.type SysTick_Handler, %function
SysTick_Handler:
push {r3, r4, r5, r6, lr}
...
.size SysTick_Handler, .-SysTick_Handler
2022-09-19 06:08 PM
2022-10-28 03:45 PM
Hello,
have tried to replicate your advice, but I still get into Default_Handler.
It doesn't seem to help, I have to comment second line in startup.s.
. Can I check in some output docs what could be wrong ?
.weak SysTick_Handler
// .thumb_set SysTick_Handler,Default_Handler
And I have this in main.s
.global SysTick_Handler
.section .text.SysTick_Handler,"ax",%progbits
.type SysTick_Handler, %function
SysTick_Handler:
push {r3, r4, r5, r6, lr}
// adr r3,LEDSTAT
// ldr r4,[r3]
// cmp r4,#0
add r8,r8,#1
cmp r8,#500
blo RET
mov r8,#0 // reset ms counter
cmp r7,#0 // check flag
beq LOFF
mov r5, #LEDs_OFF
// mov r4,#0
// str r4,[r3]
mov r7,#0
b CONT
.size SysTick_Handler, .-SysTick_Handler
Thanks and regards.