论坛: 帮助论坛 (Thread #3623)

/dev/ttySC* (2003-10-26 22:38 by j_akita #6372)

秋田と申します。
最近はもっぱらH8MAXで遊んでいるのですが、
PortAとSCI0を使うプログラムを書いていて、
「ときどき」
----
Kernel panic: BUG!
----
のメッセージを出してハングしてしまうことがあります。
elf2fltのI/Oレジスタへのアクセスを許可するパッチは済みで、PA-0~3を使っていますが、H8/3069的には、これらはTPn /TENDn /TCLKA,Bといったあたりなので、カーネルの動作には関係ありませんよね。

もう1つのSCI0は、/dev/ttySC0に対して、「一般的な」Linux的手順でアクセス(openしてread,write)しています。

この両者以外に、先のハングの原因になりそうなものがないのですが、なにか怪しそうなものはありますでしょうか??

回复到 #6372×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登录

RE: /dev/ttySC* (2003-10-28 23:50 by ysato #6402)

I/Oの方は問題ないです。

BUGの後ろになにか出ていませんか?
何も出ていないようであれば、発生箇所を特定するために
panicした時の情報量を増やしてみます。

しばらく留守にするので、直すのは来週になると思いますが…
回复到 #6372

回复到 #6402×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登录

RE: /dev/ttySC* (2003-10-31 09:14 by j_akita #6415)

現象を確認(再現)するのに手間取っていましたのですが、
昨晩、めでたく(?)再現されました。
以下のようなメッセージでした。
----
request next (trial=0) ←これはアプリからのメッセージ
Scheduling in interrupt
Kernel panic: BUG!
In interrupt handler - not syncing
----
自分で作ったプログラム中では割り込みは使っていません。
(以前、こちらでやりかたを教えていただきましたが、そのやり方を含めて、ユーザー割り込みは一切使っていません)

なにかわかりますでしょうか?
回复到 #6402

回复到 #6415×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登录

RE: /dev/ttySC* (2003-10-31 19:15 by j_akita #6436)

自分で補足します。
プログラム中にたくさんprintfを入れてどこでpanicが起こっているかをみてみたら、どうもこのあたりのようでした。
SCI0に1バイト書き出す関数で次の関数を作ってあるのですが、これの1つ目のprintfの後、2つ目のprintfの前(つまりwrite())、でpanicが出ているようです。
(fdはグローバル変数で、/dev/ttySC0をopenしたときのfdです)
-------------
void sciPutc(int fd, int c)
{
char buf[8];
buf[0] = c;
printf("S[%02x]\n", buf[0]);
write(fd, buf, 1);
printf("done.\n");
}
-------------
(実行時のメッセージ)
...
S[04]
Scheduling in interrupt
Kernel panic: BUG!
In interrupt handler - not syncing
done.
...
(このあとしばらく実行とメッセージ表示が続いたあと停止)
-------------

なにかわかりますでしょうか・・・?
回复到 #6415

回复到 #6436×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登录

RE: /dev/ttySC* (2003-11-04 00:54 by ysato #6467)

問題の場所は見当がつきました。
が、再現させるための条件が全くわからないので、
見当違いの可能性もあります。

とりあえず直してみます。
回复到 #6436

回复到 #6467×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登录

RE: /dev/ttySC* (2003-11-04 21:30 by j_akita #6486)

早速のご回答、ありがとうございます。
現在は、SCI0を、RDR0などのレジスタをちょくせつたたいてしのいでいます。
#これだとこのPanicなどのエラーが出ない・・・

おいおいためさせていただきたいと思います。
ありがとうございます。
回复到 #6467

回复到 #6486×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登录

RE: /dev/ttySC* (2003-11-07 19:15 by ysato #6536)

行方不明になる前に、気になる所を直してみました。

ただ、私の所ではあいかわらず再現出来ないので、
これが正解かどうかはわかりません。
回复到 #6486

回复到 #6536×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) 登录