====== OpenOCD ====== [[http://openocd.berlios.de|OpenOCD]] --- внутрисхемный отладчик с лицензией GPL, автор --- Dominic Rath. ===== Проверенные версии ===== На OpenOCD следующих версий работает запись во Flash: * 0.5.0 Release * 0.3.1 (из Debian GNU/Linux 6.0) * 0.2.0 Release * svn1213 ===== Соединение сигналов ===== [[adapters:jtag|Схема переходника]]. ===== Конфигурационные файлы для Linux ===== ==== OpenOCD 0.5.0 ==== openocd -s path/to/interface -f olimex-arm-usb-ocd.cfg -f tion270_openocd-0.5.0.cfg \ -c "flash protect 0 0 1 off" -c "flash erase_sector 0 1 1" \ -c "flash write_image erase /home/user/u-boot.bin" Файл ''olimex-arm-usb-ocd.cfg'' (или ''parport.cfg'', ''olimex-arm-usb-ocd-h.cfg'' и др.) используется из оригинального архива OpenOCD данной версии. ARM-USB-OCD**-H** работает с драйвером ftdi_sio из ядра Linux 3.2 (есть в репозитории Debian backports). {{filelist>openocd/0.5.0/*&style=table&tableheader=1&tableshowdate=1&tableshowsize=1&direct=1}} ==== OpenOCD 0.3.1 ==== Запись в нулевой сектор Flash Тион270 или Тион-Про270 файла ''/home/user/u-boot.bin'' с предварительным стиранием первого сектора и снятием защиты с нулевого и первого секторов с использованием Olimex [[http://www.olimex.com/dev/arm-usb-ocd.html|ARM-USB-OCD]] (порядок файлов важен): openocd -s /usr/share/openocd/scripts/interface -f olimex-arm-usb-ocd.cfg -f tion270.cfg \ -c "flash protect 0 0 1 off" -c "flash erase_sector 0 1 1" \ -c "flash write_image erase /home/user/u-boot.bin" Файл ''olimex-arm-usb-ocd.cfg'' настройки программатора используется из директории ''/usr/share/openocd/scripts/interface''. {{filelist>openocd/0.3.1/*&style=table&tableheader=1&tableshowdate=1&tableshowsize=1&direct=1}} ==== OpenOCD 0.2 и ранее ==== Запись во Flash Тион270 или Тион-Про270 файла указанного в файле ''reflash'' с использованием Olimex [[http://www.olimex.com/dev/arm-usb-ocd.html|ARM-USB-OCD]] (порядок файлов важен): openocd -f olimex-arm-usb-ocd -f tion-pro270 -f reflash {{filelist>openocd/0.2/*&style=table&tableheader=1&tableshowdate=1&tableshowsize=1&direct=1}} ===== Конфигурационные файлы для Windows ===== ==== OpenOCD 0.5.0 ==== Относительные пути указаны от каталога ''C:\Program Files\OpenOCD\openocd-0.5.0\bin''. Запись во Flash Тион270 или Тион-Про270 указанного файла (порядок важен):\\ ''openocd-0.5.0.exe -s ..\interface -f parport.cfg -f ..\..\tion270_openocd-0.5.0.cfg -c "flash protect 0 0 1 off" -c "flash erase_sector 0 1 1" -c "flash write_image erase c:\\u-boot.bin"'' {{filelist>openocd/0.5.0/*&style=table&tableheader=1&tableshowdate=1&tableshowsize=1&direct=1}} ==== Предыдущие версии ==== Запись во Flash Тион270 или Тион-Про270 файла, указанного в файле ''reflash'', с использованием Olimex [[http://www.olimex.com/dev/arm-usb-ocd.html|ARM-USB-OCD]] (порядок файлов важен):\\ ''openocd -f olimex-arm-usb-ocd -f tion-pro270 -f reflash'' Запись во Flash Тион270 или Тион-Про270 файла, указанного в файле ''reflash'', с использованием Olimex [[http://www.olimex.com/dev/arm-jtag.html|ARM-JTAG]] (порядок файлов важен):\\ ''openocd -f parport -f tion-pro270 -f reflash'' {{filelist>openocd/win/*&style=table&tableheader=1&tableshowdate=1&tableshowsize=1&direct=1}} Команда для записи образа загрузчика eboot выглядит следующим образом: flash write_image erase eboot.nb0 ===== Бинарный файл для XScale ===== Если этого файла нет в поставке OpenOCD, разместите его в директории ''xscale'' директории с установленным OpenOCD. {{filelist>openocd/xscale/*&style=table&tableheader=1&tableshowdate=1&tableshowsize=1&direct=1}} ===== Пример информационных сообщений ===== ==== OpenOCD 0.5.0 ==== C:\Program Files\OpenOCD\openocd-0.5.0\bin>openocd-0.5.0.exe -s ..\interface -f parport.cfg -f ..\..\tion270_openocd-0.5.0.cfg -c "flash protect 0 0 1 off" -c "flash erase_sector 0 1 1" -c "flash write_image erase c:\\u-boot.bin" Open On-Chip Debugger 0.5.0 (2011-08-09-23:21) Licensed under GNU GPL v2 For bug reports, read http://openocd.berlios.de/doc/doxygen/bugs.html Warn : Adapter driver 'parport' did not declare which transports it allows; assuming legacy JTAG-only Info : only one transport option; autoselect 'jtag' parport port = 0x378 adapter_nsrst_delay: 260 jtag_ntrst_delay: 250 Info : tion270.cpu: hardware has 2 breakpoints and 2 watchpoints adapter_nsrst_delay: 10 jtag_ntrst_delay: 10 1000 kHz trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain Info : clock speed 500 kHz Info : JTAG tap: tion270.cpu tap/device found: 0x89265013 (mfg: 0x009, part: 0x9265, ver: 0x8) Info : JTAG tap: tion270.cpu tap/device found: 0x89265013 (mfg: 0x009, part: 0x9265, ver: 0x8) Warn : Bad value '00' captured during DR or IR scan: Warn : check_value: 0x02 Warn : check_mask: 0x07 Error: JTAG error while writing DCSR target state: halted target halted in ARM state due to debug-request, current mode: Supervisor cpsr: 0x780000d3 pc: 0x00000000 MMU: disabled, D-Cache: disabled, I-Cache: disabled (processor reset) Info : Flash Manufacturer/Device: 0x0089 0x0018 Info : Flash Manufacturer/Device: 0x0089 0x0018 flash 'cfi' found at 0x00000000 cleared protection for sectors 0 through 1 on flash bank 0 erased sectors 1 through 1 on flash bank 0 in 0.609375s auto erase enabled wrote 262144 bytes from file c:\u-boot.bin in 13.000000s (19.692 KiB/s) ==== OpenOCD 0.3.1 ==== openocd -s /usr/share/openocd/scripts/interface -f olimex-arm-usb-ocd.cfg -f tion270.cfg \ -c "flash protect 0 0 4 off" -c "flash erase_sector 0 2 2" \ -c "flash write_image erase /home/asv/u-boot.bin" Open On-Chip Debugger 0.3.1 (2009-11-25-12:22) $URL$ For bug reports, read http://openocd.berlios.de/doc/doxygen/bugs.html jtag_nsrst_delay: 260 jtag_ntrst_delay: 250 jtag_nsrst_delay: 10 jtag_ntrst_delay: 10 trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain Info : clock speed 6000 kHz Info : JTAG tap: tion270.cpu tap/device found: 0x79265013 (mfg: 0x009, part: 0x9265, ver: 0x7) Info : JTAG tap: tion270.cpu tap/device found: 0x79265013 (mfg: 0x009, part: 0x9265, ver: 0x7) Warn : Bad value '00' captured during DR or IR scan: Warn : check_value: 0x02 Warn : check_mask: 0x07 Error: JTAG error while writing DCSR target state: halted target halted in ARM state due to debug-request, current mode: Supervisor cpsr: 0x180000d3 pc: 0x00000000 MMU: disabled, D-Cache: disabled, I-Cache: disabled (processor reset) Info : Flash Manufacturer/Device: 0x0089 0x0018 Warn : Bad value '07' captured during DR or IR scan: Warn : check_value: 0x02 Warn : check_mask: 0x06 Error: JTAG error while receiving data from debug handler flash 'cfi' found at 0x00000000 cleared protection for sectors 0 through 4 on flash bank 0 erased sectors 2 through 2 on flash bank 0 in 0.716581s auto erase enabled Info : Using target buffer at 0x5c000038 and of size 0x8000 Info : Write 0x8000 bytes to flash at 0x00000000 Info : Write 0x8000 bytes to flash at 0x00008000 Info : Write 0x8000 bytes to flash at 0x00010000 Info : Write 0x8000 bytes to flash at 0x00018000 Info : Write 0x5648 bytes to flash at 0x00020000 wrote 153160 byte from file /home/asv/u-boot.bin in 4.620641s (32.370037 kb/s) ==== OpenOCD svn1213 ==== $ openocd -f olimex-arm-usb-ocd -f tion-pro270 -f reflash Open On-Chip Debugger 1.0 (2009-02-10-16:25) svn:1213 BUGS? Read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS $URL: svn://svn.berlios.de/openocd/trunk/src/openocd.c $ 2000 kHz Info: JTAG tap: pxa270.cpu tap/device found: 0x79265013 (Manufacturer: 0x009, Part: 0x9265, Version: 0x7) Info: JTAG Tap/device matched Warning:no telnet port specified, using default port 4444 Warning:no gdb port specified, using default port 3333 Warning:no tcl port specified, using default port 6666 Info: JTAG tap: pxa270.cpu tap/device found: 0x79265013 (Manufacturer: 0x009, Part: 0x9265, Version: 0x7) Info: JTAG Tap/device matched Warning:TAP pxa270.cpu: Warning:value captured during scan didn't pass the requested check: Warning:captured: 0x00 check_value: 0x02 check_mask: 0x07 Warning:in_handler reported a failed check Error: JTAG error while writing DCSR Warning:TAP pxa270.cpu: Warning:value captured during scan didn't pass the requested check: Warning:captured: 0x00 check_value: 0x01 check_mask: 0x7f Warning:in_handler reported a failed check target state: halted target halted in ARM state due to debug-request, current mode: Supervisor cpsr: 0x000000d3 pc: 0x00000000 MMU: disabled, D-Cache: disabled, I-Cache: disabled (processor reset) flash 'cfi' found at 0x00000000 auto erase enabled Info: Using target buffer at 0x5c000038 and of size 0x8000 Info: Write 0x8000 bytes to flash at 0x00000000 Info: Write 0x8000 bytes to flash at 0x00008000 Info: Write 0x8000 bytes to flash at 0x00010000 Info: Write 0x4710 bytes to flash at 0x00018000 wrote 116496 byte from file u-boot-1.3.3_svn381_tion270-pxa270-series_bin/u-boot-1.3.3_svn381_tion-pro270.bin in 9.4 72898s (12.009590 kb/s)