OpenOCD Flyswatter2 not connecting to imx28

43 Views Asked by At

Using OpenOCD on Ubuntu, a Flyswatter2 programmer, connected through JTAG to an iMX28 processor.

I am asking for help to connect to the processor, eliminate the errors and/or read/write the flash content. I am not sure where the errors come from, searching did not get me to any helpful answer. If might also be my lack of expertise with OpenOCD/iMX/Flyswatter2.

Any help would be appreciated, thank you.

Here's what I tried so far:

...using modified flyswatter2.cfg (added speed specification, used 1, 100, 1000 for speed, kHz that is, so 1kHz to 1MHz)

#
# TinCanTools Flyswatter2
#
# http://www.tincantools.com/product.php?productid=16153
#

adapter driver ftdi
jtag_khz 1

ftdi_device_desc "Flyswatter2"
ftdi_vid_pid 0x0403 0x6010

ftdi_layout_init 0x0538 0x057b
ftdi_layout_signal LED -ndata 0x0400
ftdi_layout_signal nTRST -data 0x0010
ftdi_layout_signal nSRST -data 0x0020 -noe 0x0100

...and using this config file (I had to update the CPUID from the original imx28.cfg file, since the manufacturer changed)

# i.MX28 config file.
# based off of the imx21.cfg file.

reset_config trst_and_srst

#jtag nTRST and nSRST delay
adapter srst delay 100
jtag_ntrst_delay 100

if { [info exists CHIPNAME] } {
   set  _CHIPNAME $CHIPNAME
} else {
   set  _CHIPNAME imx28
}

if { [info exists ENDIAN] } {
   set  _ENDIAN $ENDIAN
} else {
   set  _ENDIAN little
}


# Note above there is 1 tap

# The CPU tap
if { [info exists CPUTAPID] } {
   set _CPUTAPID $CPUTAPID
} else {
   set _CPUTAPID 0x0882401d
}
jtag newtap $_CHIPNAME cpu  -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID


# Create the GDB Target.
set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME arm926ejs -endian $_ENDIAN -chain-position $_TARGETNAME

arm7_9 dcc_downloads enable

Executing this command

sudo openocd -f interface/ftdi/flyswatter2.cfg -f target/imx28u.cfg

...gets me to this output:

Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
dcc downloads are enabled

Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 1 kHz
Info : JTAG tap: imx28.cpu tap/device found: 0x0882401d (mfg: 0x00e (Freescale (Motorola)), part: 0x8824, ver: 0x0)
Info : Embedded ICE version 0
Error: unknown EmbeddedICE version (comms ctrl: 0x00000000)
Info : imx28.cpu: hardware has 2 breakpoint/watchpoint units
Info : starting gdb server for imx28.cpu on 3333
Info : Listening on port 3333 for gdb connections
Warn : Haven't made progress in mpsse_flush() for 2115ms.
Error: invalid mode value encountered 0
Error: cp15 read operation timed out
Polling target imx28.cpu failed, trying to reexamine
Info : Embedded ICE version 0
Error: unknown EmbeddedICE version (comms ctrl: 0x00000000)
Info : imx28.cpu: hardware has 2 breakpoint/watchpoint units

