OPENOCD 0.3.0安装
//-------------------- 解压缩 ----------------
tar jxvf openjtag.tar.bz2
cd openjtag
//------------ 使用USB到UART转换器 ------------
cp 50-ftdi.rules /etc/udev/rules.d/
## and then, the ttyUSB0 & ttyUSB1 will be created in /dev/ floader, you can connect the ttyUSB1 via the minicom. don't use the ttyUSB0. if the ttyUSB1 doesn't exist, you'll try the ttyUSB0.
//------------配置minicom -----------------------------
minicom -s
Serial setup
设置波特率为 115200 8N1
Hardware Flow Control:NO
Software Flow Control:NO
CRTL + A q(exit) o(setup) z(help)
//------------ 建立LIBUSB库 ------
tar zxvf libftd2xx0.4.16.tar.gz
cd libftd2xx0.4.16/libusb-0.1.12
cp libftd2xx0.so.0.4.16 /usr/lib/libftd2xx0.so
ln -s libftd2xx0.so.0.4.16 libftd2xx0.so
make clean
make distclean
./configure
make
make install
//------------ 配置安装OPENOCD------------------------
cd ../../
tar zxvf openocd-0.3.0.tar.gz
cd openocd-0.3.0
./configure --enable-parport --enable-parport_ppdev --enable-ft2232_ftd2xx --enable-usbprog --enable-jlink --with-ftd2xx-linux-tardir=<FULL PATH>/openjtag/libftd2xx0.4.16
make
make install
//------------ 配置OPENOCD的配置文件 ------------
cd <工作目录或者是任意目录>
## select connect interface: openjtag: openjtag, jlink, ulink or ... ?
cp <...>/openjtag/openocd-0.1.0/src/target/interface/openjtag.cfg ./openocd.cfg
## select board: s3c2410, s3c2440 , at92sam9261 or ... ?
cat <...>/openjtag/openocd-0.1.0/src/target/target/samsung_s3c2410.cfg >> ./openocd.cfg
## begin the openocd service
openocd
//------------- 连接和调试 -----------
telnet 127.0.0.1 4444
## and then, you can use the openocd's command and debug your program, please see the openocd_command_list for detail.
## for example:
poll
halt
arm920t cp15 1
//-------------使用NAND FLASH -----------
## before use the following command, please make sure the "nand device s3c2410 0" or "nand device s3c2440 0"
## in your openocd's config file named openocd.cfg
## probe nand device, please make sure the I & D cache muse be off.
nand probe 0
##read 0x200 bytes at 0 bytes offset from the 0'th nand device
nand dump 0 /home/work/dump.bin 0 0x200
##erase 13 blocks at 7'th block to 20'th block from 0'th nand device
nand erase 0 7 20
## write the test.bin into 0'th nand device at 0'th bytes
nand write 0 /home/work/test.bin 0
//-------------------- 解压缩 ----------------
tar jxvf openjtag.tar.bz2
cd openjtag
//------------ 使用USB到UART转换器 ------------
cp 50-ftdi.rules /etc/udev/rules.d/
## and then, the ttyUSB0 & ttyUSB1 will be created in /dev/ floader, you can connect the ttyUSB1 via the minicom. don't use the ttyUSB0. if the ttyUSB1 doesn't exist, you'll try the ttyUSB0.
//------------配置minicom -----------------------------
minicom -s
Serial setup
设置波特率为 115200 8N1
Hardware Flow Control:NO
Software Flow Control:NO
CRTL + A q(exit) o(setup) z(help)
//------------ 建立LIBUSB库 ------
tar zxvf libftd2xx0.4.16.tar.gz
cd libftd2xx0.4.16/libusb-0.1.12
cp libftd2xx0.so.0.4.16 /usr/lib/libftd2xx0.so
ln -s libftd2xx0.so.0.4.16 libftd2xx0.so
make clean
make distclean
./configure
make
make install
//------------ 配置安装OPENOCD------------------------
cd ../../
tar zxvf openocd-0.3.0.tar.gz
cd openocd-0.3.0
./configure --enable-parport --enable-parport_ppdev --enable-ft2232_ftd2xx --enable-usbprog --enable-jlink --with-ftd2xx-linux-tardir=<FULL PATH>/openjtag/libftd2xx0.4.16
make
make install
//------------ 配置OPENOCD的配置文件 ------------
cd <工作目录或者是任意目录>
## select connect interface: openjtag: openjtag, jlink, ulink or ... ?
cp <...>/openjtag/openocd-0.1.0/src/target/interface/openjtag.cfg ./openocd.cfg
## select board: s3c2410, s3c2440 , at92sam9261 or ... ?
cat <...>/openjtag/openocd-0.1.0/src/target/target/samsung_s3c2410.cfg >> ./openocd.cfg
## begin the openocd service
openocd
//------------- 连接和调试 -----------
telnet 127.0.0.1 4444
## and then, you can use the openocd's command and debug your program, please see the openocd_command_list for detail.
## for example:
poll
halt
arm920t cp15 1
//-------------使用NAND FLASH -----------
## before use the following command, please make sure the "nand device s3c2410 0" or "nand device s3c2440 0"
## in your openocd's config file named openocd.cfg
## probe nand device, please make sure the I & D cache muse be off.
nand probe 0
##read 0x200 bytes at 0 bytes offset from the 0'th nand device
nand dump 0 /home/work/dump.bin 0 0x200
##erase 13 blocks at 7'th block to 20'th block from 0'th nand device
nand erase 0 7 20
## write the test.bin into 0'th nand device at 0'th bytes
nand write 0 /home/work/test.bin 0