I took a look at OpenOCD project, which is a Free Software JTAG Debugger, and figured it'd be actually quite simple to update it to support PXA3xx by looking into the PXA3xx documentation and comparing it with PXA2xx one. Apparently, the only differences there were the Instruction Length (which was 7 for PXA2xx and 11 for PXA3xx) and - the more weird change - that PXA3xx has the instruction codes shifted by 4 to the left in some cases. After fixing these, I was able to connect to the CPU using my FTDI FT2232 based fake-amontec JTAG cable and operate with it normally. The patches are available in the OpenPXA GIT.
Maybe someone would like to see a howto for loading new software into the board using the OpenOCD, so here it is. Firstly, download the OpenOCD patches from OpenPXA GIT and do:
- git clone git://openocd.git.sourceforge.net/gitroot/openocd/openocd # download OpenOCD sources
- cd openocd # enter the OpenOCD directory
- apply OpenPXA patches for OpenOCD
- ./bootstrap # prepare files necessary for OpenOCD compilation
- ./configure --enable-maintainer-mode --enable-ft2232_libftdi # the first option is necessary (dunno why), the other one enables support for the ft2232-based cables
- make # compiles OpenOCD
- ./src/openocd -s tcl -f board/colibri_pxa320.cfg -f interface/jtagkey.cfg # executes the OpenOCD debugger; tells it to search for configuration scripts in directory tcl, to use colibri_pxa320.cfg board support file and jtagkey.cfg cable support file
- telnet localhost 4444 # connect to the OpenOCD
- reset halt # reset the CPU and stop executing instructions
- fast_load_image /path/to/file 0x5c080000 bin # prepare to load binary file to address 0x5c080000 (NOTE: 0x5c080000 is valid SRAM only for PXA320, for other CPUs use 0x5c000000 or something)
- fast_load # actually upload the file
- resume 0x5c080000 # continue instruction execution at address 0x5c080000 (about the address used, see previous note)
No comments:
Post a Comment