Здесь показаны различия между двумя версиями данной страницы.
| Предыдущая версия справа и слева Предыдущая версия Следующая версия | Предыдущая версия | ||
|
equipment:embedded:voipac_pxa270_baseboard [2026/04/03 02:30] sergey [buildroot config] |
equipment:embedded:voipac_pxa270_baseboard [2026/04/03 07:22] (текущий) sergey [Flash with JTAG] |
||
|---|---|---|---|
| Строка 70: | Строка 70: | ||
| Прошиваем обновленный загрузчик через JTAG. | Прошиваем обновленный загрузчик через JTAG. | ||
| + | Удобно это делать на отладочной baseboard: | ||
| + | {{ :equipment:embedded:pxa270_dimm_base_board-datasheet.pdf |}} {{ :equipment:embedded:pxa270_dimm_base_board-schematic.pdf |}} | ||
| + | К плате подключаем JLINK, 12V и COM-порт. | ||
| + | На компьютер устанавливаем openocd: | ||
| + | $ sudo apt install openocd | ||
| + | $ openocd --version | ||
| + | Open On-Chip Debugger 0.12.0 | ||
| + | |||
| + | В отдельном окне запускаем minicom или miniterm | ||
| + | pyserial-miniterm /dev/ttyUSB2 38400 | ||
| + | minicom -D /dev/ttyUSB2 -b 38400 | ||
| + | |||
| + | Запускаем отладчик с правильным конфигурационным файлом. | ||
| + | |||
| + | :!: В разных JLINK сделанных на чипе ftdi может быть по-разному распаян пин RST. | ||
| + | Поэтому пробуем разные значения 'ftdi layout_init' пока не заработает. | ||
| + | |||
| + | <file cfg vpac270_openocd_v0.12.cfg> | ||
| + | #Voipac PXA270 Script | ||
| + | |||
| + | telnet_port 4444 | ||
| + | gdb_port 3333 | ||
| + | adapter driver ftdi | ||
| + | transport select jtag | ||
| + | ftdi vid_pid 0x0403 0x6010 | ||
| + | ftdi channel 1 | ||
| + | #ftdi layout_init 0x0018 0x00fb | ||
| + | ftdi layout_init 0x0078 0x007b | ||
| + | ftdi layout_signal nTRST -data 0x0010 -oe 0x0010 | ||
| + | ftdi layout_signal nSRST -data 0x0040 -oe 0x0040 | ||
| + | |||
| + | # JTAG speed (kHz) – adjust as needed | ||
| + | adapter speed 1000 | ||
| + | |||
| + | # Variables for PXA270 | ||
| + | if { [info exists CHIPNAME] } { | ||
| + | set _CHIPNAME $CHIPNAME | ||
| + | } else { | ||
| + | set _CHIPNAME pxa270 | ||
| + | } | ||
| + | |||
| + | if { [info exists ENDIAN] } { | ||
| + | set _ENDIAN $ENDIAN | ||
| + | } else { | ||
| + | set _ENDIAN little | ||
| + | } | ||
| + | |||
| + | if { [info exists CPUTAPID ] } { | ||
| + | set _CPUTAPID $CPUTAPID | ||
| + | } else { | ||
| + | set _CPUTAPID 0x79265013 | ||
| + | } | ||
| + | |||
| + | adapter srst delay 260 | ||
| + | jtag_ntrst_delay 0 | ||
| + | |||
| + | #use combined on interfaces or targets that can't set TRST/SRST separately | ||
| + | reset_config trst_and_srst separate | ||
| + | |||
| + | # JTAG scan chain | ||
| + | set _TARGETNAME $_CHIPNAME.cpu | ||
| + | jtag newtap $_CHIPNAME cpu -irlen 7 -ircapture 0x1 -irmask 0x7f -expected-id $_CPUTAPID | ||
| + | |||
| + | # Target creation | ||
| + | target create $_TARGETNAME xscale -endian $_ENDIAN -chain-position $_TARGETNAME | ||
| + | |||
| + | # Work area configuration | ||
| + | $_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x5c000000 -work-area-size 0x10000 -work-area-backup 0 | ||
| + | |||
| + | # Flash banks (CFI driver remains valid) | ||
| + | flash bank flash0 cfi 0x00000000 0x2000000 2 2 $_TARGETNAME | ||
| + | flash bank flash1 cfi 0x02000000 0x2000000 2 2 $_TARGETNAME | ||
| + | |||
| + | </file> | ||
| + | |||
| + | |||
| + | $ openocd -f vpac270_openocd_v0.12.cfg | ||
| + | Open On-Chip Debugger 0.12.0 | ||
| + | Licensed under GNU GPL v2 | ||
| + | For bug reports, read | ||
| + | http://openocd.org/doc/doxygen/bugs.html | ||
| + | Info : pxa270.cpu: hardware has 2 breakpoints and 2 watchpoints | ||
| + | Info : Listening on port 6666 for tcl connections | ||
| + | Info : Listening on port 4444 for telnet connections | ||
| + | Info : clock speed 1000 kHz | ||
| + | Info : JTAG tap: pxa270.cpu tap/device found: 0x79265013 (mfg: 0x009 (Intel), part: 0x9265, ver: 0x7) | ||
| + | Info : starting gdb server for pxa270.cpu on 3333 | ||
| + | Info : Listening on port 3333 for gdb connections | ||
| + | |||
| + | |||
| + | Подключаемся к консоли отладчика и загружаем в память u-boot: | ||
| + | |||
| + | {{ :equipment:embedded:vpac270_x-boot_u-boot.zip |}} | ||
| + | |||
| + | > telnet localhost 4444 | ||
| + | |||
| + | Trying 127.0.0.1... | ||
| + | Connected to localhost. | ||
| + | Escape character is '^]'. | ||
| + | Open On-Chip Debugger | ||
| + | > reset halt | ||
| + | JTAG tap: pxa270.cpu tap/device found: 0x79265013 (mfg: 0x009 (Intel), part: 0x9265, ver: 0x7) | ||
| + | Bad value '00' captured during DR or IR scan: | ||
| + | check_value: 0x02 | ||
| + | check_mask: 0x07 | ||
| + | JTAG error while writing DCSR | ||
| + | target halted in ARM state due to debug-request, current mode: Supervisor | ||
| + | cpsr: 0x080000d3 pc: 0x00000000 | ||
| + | MMU: disabled, D-Cache: disabled, I-Cache: disabled | ||
| + | (processor reset) | ||
| + | > load_image /tftpboot/u-boot-1.1.2-vpac4.bin 0x5c010000 | ||
| + | 51568 bytes written at address 0x5c010000 | ||
| + | downloaded 51568 bytes in 0.555464s (90.662 KiB/s) | ||
| + | > resume 0x5c010000 | ||
| + | | ||
| + | Успеваем переключиться на окно с minicom/miniterm и нажать любую клавишу. | ||
| + | |||
| + | Должны увидеть приглашение командной строки u-boot: | ||
| + | |||
| + | U-Boot 1.1.2-vpac4 (Feb 26 2009 - 15:19:32) | ||
| + | |||
| + | U-Boot code: 5C010000 -> 5C01C970 BSS: -> 5C020454 | ||
| + | RAM Configuration: | ||
| + | Bank #0: a0000000 128 MB | ||
| + | Bank #1: 80000000 128 MB | ||
| + | Flash: 64 MB | ||
| + | dm9000 i/o: 0x8000300 (32bit), id: 0x90000a46 | ||
| + | MAC: 00:0d:15:00:a2:74 | ||
| + | Hit any key to stop autoboot: 0 | ||
| + | u-boot> | ||
| + | |||
| + | |||
| + | Use TFT to download first stage boot loader x-load.bin and write it to flash at offset 0. | ||
| + | |||
| + | u-boot> erase all | ||
| + | u-boot> tftp x-load.bin | ||
| + | u-boot> cp.b a1000000 0 400 | ||
| + | |||
| + | |||
| + | NOTE: During erase some blocks may fail to erase, those are bad blocks which may appear. | ||
| + | |||
| + | Download second stage bootloader and write it to flash at offset 0x800. | ||
| + | |||
| + | u-boot> tftp u-boot-1.1.2-vpac4.bin | ||
| + | u-boot> cp.b $(fileaddr) 800 $(filesize) | ||
| + | |||
| + | |||
| + | After power cycling baseboard, the first stage X-Loader and next u-boot bootloader should come up. | ||
| + | |||
| + | |||
| + | Или одним файлом сразу оба загрузчика: | ||
| + | |||
| + | set serverip 172.22.0.101 | ||
| + | set ipaddr 172.22.0.123 | ||
| + | tftp x.img | ||
| + | erase 1:0- | ||
| + | cp.b $(fileaddr) 0 $(filesize) | ||
| ===== DMA ===== | ===== DMA ===== | ||