cancel
Showing results for 
Search instead for 
Did you mean: 

Problem compiling in STVD

Vitor Schulter
Associate II
Posted on January 19, 2018 at 18:53

Hello, I am modifying the code of an STM8S003 that already works.

But the code stopped working, even though I have not made any changes yet.

The STVD displays the following error message:

#error clnk Debug\ajk_strobo_lps_st.lkf:1 @svlreg missing for function f_EXTI_PORTA_IRQHandler

This code already worked and I can not find any errors, can anyone help me?

1 ACCEPTED SOLUTION

Accepted Solutions
luca239955_stm1_st
Senior II
Posted on January 20, 2018 at 09:41

Hello,

add the @svlreg keyword before your interrupt function name and everything will go back to normal.

The reason why this worked before is that the toolchain was not able, in the past, to detect this potentially dangerous situation (without @svlreg for interrupt functions that use 32 bits math the internal register c_lreg can become corrutped in some unluky cases and lead to application crash/misbehavior): we have improved it since and now it tells you that your code needs this minor modification in order to be safe.

Regards,

Luca (Cosmic)

View solution in original post

3 REPLIES 3
luca239955_stm1_st
Senior II
Posted on January 20, 2018 at 09:41

Hello,

add the @svlreg keyword before your interrupt function name and everything will go back to normal.

The reason why this worked before is that the toolchain was not able, in the past, to detect this potentially dangerous situation (without @svlreg for interrupt functions that use 32 bits math the internal register c_lreg can become corrutped in some unluky cases and lead to application crash/misbehavior): we have improved it since and now it tells you that your code needs this minor modification in order to be safe.

Regards,

Luca (Cosmic)

Vitor Schulter
Associate II
Posted on January 22, 2018 at 11:00

Thank you Luca, you solved my problem!

Best Regards

Rafal Obirek
Associate

But @svlreg causing pushing and "poping" something from stack and it is neccesary when interrupt makes calculations on 32bit values.

If interrupt function doesn't call other functions in ohter files then compiler is able to determinate if you are making 32bit operations or not. In this case is this ok because compiler gives you good information if svlreg shall be used or not.

But if you are calling other function in other file then compiler don't know what will be done there.

And forcing to use @svlreg.

What to do when I know, that in interrupt I will never make 32bit calculations. How to force compiler to pass interrupt function declaration without @svlreg to avoid not neccesary stack usage ?