完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
您好,我正在修改已经可以使用的STM8S003的代码。
但是代码停止了工作,即使我还没有做任何改动。 STVD显示以下错误消息: #error clnk Debug ajk_strobo_lps_st.lkf:函数f_EXti_PORTA_IRQHandler缺少1个@svlreg 此代码已经有效,我找不到任何错误,任何人都可以帮助我吗? 以上来自于谷歌翻译 以下为原文 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 Debugajk_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? |
|
相关推荐
2个回答
|
|
|
你好,
在中断函数名称之前添加@svlreg关键字,一切都将恢复正常。 之前工作的原因是工具链在过去无法检测到这种潜在的危险情况(如果没有@svlreg用于使用32位数学运算的中断函数,内部寄存器c_lreg可能会在某些不完整的情况下被修复并导致应用程序崩溃/错误行为):我们已经对它进行了改进,现在它告诉您,为了安全起见,您的代码需要进行这种小修改。 问候, 卢卡(宇宙) 以上来自于谷歌翻译 以下为原文 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/mi***ehavior): 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) |
|
|
|
|
|
但是@svlreg导致从堆栈中推送和“弹出”某些东西,当中断对32位值进行计算时,它是必要的。
如果中断函数不调用ohter文件中的其他函数,则编译器能够确定您是否正在进行32位操作。在这种情况下这是可以的,因为如果使用或不使用svlreg,编译器会为您提供良好的信息。 但是如果你在其他文件中调用其他函数,那么编译器不知道将在那里做什么。 并强制使用@svlreg。 我知道怎么办,在中断中我永远不会进行32位计算。如何强制编译器在没有@svlreg的情况下传递中断函数声明,以避免不需要使用堆栈? 以上来自于谷歌翻译 以下为原文 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 ? |
|
|
|
|
只有小组成员才能发言,加入小组>>
stm32mp157的异核通信的rpmsg_sdb的m4固件和a7驱动该如何编写?
1471 浏览 0 评论
stm32f103用freertos对一个采样率为1kHz的传感器,进行采样,数据出差
1523 浏览 0 评论
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
3673 浏览 1 评论
3864 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
2480 浏览 1 评论
STM32H7打开DCache后,出现了串口接收信息为空的现象,是哪里出了问题?
750浏览 5评论
用NANO STM32F103RBT6的开发板烧录不了是哪里出了问题?
683浏览 5评论
729浏览 5评论
外部中断触发类型为双边沿触发,进入中断回调后有什么办法判断该边沿是上升沿还是下降沿?
973浏览 5评论
STM32L071CBT6低温环境下无法正常工作是什么原因引起的?
778浏览 5评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-13 18:24 , Processed in 1.885884 second(s), Total 74, Slave 57 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1605