sourcefogeのgitからcloneしてautogen.shを実行してビルドしてみる。
ByteBlasterMVクローンを作ってみたのでパラレルポートがある元祖amd64なマシンで試したが動かない。
ボードはいろいろミスていたのだがいろいろ直してもダメだ。
しかたがないので、コードを見てみる。FreeBSDのppiサポートのためのコードのsrc/tap/parport/ppi.cにこんな関数がある。
static int
ppi_set_control( parport_t *parport, uint8_t data )
{
ppi_params_t *p = parport->params;
data ^= 0x0B; /* SELECT, AUTOFD, and STROBE are inverted */
if (ioctl( p->fd, PPIGCTRL, &data ) == -1)
return -1;
return 0;
}
setなのにPPIGCTRLっておかしくないとゴーストの囁きが。
PPISCTRLにしてみたら動いた。
% sudo ./jtag
UrJTAG 0.10 #1502
Copyright (C) 2002, 2003 ETC s.r.o.
Copyright (C) 2007, 2008, 2009 Kolja Waschk and the respective authors
UrJTAG is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
There is absolutely no warranty for UrJTAG.
WARNING: UrJTAG may damage your hardware!
Type "quit" to exit, "help" for help.
jtag> cable ByteBlaster ppi /dev/ppi0
Initializing on ppi port /dev/ppi0
jtag> detect
IR length: 5
Chain length: 1
Device Id: 00000000000000000000000000000001 (0x0000000000000001)
Cannot open /usr/local/share/urjtag/MANUFACTURERS
Unknown manufacturer!
chain.c(149) Part 0 without active instruction
chain.c(200) Part 0 without active instruction
chain.c(149) Part 0 without active instruction
jtag>
FreeBSDで使っている人といないのかもな。。。とりあえずバグレポート入れてみた。prだしてmergeしてもらって直ってます。
ちなみにパラレルポートのioctlは下記のように名前が違うが、同じように使えるようだ。
Linux | FreeBSD |
---|---|
PPWDATA | PPISDATA |
PPRDATA | PPIGDATA |
PPRSTATUS | PPIGSTATUS |
PPWCONTROL | PPISCTRL |
上記はurjtag-0.10のリリースファイルをベースに確認しました。sourceforgeのgitにある最新のソースはconfigureが通りませんでした。
せっかくなので、最新のソース(更新は一年くらい前ですが)をビルドを試してみました。環境は10.3Rです。
autoconf,automake,libtool,pkgconfのパッケージが入ったマシンでソースに含まれるautogen.shというスクリプトを実行するとconfigureが作られるようなのですが、エラーが出ます。
hiroki@amd64:~/u-himori-urjtag/urjtag % ./autogen.sh
autoreconf-2.69: Entering directory `.'
autoreconf-2.69: running: autopoint --force
Can't exec "autopoint": No such file or directory at /usr/local/share/autoconf-2.69/Autom4te/FileUtils.pm line 345.
autoreconf-2.69: failed to run autopoint: No such file or directory
autoreconf-2.69: autopoint is needed because this package uses Gettext
autoreconf failed.
これは、gettextのパッケージが必要なためのようです。
あとbisonとgmakeも必要になります。インストールせずに実行できるようにスタティックリンクでコンフィグレーションしてビルドします。phthonはエラーになるので省きました。
% ./configure --disable-python --disable-shared
% gmake
% sudo ./src/apps/jtag/jtag
UrJTAG 0.10 #
Copyright (C) 2002, 2003 ETC s.r.o.
Copyright (C) 2007, 2008, 2009 Kolja Waschk and the respective authors
UrJTAG is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
There is absolutely no warranty for UrJTAG.
warning: UrJTAG may damage your hardware!
Type "quit" to exit, "help" for help.
jtag> cable ByteBlaster ppi /dev/ppi0
Initializing ppi port /dev/ppi0
昔はautoconf,automakeだけでOKだったのに、なんか依存増えてややっこしいですね。
gmakeに依存した部分は1カ所だったので、forkした自分のブランチはBSD Makeでも通るようにしてあります。
パラレルポートのある古いマシンは消費電力が大きいので、USB Blasterもどきを作ってみたので、USBしか無いサーバでpkgでlibftdi1をインストールしてconfigureして試してみた。
% sudo ./src/apps/jtag/jtag
UrJTAG 0.10 #
Copyright (C) 2002, 2003 ETC s.r.o.
Copyright (C) 2007, 2008, 2009 Kolja Waschk and the respective authors
UrJTAG is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
There is absolutely no warranty for UrJTAG.
warning: UrJTAG may damage your hardware!
Type "quit" to exit, "help" for help.
jtag> cable UsbBlaster
Connected to libftdi driver.
jtag> detect
IR length: 5
Chain length: 1
Device Id: 00000000000000000000000000000001 (0x00000001)
error: Unable to open file '/usr/local/share/urjtag/MANUFACTURERS'
Unknown manufacturer! (00000000000) (/usr/local/share/urjtag/MANUFACTURERS)
jtag> include ./data/admtek/adm5120/adm5120
ImpCode=01000001010000000100000000000000 41404000
EJTAG version: 2.6
EJTAG Implementation flags: R4k DINTsup ASID_8 NoDMA MIPS32
Processor entered Debug Mode.
4KByteの読み込みに3分25秒もかかる。Macだと44秒くらいなのであまり利用価値が無いかも。