Question about SWI vector

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Question about SWI vector

ソリューションへジャンプ
1,048件の閲覧回数
bobkang
Contributor II

Hi folks,

Currently I am a embedded software engineer and working on coding with a Soc using MC9S08AC128.

During debugging the program I found that the program go into the SWI vector somehow but I don't know why.

Is somebody know on what condition the program will step into SWI vector?

I will greatly appreciate your answer and help.

ラベル(1)
タグ(2)
0 件の賞賛
返信
1 解決策
812件の閲覧回数
lydia_ziegler
NXP Employee
NXP Employee

Hi,

It could be a couple of things.  The debug module can generate an SWI under certain circumstances. You may be seeing code run-away due to a variety of things.  Have you checked your PRM/vector file to make sure this vector is properly assigned?  You could add a routine that the SWI vector points to so you can catch the code when it triggers.  By adding this hook, maybe you can narrow down what it was doing before it executed.

Hope this helps!

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
813件の閲覧回数
lydia_ziegler
NXP Employee
NXP Employee

Hi,

It could be a couple of things.  The debug module can generate an SWI under certain circumstances. You may be seeing code run-away due to a variety of things.  Have you checked your PRM/vector file to make sure this vector is properly assigned?  You could add a routine that the SWI vector points to so you can catch the code when it triggers.  By adding this hook, maybe you can narrow down what it was doing before it executed.

Hope this helps!

0 件の賞賛
返信
812件の閲覧回数
bobkang
Contributor II

:smileyhappy:Thanks!Lydia. But could you explain more about "add a routine that the SWI vector points to"?

0 件の賞賛
返信
812件の閲覧回数
lydia_ziegler
NXP Employee
NXP Employee

Hi,

Sure.  It depends on how you are building your project in CodeWarrior.  If you are using the PRM, the Vector table will be there (It would be "VECTOR 1").  If you are using Processor Expert, the Vector table will be in the MCUinit.c file (called "isrVswi" by default).  Just use the vector table to point to a routine when the SWI triggers.  I would think  something like this would be good to 'catch' the MCU so you can see what state it is in:

__interrupt void isrVswi(void)

{

for (;;);

}

Hope this helps,

Lydia