assembly interrupt is ineffective; Default_Handler acts instead
Hello,
I have encountered a problem and I don’t know how to continue so I’m looking for help.
I have created a project in sw4stm32.
Using board Nucleo-L053r8
Using sw4stm32 in Debian10. amd64.
In this project I so far used a single C file (klavirko.c)
At some point I decided that I’m not happy with the timing performance of my interrupt function.
So far using one interrupt (IM6_DAC_IRQHandler)
So I decided to rewrite this interrupt function in assembly.
I have already programmed in assembly (not very much) but not on ARM.
(I have on msp430 and ATmega) but ready to learn the ARM M0 assembly.
I commented out my interrupt function in the C file.
I added a new file (klavirko_asm.s) to the project.
In this file I so far made only a simple function which immediately returns:
.global TIM6_DAC_IRQHandler
.section .text.TIM6_DAC_IRQHandler,"ax",%progbits
.type TIM6_DAC_IRQHandler, %function
TIM6_DAC_IRQHandler:
pop {pc}
I just wanted to know that it works, and when confirmed, start writing the actual code.
But it doesn’t work.
The microcontroller never enters my new interrupt function (it did enter my C function, when it still existed)
Instead it enters the Default_Handler in file startup_stm32l053xx.s:
.section .text.Default_Handler,"ax",%progbits
Default_Handler:
Infinite_Loop:
b Infinite_Loop
My problem now is that I do not know how to make my interrupt function visible.
I don’t even know on which level I’m missing something?
something missing in my assembly file?
something missing is the project configuration?
something else?
I am aware that startup_stm32l053xx.s defines a weak replacement mechanism which makes the Default_Handler happen.
But it is supposed to stop being effective if I define a function with the correct name which I just did.
Also I’m sure than my file klavirko_asm.s is not omitted during compilation because if I write some nonsense there, the compilation fails.
I tried to look through the internet for written answers but this was not successful and now I feel like I understand less than before.
I don’t know how to continue so I will appreciate any help.
Thank you in advance.