[STM8] __asm("jrne EndWaitForVih")编译报错

[复制链接]
1275|12
 楼主| llljh 发表于 2021-8-14 18:53 | 显示全部楼层 |阅读模式
编译DISCOVERY的例子,出现如下错误,不知道什么原因?
Error[As011]: Undefined symbol: EndWaitForVih E:\Work\PROCEDURE\ARM\Experiment\STM8\stm8s-discovery_dev\Libraries\STM8_TouchSensing_Driver\src\stm8_tsl_rc_acquisition.c 366
Error[As011]: Undefined symbol: EndWaitForVih E:\Work\PROCEDURE\ARM\Experiment\STM8\stm8s-discovery_dev\Libraries\STM8_TouchSensing_Driver\src\stm8_tsl_rc_acquisition.c 366
Error[As011]: Undefined symbol: EndWaitForVih E:\Work\PROCEDURE\ARM\Experiment\STM8\stm8s-discovery_dev\Libraries\STM8_TouchSensing_Driver\src\stm8_tsl_rc_acquisition.c 366
Error[As011]: Undefined symbol: WaitForVih E:\Work\PROCEDURE\ARM\Experiment\STM8\stm8s-discovery_dev\Libraries\STM8_TouchSensing_Driver\src\stm8_tsl_rc_acquisition.c 369
Error[As011]: Undefined symbol: WaitForVih E:\Work\PROCEDURE\ARM\Experiment\STM8\stm8s-discovery_dev\Libraries\STM8_TouchSensing_Driver\src\stm8_tsl_rc_acquisition.c 369
Error[As011]: Undefined symbol: WaitForVih E:\Work\PROCEDURE\ARM\Experiment\STM8\stm8s-discovery_dev\Libraries\STM8_TouchSensing_Driver\src\stm8_tsl_rc_acquisition.c 369
Error[Og010]: Inline assembler instruction does not have a unique size: "        bcp a, (x)" E:\Work\PROCEDURE\ARM\Experiment\STM8\stm8s-discovery_dev\Libraries\STM8_TouchSensing_Driver\src\stm8_tsl_rc_acquisition.c 301
Error[As011]: Undefined symbol: EndWaitForVil E:\Work\PROCEDURE\ARM\Experiment\STM8\stm8s-discovery_dev\Libraries\STM8_TouchSensing_Driver\src\stm8_tsl_rc_acquisition.c 302
Error[As011]: Undefined symbol: EndWaitForVil E:\Work\PROCEDURE\ARM\Experiment\STM8\stm8s-discovery_dev\Libraries\STM8_TouchSensing_Driver\src\stm8_tsl_rc_acquisition.c 302
Error[As011]: Undefined symbol: EndWaitForVil E:\Work\PROCEDURE\ARM\Experiment\STM8\stm8s-discovery_dev\Libraries\STM8_TouchSensing_Driver\src\stm8_tsl_rc_acquisition.c 302
Error[As011]: Undefined symbol: WaitForVil E:\Work\PROCEDURE\ARM\Experiment\STM8\stm8s-discovery_dev\Libraries\STM8_TouchSensing_Driver\src\stm8_tsl_rc_acquisition.c 305
jlyuan 发表于 2021-8-14 18:55 | 显示全部楼层
这么多未定义符号,肯定是头文件没有包含进来。
 楼主| llljh 发表于 2021-8-14 18:58 | 显示全部楼层
好像不是头文件问题,同样的代码在STVD里面可以编译通过的,在IAR下编译有错误,网上有些说IAR是版本问题,感觉汇编下的跳转标识都无法识别,认为没有定义。
__asm("bcp a, (x)");  // 1 cycles
  __asm("jrne EndWaitForVih");
  __asm("ldw y, TIMACQ_CNTR"); // 2 cycles; hw counter also used for timeout ...
  __asm("cpw y, #0x0E00");    // 2 cycles; Timeout compare
  __asm("jrult WaitForVih");
  __asm("EndWaitForVih:");
heweibig 发表于 2021-8-14 19:00 | 显示全部楼层
  应该是库的版本问题
lizye 发表于 2021-8-14 19:02 | 显示全部楼层
楼主找到问题解决了吗?
zhaoxqi 发表于 2021-8-14 19:06 | 显示全部楼层
引用的符号超范围了,要在同一段程序代码范围内,比如这样使用:

  __asm(
    "WaitForVih: \n"
    "bcp a, (x) \n"
    "jrne EndWaitForVih \n"
    "ldw y, TIMACQ_CNTR \n"
    "cpw y, #0x0E00 \n"
    "jrult WaitForVih \n"
    "EndWaitForVih: \n"
  );
wyjie 发表于 2021-8-14 19:08 | 显示全部楼层
你好像不知道什么是条件编译?
 楼主| llljh 发表于 2021-8-14 19:12 | 显示全部楼层

好的,我明天去单位试一下,多谢各位大侠了哈        
guanjiaer 发表于 2021-9-9 10:06 | 显示全部楼层
汇编语言看不明白啊
heimaojingzhang 发表于 2021-9-9 10:09 | 显示全部楼层
没有引用相关头文件?
keaibukelian 发表于 2021-9-9 10:11 | 显示全部楼层
貌似都是未定义啊
labasi 发表于 2021-9-9 10:18 | 显示全部楼层
不知道为什么会报错
paotangsan 发表于 2021-9-9 10:20 | 显示全部楼层
引用的超过范围了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

855

主题

11301

帖子

6

粉丝
快速回复 在线客服 返回列表 返回顶部