打印
[STM8]

Illegal opcode reset

[复制链接]
5184|13
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
zhangyong1818|  楼主 | 2010-9-4 11:15 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
有那几种情况会造成非法操作,机器出现了非正常复位,感觉是 Illegal opcode reset 的原因
沙发
zhangyong1818|  楼主 | 2010-9-6 11:47 | 只看该作者
Illegal flag using timer 2 and timer 3
Hi all


I am getting an illegal opcode that reset the micro using the timer2 and 3 together.


My program is using 2 different function


-> 1 siren
-> Communication


Sepparetly they work fine... but when I make them run together I get the opcode error


In the code the communication is using fyreye.c and the siren piezo_sounder.c


Thank you for your time


Rémi

使用特权

评论回复
板凳
zhangyong1818|  楼主 | 2010-9-6 11:48 | 只看该作者

使用特权

评论回复
地板
zhangyong1818|  楼主 | 2010-9-6 11:48 | 只看该作者
帮忙帮忙呗!

使用特权

评论回复
5
香水城| | 2010-9-6 12:31 | 只看该作者
Illegal opcode reset 就是非法指令复位,也就是说执行了非法指令而导致的复位。

最常见的原因就是程序跑乱了。

使用特权

评论回复
6
zhangyong1818|  楼主 | 2010-9-6 13:43 | 只看该作者
在等待模式下:用了定时器T3 (定时中断唤醒),计数器T2(脉冲触发事件唤醒)都可以唤醒等待模式,程序运行几分钟就会出现复位、死机现象。如何处理这问题?

使用特权

评论回复
7
香水城| | 2010-9-6 14:05 | 只看该作者
在等待模式下:用了定时器T3 (定时中断唤醒),计数器T2(脉冲触发事件唤醒)都可以唤醒等待模式,程序运行几分钟就会出现复位、死机现象。如何处理这问题? ...
zhangyong1818 发表于 2010-9-6 13:43


程序是你写的,自己检查一下,程序运行几分钟后跑到哪里去了?

使用特权

评论回复
8
zhangyong1818|  楼主 | 2010-9-6 17:44 | 只看该作者
现在用定时器T4  代替定时器T3 (定时中断唤醒),竟然好了,很无语!为什么?我在谷歌上搜到:也有人遇到同样的问题,但没有相关的解决方法。
https://my.st.com/public/STe2eco ... amp;currentviews=59

使用特权

评论回复
9
zhangyong1818|  楼主 | 2010-9-6 17:46 | 只看该作者
会不会因为T2、T3结构一样同时使用是会出问题啊?  真的想不通,瞎猜了!

使用特权

评论回复
10
香水城| | 2010-9-6 18:01 | 只看该作者
会不会因为T2、T3结构一样同时使用是会出问题啊?  真的想不通,瞎猜了!
zhangyong1818 发表于 2010-9-6 17:46


结构一样怎么就会出问题?有什么必然联系?

使用特权

评论回复
11
zhangyong1818|  楼主 | 2010-9-6 18:05 | 只看该作者
麻烦你看一登陆一下这个网址:https://my.st.com/public/STe2eco ... amp;currentviews=59

使用特权

评论回复
12
zhangyong1818|  楼主 | 2010-9-6 18:07 | 只看该作者
我就是看到了上面的帖子才用T4代替T3的

使用特权

评论回复
13
zhangyong1818|  楼主 | 2010-9-6 18:09 | 只看该作者
The micro is really resetting itself:


I think the problem lies with the wfe() (wait for event) function


When I wait for a rising edge on a pin or an update on timer 2, the timer 3 is doing something different on its own (sounder).


The system works for 5s then the micro goes to a random memory location, flag an illegal access and restart.


My understanding is that it is due to the Cosmic compiler error or to a misconception in the microcontroller itself...


My way arounf the problem is to remove the use of the wfe() function


Regards

使用特权

评论回复
14
香水城| | 2010-9-6 18:18 | 只看该作者


看了一下:按照MCU Lüfter的回答,如果有RESET,应该在复位引脚检测到复位信号,但是他不能看到这个复位信号,所以他问你是否100%肯定,你说100%的肯定。

这里可以看出MCU Lüfter不能重现你的现象。

我有看了一下你的程序,因为不知道你的用意,看不大懂,请你说明一下,最好有个框图。

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1

主题

157

帖子

2

粉丝