...updated Feb 5 with detailed debug output:

Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
User : 13 1 options.c:63 configuration_output_handler(): debug_level: 3
User : 14 1 options.c:63 configuration_output_handler(): 
Debug: 15 2 options.c:244 add_default_dirs(): bindir=/usr/bin
Debug: 16 2 options.c:245 add_default_dirs(): pkgdatadir=/usr/share/openocd
Debug: 17 2 options.c:246 add_default_dirs(): exepath=/usr/bin
Debug: 18 2 options.c:247 add_default_dirs(): bin2data=../share/openocd
Debug: 19 2 configuration.c:42 add_script_search_dir(): adding /root/.config/openocd
Debug: 20 2 configuration.c:42 add_script_search_dir(): adding /root/.openocd
Debug: 21 2 configuration.c:42 add_script_search_dir(): adding /usr/bin/../share/openocd/site
Debug: 22 2 configuration.c:42 add_script_search_dir(): adding /usr/bin/../share/openocd/scripts
Debug: 23 2 configuration.c:97 find_file(): found /usr/bin/../share/openocd/scripts/interface/ftdi/flyswatter2.cfg
Debug: 24 2 command.c:146 script_debug(): command - adapter driver ftdi
Debug: 26 2 command.c:146 script_debug(): command - adapter speed 8000
Debug: 28 2 core.c:1822 jtag_config_khz(): handle jtag khz
Debug: 29 2 core.c:1785 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 30 2 core.c:1785 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 31 2 command.c:146 script_debug(): command - ftdi_device_desc Flyswatter2
Debug: 33 2 command.c:146 script_debug(): command - ftdi_vid_pid 0x0403 0x6010
Debug: 35 2 command.c:146 script_debug(): command - ftdi_layout_init 0x0538 0x057b
Debug: 37 2 command.c:146 script_debug(): command - ftdi_layout_signal LED -ndata 0x0400
Debug: 39 2 command.c:146 script_debug(): command - ftdi_layout_signal nTRST -data 0x0010
Debug: 41 2 command.c:146 script_debug(): command - ftdi_layout_signal nSRST -data 0x0020 -noe 0x0100
Debug: 43 2 configuration.c:97 find_file(): found /usr/bin/../share/openocd/scripts/target/imx28u.cfg
Debug: 44 2 command.c:146 script_debug(): command - reset_config trst_and_srst
Debug: 46 2 command.c:146 script_debug(): command - adapter srst delay 100
Debug: 48 2 command.c:146 script_debug(): command - transport select
Info : 49 2 transport.c:275 jim_transport_select(): auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
Debug: 50 2 command.c:146 script_debug(): command - transport select
Debug: 51 2 command.c:146 script_debug(): command - jtag_ntrst_delay 100
Debug: 53 2 command.c:146 script_debug(): command - jtag newtap imx28 cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 0x0882401d
Debug: 54 2 tcl.c:571 jim_newtap_cmd(): Creating New Tap, Chip: imx28, Tap: cpu, Dotted: imx28.cpu, 8 params
Debug: 55 2 tcl.c:596 jim_newtap_cmd(): Processing option: -irlen
Debug: 56 2 tcl.c:596 jim_newtap_cmd(): Processing option: -ircapture
Debug: 57 2 tcl.c:596 jim_newtap_cmd(): Processing option: -irmask
Debug: 58 2 tcl.c:596 jim_newtap_cmd(): Processing option: -expected-id
Debug: 59 2 core.c:1484 jtag_tap_init(): Created Tap: imx28.cpu @ abs position 0, irlen 4, capture: 0x1 mask: 0xf
Debug: 60 2 command.c:146 script_debug(): command - target create imx28.cpu arm926ejs -endian little -chain-position imx28.cpu
Debug: 61 2 target.c:2172 target_free_all_working_areas_restore(): freeing all working areas
Debug: 62 2 armv4_5.c:496 arm_set_cpsr(): set CPSR 0x00000010: User mode, ARM state
Debug: 63 3 command.c:146 script_debug(): command - arm7_9 dcc_downloads enable
User : 65 3 options.c:63 configuration_output_handler(): dcc downloads are enabled
User : 66 3 options.c:63 configuration_output_handler(): 
Info : 67 3 server.c:311 add_service(): Listening on port 6666 for tcl connections
Info : 68 3 server.c:311 add_service(): Listening on port 4444 for telnet connections
Debug: 69 3 command.c:146 script_debug(): command - init
Debug: 71 3 command.c:146 script_debug(): command - target init
Debug: 73 3 command.c:146 script_debug(): command - target names
Debug: 74 3 command.c:146 script_debug(): command - imx28.cpu cget -event gdb-flash-erase-start
Debug: 75 3 command.c:146 script_debug(): command - imx28.cpu configure -event gdb-flash-erase-start reset init
Debug: 76 3 command.c:146 script_debug(): command - imx28.cpu cget -event gdb-flash-write-end
Debug: 77 3 command.c:146 script_debug(): command - imx28.cpu configure -event gdb-flash-write-end reset halt
Debug: 78 3 command.c:146 script_debug(): command - imx28.cpu cget -event gdb-attach
Debug: 79 3 command.c:146 script_debug(): command - imx28.cpu configure -event gdb-attach halt 1000
Debug: 80 3 target.c:1639 handle_target_init_command(): Initializing targets...
Debug: 81 3 semihosting_common.c:99 semihosting_common_init():  
Debug: 82 3 ftdi.c:650 ftdi_initialize(): ftdi interface using shortest path jtag state transitions
Debug: 83 10 mpsse.c:422 mpsse_purge(): -
Debug: 84 10 mpsse.c:703 mpsse_loopback_config(): off
Debug: 85 10 mpsse.c:748 mpsse_set_frequency(): target 8000000 Hz
Debug: 86 10 mpsse.c:740 mpsse_rtck_config(): off
Debug: 87 10 mpsse.c:729 mpsse_divide_by_5_config(): off
Debug: 88 10 mpsse.c:709 mpsse_set_divisor(): 3
Debug: 89 10 mpsse.c:772 mpsse_set_frequency(): actually 7500000 Hz
Debug: 90 11 core.c:1785 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 91 11 core.c:1789 adapter_khz_to_speed(): have interface set up
Debug: 92 11 mpsse.c:748 mpsse_set_frequency(): target 8000000 Hz
Debug: 93 11 mpsse.c:740 mpsse_rtck_config(): off
Debug: 94 11 mpsse.c:729 mpsse_divide_by_5_config(): off
Debug: 95 11 mpsse.c:709 mpsse_set_divisor(): 3
Debug: 96 11 mpsse.c:772 mpsse_set_frequency(): actually 7500000 Hz
Debug: 97 11 core.c:1785 adapter_khz_to_speed(): convert khz to interface specific speed value
Debug: 98 11 core.c:1789 adapter_khz_to_speed(): have interface set up
Info : 99 11 core.c:1565 adapter_init(): clock speed 8000 kHz
Debug: 100 11 openocd.c:143 handle_init_command(): Debug Adapter init complete
Debug: 101 11 command.c:146 script_debug(): command - transport init
Debug: 103 11 transport.c:229 handle_transport_init(): handle_transport_init
Debug: 104 11 core.c:830 jtag_add_reset(): SRST line released
Debug: 105 11 core.c:855 jtag_add_reset(): TRST line released
Debug: 106 11 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 107 214 command.c:146 script_debug(): command - jtag arp_init
Debug: 108 214 core.c:1578 jtag_init_inner(): Init JTAG chain
Debug: 109 215 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 110 215 core.c:1243 jtag_examine_chain(): DR scan interrogation for IDCODE/BYPASS
Debug: 111 215 core.c:327 jtag_call_event_callbacks(): jtag event: TAP reset
Info : 112 215 core.c:1142 jtag_examine_chain_display(): JTAG tap: imx28.cpu tap/device found: 0x0882401d (mfg: 0x00e (Freescale (Motorola)), part: 0x8824, ver: 0x0)
Debug: 113 215 core.c:1374 jtag_validate_ircapture(): IR capture validation scan
Debug: 114 215 core.c:1431 jtag_validate_ircapture(): imx28.cpu: IR capture 0x01
Debug: 115 215 command.c:146 script_debug(): command - dap init
Debug: 117 215 arm_dap.c:106 dap_init_all(): Initializing all DAPs ...
Debug: 118 215 openocd.c:160 handle_init_command(): Examining targets...
Debug: 119 215 target.c:1825 target_call_event_callbacks(): target event 19 (examine-start) for core imx28.cpu
Info : 120 215 embeddedice.c:230 embeddedice_build_reg_cache(): Embedded ICE version 0
Error: 121 215 embeddedice.c:293 embeddedice_build_reg_cache(): unknown EmbeddedICE version (comms ctrl: 0x00000000)
Info : 122 215 embeddedice.c:299 embeddedice_build_reg_cache(): imx28.cpu: hardware has 2 breakpoint/watchpoint units
Debug: 123 215 arm7_9_common.c:73 arm7_9_clear_watchpoints(): -
Debug: 124 215 embeddedice.c:516 embeddedice_write_reg(): 12: 0x00000000
Debug: 125 215 embeddedice.c:516 embeddedice_write_reg(): 20: 0x00000000
Debug: 126 216 target.c:1825 target_call_event_callbacks(): target event 21 (examine-end) for core imx28.cpu
Debug: 127 216 command.c:146 script_debug(): command - flash init
Debug: 129 216 tcl.c:1385 handle_flash_init_command(): Initializing flash devices...
Debug: 130 216 command.c:146 script_debug(): command - nand init
Debug: 132 216 tcl.c:498 handle_nand_init_command(): Initializing NAND devices...
Debug: 133 216 command.c:146 script_debug(): command - pld init
Debug: 135 216 pld.c:206 handle_pld_init_command(): Initializing PLDs...
Info : 136 216 gdb_server.c:3503 gdb_target_start(): starting gdb server for imx28.cpu on 3333
Info : 137 216 server.c:311 add_service(): Listening on port 3333 for gdb connections
^CDebug: 138 4269 server.c:609 sig_handler(): Terminating on Signal 2
Debug: 139 4269 command.c:146 script_debug(): command - shutdown
User : 141 4269 server.c:755 handle_shutdown_command(): shutdown command invoked
Debug: 142 4269 target.c:2172 target_free_all_working_areas_restore(): freeing all working areas
0

There are 0 best solutions below