olimex-arm-usb-tiny-h with new hardware

Looking for advice on two things:

a) verifying my olimex-arm-usb-tiny-h is functioning properly and

b) configuring for hardware I don’t see explicitly listed in the scripts.

I’m trying to get openocd working with a CEL ZFSM-201-1 eval board. The board has a 20 pin jtag connector for an mc13224 microcontroller (arm7tdmi).

I have tried Windows XP and MacOSX hosts. On windows I have used the openocd provided online (https://www.olimex.com/Products/ARM/JTA … e_v1.1.zip) by Olimex. Not sure why but this “new” online package uses openocd 0.4.0. On MacOSX I have built things from very recent archives and checkouts. The end results are pretty much the same on both host platforms and whether I use configs like the redwire ones and the mc13324v.cfg or a basic setup to try and discover TAP information.

For my example, I will use the “autoprobe” on MacOSX. This was built with: “–enable-maintainer-mode --enable-ft2232_ftd2xx” and the 1.2.2 drivers (2012/10/30) from (http://www.ftdichip.com/Drivers/D2XX.htm) installed. For an openocd.cfg (as I believe suggested by 10.7 of http://openocd.sourceforge.net/doc/html … eclaration):

source [find interface/olimex-arm-usb-tiny-h.cfg]

reset_config trst_and_srst

jtag_rclk 8

Running with:

openocd -c “debug_level 3” -f openocd.cfg

gives the log as reproduced below. The first error is “Error: 111 26484 ft2232.c:591 ft2232_read(): couldn’t read enough bytes from FT2232 device (0 < 81)” and I have seen this on windows as well.

If include the mc13224v.cfg, and issue a subsequent “scan_chain” I see:

TapName Enabled IdCode Expected IrLen IrCap IrMask


0 mc13224.cpu Y 0x00000000 0x1f1f001d 4 0x01 0x0f

Any suggestions?

/////

Open On-Chip Debugger 0.7.0-dev-00135-g76afade-dirty (2013-01-05-11:04)

Licensed under GNU GPL v2

For bug reports, read

http://openocd.sourceforge.net/doc/doxygen/bugs.html

User : 11 4 command.c:549 command_print(): debug_level: 3

Debug: 12 4 configuration.c:86 find_file(): found openocd.cfg

Debug: 13 5 configuration.c:86 find_file(): found /Users/jahess/zigbee/devtools/share/openocd/scripts/interface/olimex-arm-usb-tiny-h.cfg

Debug: 14 5 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_interface ft2232

Debug: 15 5 command.c:145 script_debug(): command - interface ocd_interface ft2232

Debug: 17 5 command.c:369 register_command_handler(): registering ‘ocd_ft2232_device_desc’…

Debug: 18 5 command.c:369 register_command_handler(): registering ‘ocd_ft2232_serial’…

Debug: 19 5 command.c:369 register_command_handler(): registering ‘ocd_ft2232_layout’…

Debug: 20 6 command.c:369 register_command_handler(): registering ‘ocd_ft2232_vid_pid’…

Debug: 21 6 command.c:369 register_command_handler(): registering ‘ocd_ft2232_latency’…

Info : 22 6 transport.c:118 allow_transports(): only one transport option; autoselect ‘jtag’

Debug: 23 6 command.c:369 register_command_handler(): registering ‘ocd_jtag_flush_queue_sleep’…

Debug: 24 6 command.c:369 register_command_handler(): registering ‘ocd_jtag_rclk’…

Debug: 25 6 command.c:369 register_command_handler(): registering ‘ocd_jtag_ntrst_delay’…

Debug: 26 6 command.c:369 register_command_handler(): registering ‘ocd_jtag_ntrst_assert_width’…

Debug: 27 6 command.c:369 register_command_handler(): registering ‘ocd_scan_chain’…

Debug: 28 6 command.c:369 register_command_handler(): registering ‘ocd_jtag_reset’…

Debug: 29 6 command.c:369 register_command_handler(): registering ‘ocd_runtest’…

Debug: 30 6 command.c:369 register_command_handler(): registering ‘ocd_irscan’…

Debug: 31 6 command.c:369 register_command_handler(): registering ‘ocd_verify_ircapture’…

Debug: 32 6 command.c:369 register_command_handler(): registering ‘ocd_verify_jtag’…

Debug: 33 6 command.c:369 register_command_handler(): registering ‘ocd_tms_sequence’…

Debug: 34 6 command.c:369 register_command_handler(): registering ‘ocd_wait_srst_deassert’…

Debug: 35 6 command.c:369 register_command_handler(): registering ‘ocd_jtag’…

Debug: 36 6 command.c:369 register_command_handler(): registering ‘ocd_jtag’…

Debug: 37 7 command.c:369 register_command_handler(): registering ‘ocd_jtag’…

Debug: 38 7 command.c:369 register_command_handler(): registering ‘ocd_jtag’…

Debug: 39 7 command.c:369 register_command_handler(): registering ‘ocd_jtag’…

Debug: 40 7 command.c:369 register_command_handler(): registering ‘ocd_jtag’…

Debug: 41 7 command.c:369 register_command_handler(): registering ‘ocd_jtag’…

Debug: 42 7 command.c:369 register_command_handler(): registering ‘ocd_jtag’…

Debug: 43 7 command.c:369 register_command_handler(): registering ‘ocd_jtag’…

Debug: 44 7 command.c:369 register_command_handler(): registering ‘ocd_jtag’…

Debug: 45 7 command.c:369 register_command_handler(): registering ‘ocd_jtag’…

Debug: 46 7 command.c:369 register_command_handler(): registering ‘ocd_jtag’…

Debug: 47 7 command.c:369 register_command_handler(): registering ‘ocd_jtag’…

Debug: 48 7 command.c:369 register_command_handler(): registering ‘ocd_svf’…

Debug: 49 7 command.c:369 register_command_handler(): registering ‘ocd_xsvf’…

Debug: 50 7 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_ft2232_device_desc Olimex OpenOCD JTAG ARM-USB-TINY-H

Debug: 51 7 command.c:145 script_debug(): command - ft2232_device_desc ocd_ft2232_device_desc Olimex OpenOCD JTAG ARM-USB-TINY-H

Debug: 53 7 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_ft2232_layout olimex-jtag

Debug: 54 7 command.c:145 script_debug(): command - ft2232_layout ocd_ft2232_layout olimex-jtag

Debug: 56 8 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_ft2232_vid_pid 0x15ba 0x002a

Debug: 57 8 command.c:145 script_debug(): command - ft2232_vid_pid ocd_ft2232_vid_pid 0x15ba 0x002a

Debug: 59 8 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_reset_config trst_and_srst

Debug: 60 8 command.c:145 script_debug(): command - reset_config ocd_reset_config trst_and_srst

User : 62 8 command.c:549 command_print(): trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain connect_deassert_srst

Debug: 63 8 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag_rclk 8

Debug: 64 8 command.c:145 script_debug(): command - jtag_rclk ocd_jtag_rclk 8

Debug: 66 8 core.c:1652 jtag_config_rclk(): handle jtag rclk

Debug: 67 8 core.c:1610 adapter_khz_to_speed(): convert khz to interface specific speed value

Debug: 68 8 core.c:1610 adapter_khz_to_speed(): convert khz to interface specific speed value

User : 69 8 command.c:549 command_print(): RCLK - adaptive

Debug: 70 8 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_init

Debug: 71 8 command.c:145 script_debug(): command - init ocd_init

Debug: 73 8 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_target init

Debug: 74 8 command.c:145 script_debug(): command - ocd_target ocd_target init

Debug: 76 8 target.c:1194 handle_target_init_command(): Initializing targets…

Debug: 77 8 ft2232.c:2337 ft2232_init(): ft2232 interface using shortest path jtag state transitions

Debug: 78 8 ft2232.c:2047 ft2232_init_ftd2xx(): ‘ft2232’ interface using FTD2XX with ‘olimex-jtag’ layout (15ba:002a)

Debug: 79 1474 ft2232.c:2159 ft2232_init_ftd2xx(): current latency timer: 2

Info : 80 1480 ft2232.c:2188 ft2232_init_ftd2xx(): device: 6 “2232H”

Info : 81 1480 ft2232.c:2189 ft2232_init_ftd2xx(): deviceID: 364511274

Info : 82 1480 ft2232.c:2190 ft2232_init_ftd2xx(): SerialNumber: OLVRTMH?A

Info : 83 1480 ft2232.c:2191 ft2232_init_ftd2xx(): Description: Olimex OpenOCD JTAG ARM-USB-TINY-H A

Debug: 84 1480 ft2232.c:2299 ft2232_set_data_bits_low_byte(): 80 08 1b

Debug: 85 1481 ft2232.c:2318 ft2232_set_data_bits_high_byte(): 82 09 0f

Info : 86 1481 ft2232.c:655 ftx232h_clk_divide_by_5(): max TCK change to: 30000 kHz

Debug: 87 1483 core.c:1610 adapter_khz_to_speed(): convert khz to interface specific speed value

Debug: 88 1483 core.c:1613 adapter_khz_to_speed(): have interface set up

Debug: 89 1483 ft2232.c:624 ftx232h_adaptive_clocking(): 96

Debug: 90 1483 core.c:1610 adapter_khz_to_speed(): convert khz to interface specific speed value

Debug: 91 1483 core.c:1613 adapter_khz_to_speed(): have interface set up

Info : 92 1483 core.c:1401 adapter_init(): RCLK (adaptive clock speed)

Debug: 93 1483 openocd.c:132 handle_init_command(): Debug Adapter init complete

Debug: 94 1483 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_transport init

Debug: 95 1483 command.c:145 script_debug(): command - ocd_transport ocd_transport init

Debug: 96 1483 log.c:422 keep_alive(): keep_alive() was not invoked in the 1000ms timelimit (1483). This may cause trouble with GDB connections.

Debug: 99 1483 transport.c:240 handle_transport_init(): handle_transport_init

Debug: 100 1483 ft2232.c:1425 olimex_jtag_reset(): trst: 0, srst: 0, high_output: 0x01, high_direction: 0x0f

Debug: 101 1483 core.c:719 jtag_add_reset(): SRST line released

Debug: 102 1483 core.c:743 jtag_add_reset(): TRST line released

Debug: 103 1483 core.c:323 jtag_call_event_callbacks(): jtag event: TAP reset

Debug: 104 1484 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag arp_init

Debug: 105 1484 command.c:145 script_debug(): command - ocd_jtag ocd_jtag arp_init

Debug: 106 1484 core.c:1412 jtag_init_inner(): Init JTAG chain

Warn : 107 1484 core.c:1428 jtag_init_inner(): There are no enabled taps. AUTO PROBING MIGHT NOT WORK!!

Debug: 108 1484 core.c:323 jtag_call_event_callbacks(): jtag event: TAP reset

Debug: 109 1484 core.c:1048 jtag_examine_chain(): DR scan interrogation for IDCODE/BYPASS

Debug: 110 1484 core.c:323 jtag_call_event_callbacks(): jtag event: TAP reset

Error: 111 26484 ft2232.c:591 ft2232_read(): couldn’t read enough bytes from FT2232 device (0 < 81)

Error: 112 26485 ft2232.c:843 ft2232_send_and_recv(): couldn’t read from FT2232

Error: 113 26485 core.c:1457 jtag_init_inner(): Trying to use configured scan chain anyway…

Debug: 114 26485 core.c:1208 jtag_validate_ircapture(): IR capture validation scan

Error: 115 51485 ft2232.c:591 ft2232_read(): couldn’t read enough bytes from FT2232 device (0 < 2)

Error: 116 51485 ft2232.c:843 ft2232_send_and_recv(): couldn’t read from FT2232

Debug: 117 51485 core.c:323 jtag_call_event_callbacks(): jtag event: TAP reset

Warn : 118 51487 core.c:1480 jtag_init_inner(): Bypassing JTAG setup events due to errors

\\\

OpendOCD has a lot of churn and unfortunately the developers have no problems breaking stuff along the way.

The last version I know that worked is noted here:

http://mc1322x.devl.org/openocd.html

0.4.0-rc1-dev-00143-g4960c90 (2010-01-22-19:26)

That’s probably your easiest way moving forward with this.

@malvira - sometimes targets get broken - mainly because we do not have access to all targets supported in OpenOCD.

If you are willing to build OpenOCD then get the latest from sf and use the new ftdi driver - built using --enable-ftdi

The new driver uses libusb-1.0 rather then the older libusb-0.1.

To use the new ftdi driver the only other change is the adapter cfg:

source [find interface/olimex-arm-usb-tiny-h.cfg]        // old driver
source [find interface/ftdi/olimex-arm-usb-tiny-h.cfg]  // new ftdi driver

I would use the mc13224v.cfg config as it look like it should work.

Cheers

Spen

I rebuilt with --enable-ftdi and got different results.

  • the telnet server accepts connection but never responds to commands. Because of this I added an explicit telnet_port (no effect), specified the mc13224v.cfg, and added a scan_chain.

  • When the scan chain executes it reports an IdCode of 0x0000000 – not what I would expect. That said, I would trust the results more if the entire config had been processed and I was executing scan_chain from the telnet port.

See below for the log.

On a different note… any thoughts on regression tests for OpenOCD? I’m sure key users (adapter makers) would be willing to set up cron jobs that would pull source, build, run at least a minimal/status test suite for the adapters/boards they have, and post results.

/////

Open On-Chip Debugger 0.7.0-dev-00135-g76afade-dirty (2013-01-07-22:57)

Licensed under GNU GPL v2

For bug reports, read

http://openocd.sourceforge.net/doc/doxygen/bugs.html

User : 11 6 command.c:549 command_print(): debug_level: 3

Debug: 12 6 configuration.c:86 find_file(): found /Users/jahess/zigbee/devtools/share/openocd/scripts/interface/ftdi/olimex-arm-usb-tiny-h.cfg

Debug: 13 6 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_echo WARNING!

Debug: 14 6 command.c:145 script_debug(): command - echo ocd_echo WARNING!

User : 16 6 command.c:766 jim_echo(): WARNING!

Debug: 17 6 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_echo This file was not tested with real interface, but is assumed to work as this

Debug: 18 6 command.c:145 script_debug(): command - echo ocd_echo This file was not tested with real interface, but is assumed to work as this

User : 20 6 command.c:766 jim_echo(): This file was not tested with real interface, but is assumed to work as this

Debug: 21 6 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_echo interface uses the same layout as configs that were verified. Please report your

Debug: 22 6 command.c:145 script_debug(): command - echo ocd_echo interface uses the same layout as configs that were verified. Please report your

User : 24 6 command.c:766 jim_echo(): interface uses the same layout as configs that were verified. Please report your

Debug: 25 6 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_echo experience with this file to openocd-devel mailing list, so it could be marked

Debug: 26 6 command.c:145 script_debug(): command - echo ocd_echo experience with this file to openocd-devel mailing list, so it could be marked

User : 28 6 command.c:766 jim_echo(): experience with this file to openocd-devel mailing list, so it could be marked

Debug: 29 6 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_echo as working or fixed.

Debug: 30 6 command.c:145 script_debug(): command - echo ocd_echo as working or fixed.

User : 32 6 command.c:766 jim_echo(): as working or fixed.

Debug: 33 6 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_interface ftdi

Debug: 34 6 command.c:145 script_debug(): command - interface ocd_interface ftdi

Debug: 36 6 command.c:369 register_command_handler(): registering ‘ocd_ftdi_device_desc’…

Debug: 37 6 command.c:369 register_command_handler(): registering ‘ocd_ftdi_serial’…

Debug: 38 6 command.c:369 register_command_handler(): registering ‘ocd_ftdi_channel’…

Debug: 39 6 command.c:369 register_command_handler(): registering ‘ocd_ftdi_layout_init’…

Debug: 40 6 command.c:369 register_command_handler(): registering ‘ocd_ftdi_layout_signal’…

Debug: 41 6 command.c:369 register_command_handler(): registering ‘ocd_ftdi_set_signal’…

Debug: 42 6 command.c:369 register_command_handler(): registering ‘ocd_ftdi_vid_pid’…

Info : 43 6 transport.c:118 allow_transports(): only one transport option; autoselect ‘jtag’

Debug: 44 6 command.c:369 register_command_handler(): registering ‘ocd_jtag_flush_queue_sleep’…

Debug: 45 6 command.c:369 register_command_handler(): registering ‘ocd_jtag_rclk’…

Debug: 46 6 command.c:369 register_command_handler(): registering ‘ocd_jtag_ntrst_delay’…

Debug: 47 6 command.c:369 register_command_handler(): registering ‘ocd_jtag_ntrst_assert_width’…

Debug: 48 6 command.c:369 register_command_handler(): registering ‘ocd_scan_chain’…

Debug: 49 6 command.c:369 register_command_handler(): registering ‘ocd_jtag_reset’…

Debug: 50 6 command.c:369 register_command_handler(): registering ‘ocd_runtest’…

Debug: 51 6 command.c:369 register_command_handler(): registering ‘ocd_irscan’…

Debug: 52 6 command.c:369 register_command_handler(): registering ‘ocd_verify_ircapture’…

Debug: 53 6 command.c:369 register_command_handler(): registering ‘ocd_verify_jtag’…

Debug: 54 6 command.c:369 register_command_handler(): registering ‘ocd_tms_sequence’…

Debug: 55 6 command.c:369 register_command_handler(): registering ‘ocd_wait_srst_deassert’…

Debug: 56 6 command.c:369 register_command_handler(): registering ‘ocd_jtag’…

Debug: 57 6 command.c:369 register_command_handler(): registering ‘ocd_jtag’…

Debug: 58 6 command.c:369 register_command_handler(): registering ‘ocd_jtag’…

Debug: 59 6 command.c:369 register_command_handler(): registering ‘ocd_jtag’…

Debug: 60 6 command.c:369 register_command_handler(): registering ‘ocd_jtag’…

Debug: 61 6 command.c:369 register_command_handler(): registering ‘ocd_jtag’…

Debug: 62 6 command.c:369 register_command_handler(): registering ‘ocd_jtag’…

Debug: 63 6 command.c:369 register_command_handler(): registering ‘ocd_jtag’…

Debug: 64 6 command.c:369 register_command_handler(): registering ‘ocd_jtag’…

Debug: 65 6 command.c:369 register_command_handler(): registering ‘ocd_jtag’…

Debug: 66 6 command.c:369 register_command_handler(): registering ‘ocd_jtag’…

Debug: 67 6 command.c:369 register_command_handler(): registering ‘ocd_jtag’…

Debug: 68 6 command.c:369 register_command_handler(): registering ‘ocd_jtag’…

Debug: 69 6 command.c:369 register_command_handler(): registering ‘ocd_svf’…

Debug: 70 6 command.c:369 register_command_handler(): registering ‘ocd_xsvf’…

Debug: 71 7 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_ftdi_device_desc Olimex OpenOCD JTAG ARM-USB-TINY-H

Debug: 72 7 command.c:145 script_debug(): command - ftdi_device_desc ocd_ftdi_device_desc Olimex OpenOCD JTAG ARM-USB-TINY-H

Debug: 74 7 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_ftdi_vid_pid 0x15ba 0x002a

Debug: 75 7 command.c:145 script_debug(): command - ftdi_vid_pid ocd_ftdi_vid_pid 0x15ba 0x002a

Debug: 77 7 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_ftdi_layout_init 0x0c08 0x0f1b

Debug: 78 7 command.c:145 script_debug(): command - ftdi_layout_init ocd_ftdi_layout_init 0x0c08 0x0f1b

Debug: 80 7 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_ftdi_layout_signal nSRST -oe 0x0200

Debug: 81 7 command.c:145 script_debug(): command - ftdi_layout_signal ocd_ftdi_layout_signal nSRST -oe 0x0200

Debug: 83 7 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_ftdi_layout_signal nTRST -data 0x0100 -noe 0x0400

Debug: 84 7 command.c:145 script_debug(): command - ftdi_layout_signal ocd_ftdi_layout_signal nTRST -data 0x0100 -noe 0x0400

Debug: 86 7 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_ftdi_layout_signal LED -data 0x0800

Debug: 87 7 command.c:145 script_debug(): command - ftdi_layout_signal ocd_ftdi_layout_signal LED -data 0x0800

Debug: 89 7 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_reset_config srst_only srst_open_drain

Debug: 90 7 command.c:145 script_debug(): command - reset_config ocd_reset_config srst_only srst_open_drain

User : 92 7 command.c:549 command_print(): srst_only separate srst_gates_jtag srst_open_drain connect_deassert_srst

Debug: 93 7 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag_ntrst_delay 200

Debug: 94 7 command.c:145 script_debug(): command - jtag_ntrst_delay ocd_jtag_ntrst_delay 200

User : 96 7 command.c:549 command_print(): jtag_ntrst_delay: 200

Debug: 97 7 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag_rclk 8

Debug: 98 7 command.c:145 script_debug(): command - jtag_rclk ocd_jtag_rclk 8

Debug: 100 7 core.c:1652 jtag_config_rclk(): handle jtag rclk

Debug: 101 7 core.c:1610 adapter_khz_to_speed(): convert khz to interface specific speed value

Debug: 102 7 core.c:1610 adapter_khz_to_speed(): convert khz to interface specific speed value

User : 103 7 command.c:549 command_print(): RCLK - adaptive

Debug: 104 7 configuration.c:86 find_file(): found /Users/jahess/zigbee/devtools/share/openocd/scripts/target/mc13224v.cfg

Debug: 105 7 configuration.c:86 find_file(): found /Users/jahess/zigbee/devtools/share/openocd/scripts/bitsbytes.tcl

Debug: 106 8 configuration.c:86 find_file(): found /Users/jahess/zigbee/devtools/share/openocd/scripts/cpu/arm/arm7tdmi.tcl

Debug: 107 8 configuration.c:86 find_file(): found /Users/jahess/zigbee/devtools/share/openocd/scripts/memory.tcl

Debug: 108 8 configuration.c:86 find_file(): found /Users/jahess/zigbee/devtools/share/openocd/scripts/mmr_helpers.tcl

Debug: 109 8 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag newtap mc13224v cpu -irlen 4 -expected-id 0x1f1f001d

Debug: 110 8 command.c:145 script_debug(): command - ocd_jtag ocd_jtag newtap mc13224v cpu -irlen 4 -expected-id 0x1f1f001d

Debug: 111 8 tcl.c:554 jim_newtap_cmd(): Creating New Tap, Chip: mc13224v, Tap: cpu, Dotted: mc13224v.cpu, 4 params

Debug: 112 8 tcl.c:571 jim_newtap_cmd(): Processing option: -irlen

Debug: 113 8 tcl.c:571 jim_newtap_cmd(): Processing option: -expected-id

Debug: 114 8 core.c:1323 jtag_tap_init(): Created Tap: mc13224v.cpu @ abs position 0, irlen 4, capture: 0x1 mask: 0x3

Debug: 115 8 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_reset_config srst_only

Debug: 116 8 command.c:145 script_debug(): command - reset_config ocd_reset_config srst_only

User : 118 8 command.c:549 command_print(): srst_only separate srst_gates_jtag srst_open_drain connect_deassert_srst

Debug: 119 8 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag_ntrst_delay 200

Debug: 120 8 command.c:145 script_debug(): command - jtag_ntrst_delay ocd_jtag_ntrst_delay 200

User : 122 8 command.c:549 command_print(): jtag_ntrst_delay: 200

Debug: 123 8 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_adapter_khz 2000

Debug: 124 8 command.c:145 script_debug(): command - adapter_khz ocd_adapter_khz 2000

Debug: 126 8 core.c:1643 jtag_config_khz(): handle jtag khz

Debug: 127 8 core.c:1610 adapter_khz_to_speed(): convert khz to interface specific speed value

Debug: 128 8 core.c:1610 adapter_khz_to_speed(): convert khz to interface specific speed value

User : 129 8 command.c:549 command_print(): adapter speed: 2000 kHz

Debug: 130 8 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_target create mc13224v.cpu arm7tdmi -chain-position mc13224v.cpu

Debug: 131 8 command.c:145 script_debug(): command - ocd_target ocd_target create mc13224v.cpu arm7tdmi -chain-position mc13224v.cpu

Debug: 132 8 target.c:1631 target_free_all_working_areas_restore(): freeing all working areas

Debug: 133 8 command.c:369 register_command_handler(): registering ‘ocd_arm’…

Debug: 134 8 command.c:369 register_command_handler(): registering ‘ocd_arm’…

Debug: 135 8 command.c:369 register_command_handler(): registering ‘ocd_arm’…

Debug: 136 8 command.c:369 register_command_handler(): registering ‘ocd_arm’…

Debug: 137 8 command.c:369 register_command_handler(): registering ‘ocd_arm’…

Debug: 138 8 command.c:369 register_command_handler(): registering ‘ocd_arm’…

Debug: 139 8 command.c:369 register_command_handler(): registering ‘ocd_etm’…

Debug: 140 8 command.c:369 register_command_handler(): registering ‘ocd_arm7_9’…

Debug: 141 8 command.c:369 register_command_handler(): registering ‘ocd_arm7_9’…

Debug: 142 8 command.c:369 register_command_handler(): registering ‘ocd_arm7_9’…

Debug: 143 8 armv4_5.c:395 arm_set_cpsr(): set CPSR 0x00000010: User mode, ARM state

Debug: 144 8 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 145 8 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 146 8 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 147 8 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 148 8 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 149 8 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 150 8 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 151 8 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 152 9 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 153 9 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 154 9 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 155 9 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 156 9 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 157 9 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 158 9 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 159 9 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 160 9 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 161 9 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 162 9 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 163 9 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 164 9 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 165 9 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 166 9 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 167 9 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 168 9 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 169 9 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 170 9 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 171 9 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 172 9 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 173 9 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 174 9 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 175 9 command.c:369 register_command_handler(): registering ‘ocd_mc13224v.cpu’…

Debug: 176 9 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_mc13224v.cpu configure -work-area-phys 0x00408000 -work-area-size 0x1000 -work-area-backup 1

Debug: 177 9 command.c:145 script_debug(): command - ocd_mc13224v.cpu ocd_mc13224v.cpu configure -work-area-phys 0x00408000 -work-area-size 0x1000 -work-area-backup 1

Debug: 178 9 target.c:1631 target_free_all_working_areas_restore(): freeing all working areas

Debug: 179 9 target.c:1631 target_free_all_working_areas_restore(): freeing all working areas

Debug: 180 9 target.c:1631 target_free_all_working_areas_restore(): freeing all working areas

Debug: 181 9 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_scan_chain

Debug: 182 9 command.c:145 script_debug(): command - scan_chain ocd_scan_chain

User : 184 9 command.c:549 command_print(): TapName Enabled IdCode Expected IrLen IrCap IrMask

User : 185 9 command.c:549 command_print(): – ------------------- -------- ---------- ---------- ----- ----- ------

User : 186 9 command.c:549 command_print(): 0 mc13224v.cpu Y 0x00000000 0x1f1f001d 4 0x01 0x03

Debug: 187 9 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_telnet_port 4444

Debug: 188 9 command.c:145 script_debug(): command - telnet_port ocd_telnet_port 4444

Debug: 190 9 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_init

Debug: 191 9 command.c:145 script_debug(): command - init ocd_init

Debug: 193 9 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_target init

Debug: 194 9 command.c:145 script_debug(): command - ocd_target ocd_target init

Debug: 196 9 target.c:1194 handle_target_init_command(): Initializing targets…

Debug: 197 9 command.c:369 register_command_handler(): registering ‘ocd_target_request’…

Debug: 198 9 command.c:369 register_command_handler(): registering ‘ocd_trace’…

Debug: 199 9 command.c:369 register_command_handler(): registering ‘ocd_trace’…

Debug: 200 9 command.c:369 register_command_handler(): registering ‘ocd_fast_load_image’…

Debug: 201 9 command.c:369 register_command_handler(): registering ‘ocd_fast_load’…

Debug: 202 9 command.c:369 register_command_handler(): registering ‘ocd_profile’…

Debug: 203 9 command.c:369 register_command_handler(): registering ‘ocd_virt2phys’…

Debug: 204 9 command.c:369 register_command_handler(): registering ‘ocd_reg’…

Debug: 205 9 command.c:369 register_command_handler(): registering ‘ocd_poll’…

Debug: 206 9 command.c:369 register_command_handler(): registering ‘ocd_wait_halt’…

Debug: 207 9 command.c:369 register_command_handler(): registering ‘ocd_halt’…

Debug: 208 9 command.c:369 register_command_handler(): registering ‘ocd_resume’…

Debug: 209 9 command.c:369 register_command_handler(): registering ‘ocd_reset’…

Debug: 210 9 command.c:369 register_command_handler(): registering ‘ocd_soft_reset_halt’…

Debug: 211 9 command.c:369 register_command_handler(): registering ‘ocd_step’…

Debug: 212 9 command.c:369 register_command_handler(): registering ‘ocd_mdw’…

Debug: 213 9 command.c:369 register_command_handler(): registering ‘ocd_mdh’…

Debug: 214 9 command.c:369 register_command_handler(): registering ‘ocd_mdb’…

Debug: 215 9 command.c:369 register_command_handler(): registering ‘ocd_mww’…

Debug: 216 9 command.c:369 register_command_handler(): registering ‘ocd_mwh’…

Debug: 217 9 command.c:369 register_command_handler(): registering ‘ocd_mwb’…

Debug: 218 9 command.c:369 register_command_handler(): registering ‘ocd_bp’…

Debug: 219 9 command.c:369 register_command_handler(): registering ‘ocd_rbp’…

Debug: 220 9 command.c:369 register_command_handler(): registering ‘ocd_wp’…

Debug: 221 9 command.c:369 register_command_handler(): registering ‘ocd_rwp’…

Debug: 222 9 command.c:369 register_command_handler(): registering ‘ocd_load_image’…

Debug: 223 9 command.c:369 register_command_handler(): registering ‘ocd_dump_image’…

Debug: 224 9 command.c:369 register_command_handler(): registering ‘ocd_verify_image’…

Debug: 225 9 command.c:369 register_command_handler(): registering ‘ocd_test_image’…

Debug: 226 9 command.c:369 register_command_handler(): registering ‘ocd_reset_nag’…

Debug: 227 9 command.c:369 register_command_handler(): registering ‘ocd_ps’…

Debug: 228 9 ftdi.c:630 ftdi_initialize(): ftdi interface using shortest path jtag state transitions

Debug: 229 726 mpsse.c:361 mpsse_purge(): -

Debug: 230 727 mpsse.c:626 mpsse_loopback_config(): off

Debug: 232 727 core.c:1610 adapter_khz_to_speed(): convert khz to interface specific speed value

Debug: 233 727 core.c:1613 adapter_khz_to_speed(): have interface set up

Debug: 234 727 mpsse.c:667 mpsse_set_frequency(): target 2000000 Hz

Debug: 235 727 mpsse.c:660 mpsse_rtck_config(): off

Debug: 236 727 mpsse.c:650 mpsse_divide_by_5_config(): off

Debug: 237 727 mpsse.c:632 mpsse_set_divisor(): 14

Debug: 238 727 mpsse.c:696 mpsse_set_frequency(): actually 2000000 Hz

Debug: 239 727 core.c:1610 adapter_khz_to_speed(): convert khz to interface specific speed value

Debug: 240 727 core.c:1613 adapter_khz_to_speed(): have interface set up

Info : 241 727 core.c:1399 adapter_init(): clock speed 2000 kHz

Debug: 242 727 openocd.c:132 handle_init_command(): Debug Adapter init complete

Debug: 243 727 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_transport init

Debug: 244 727 command.c:145 script_debug(): command - ocd_transport ocd_transport init

Debug: 246 727 transport.c:240 handle_transport_init(): handle_transport_init

Debug: 247 727 core.c:719 jtag_add_reset(): SRST line released

Debug: 248 727 core.c:743 jtag_add_reset(): TRST line released

Debug: 249 727 core.c:323 jtag_call_event_callbacks(): jtag event: TAP reset

Debug: 250 948 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_jtag arp_init

Debug: 251 948 command.c:145 script_debug(): command - ocd_jtag ocd_jtag arp_init

Debug: 252 948 core.c:1412 jtag_init_inner(): Init JTAG chain

Debug: 253 948 core.c:323 jtag_call_event_callbacks(): jtag event: TAP reset

Debug: 254 948 core.c:1048 jtag_examine_chain(): DR scan interrogation for IDCODE/BYPASS

Debug: 255 948 core.c:323 jtag_call_event_callbacks(): jtag event: TAP reset

\\\

I do not see anywhere in the log where the actual scan chain is actually scanned by your adapter.

Could you give me you exact cmd line/cfg used.

For info the default telnet port is 4444.

With regards to a testsuite it has been thought about but has never gone any further. Any ideas are always welcome.

Cheers

Spen

Uh… I just looked at that last trace and I don’t know where that came from. Sorry about that.

I just tried again and the telnet port is now working. And… the led on the adapter is blinking (as opposed to solid). Unfortunately the scan chain still reports 0x0 for the IdCode.

Here is a copy and paste of my openocd.cfg:

debug_level 3

source [find interface/ftdi/olimex-arm-usb-tiny-h.cfg]

reset_config srst_only srst_open_drain
jtag_ntrst_delay 200

#jtag_rclk 0
jtag_rclk 8

source [find target/mc13224v.cfg]

scan_chain
telnet_port 4444

I also issued a “scan_chain” from the telnet port at the end of the log.

To avoid cluttering this list with a log, you can find it here:

http://www.vivistar.com/arm/ocdlog_20130108.txt

Thanks,

Jonathan

Jonathan,

OpenOCD has as such two internal states, config and exec.

Certain cmds will only run in exec mode, this is after init is done.

scan_chain for some reason is configured to execute in any mode (possible bug), however the scan chain is not ready until init has been executed.

So in your case you need to annually issue init if you are going to use scan_chain in your config.

...
source [find target/mc13224v.cfg]
# slow jtag down for testing
adapter_khz 10
# manually call init
init
# now we can safely call exec cmds
scan_chain

The other problem is that the id is not correctly read, it may be worth disabling rclk for testing - see adapter_khz above.

I also had a look at the user guide for the eval kit you are using, this suggests that srst and trst are not connected, if this is the case then you need to remove the reset_config setting.

The srst and trst may be worth checking on the actual board, as the pinout in the user guide does contain typos. pin15 is srst not DBGRQ.

If srst is not connected then the only way for OpenOCD to reset the target is by using soft_reset_halt cmd - i do wish board manufacturers would not do this.

Cheers

Spen

The documentation for the JTAG header on the board is simply wrong. I traced things thru the board art and DBGRQ and DBGACQ are not present, and “RESETB” is connected to pin 15 (erst). Worse still, the latest art available from the vendor site is for for “ISSUE ES2” and my boards are labeled as “ISSUE ES3-X2” so I’m still a little worried.

My previous telnet issue has gone away. I’m assuming I must have had a hung port or something.

Here’s the latest…

If I start openocd before I apply board power switch, it comes up, I can perform scan_chain via the telnet port, and I get the correct IdCode back for the mc13324 TAP. If I start openocd after I’ve applied power, the IdCode reports as 0x0.

In all cases a “halt” appears to time out (either before or after power is applied).

With the config:

debug_level 3
source [find interface/ftdi/olimex-arm-usb-tiny-h.cfg]
reset_config srst_only srst_open_drain
jtag_ntrst_delay 200
#jtag_rclk 0
jtag_rclk 8
adapter_khz 10

source [find target/mc13224v.cfg]

Here are the logs:

http://www.vivistar.com/arm/ocdlog_2013 … thenon.txt

http://www.vivistar.com/arm/ocdlog_20130111on.txt

I have noticed that “reset” resets the board and it runs its normal program (blinky lights). However, halt really is failing because attempting to print any register gives and error as indicated below.

> reset
JTAG scan chain interrogation failed: all zeroes
Check JTAG interface, timings, target power, etc.
Trying to use configured scan chain anyway...
mc13224v.cpu: IR capture error; saw 0x00 not 0x01
Bypassing JTAG setup events due to errors
NOTE! DCC downloads have not been enabled, defaulting to slow memory writes. Type 'help dcc'.
NOTE! Severe performance degradation without fast memory access enabled. Type 'help fast'.
> halt
Halt timed out, wake up GDB.
timed out while waiting for target halted
in procedure 'halt'
> reg sp_usr
Target not halted
sp_usr (/32): 0x00000000

The “all zeroes” got me to look back at the openocd log:

Error: 575 347792 core.c:941 jtag_examine_chain_check(): JTAG scan chain interrogation failed: all zeroes
Error: 576 347792 core.c:942 jtag_examine_chain_check(): Check JTAG interface, timings, target power, etc.
Error: 577 347793 core.c:1457 jtag_init_inner(): Trying to use configured scan chain anyway...
Debug: 578 347793 core.c:1208 jtag_validate_ircapture(): IR capture validation scan
Error: 579 347793 core.c:1261 jtag_validate_ircapture(): mc13224v.cpu: IR capture error; saw 0x00 not 0x01
Debug: 580 347793 core.c:323 jtag_call_event_callbacks(): jtag event: TAP reset
Warn : 581 347793 core.c:1480 jtag_init_inner(): Bypassing JTAG setup events due to errors

So I’m guessing something with the board powered is messing up the JTAG connection? I’ll start checking jumpers but I don’t remember a “remove this jumper to enable JTAG operation.”

[Despite my success please read on for another question.]

Insanity!

My guess is that the development board was provided with a FLASH program in “secure” mode. The boot process of the mc13224 doesn’t enable the JTAG interface if the FLASH is “secured.” The board has a couple of jumpers to nuke the FLASH. I did that and…

Now I can start openocd with the board already on, it correctly reads the IdCode, I can scan_chain, halt, reset, and I presume most other things.

Not sure why you would provide a development board “secured.” Maybe it is a default behavior of the FreeScale non jtag programming tool. Regardless, I think I can start making progress now.

I have one more question. While digging thru the details of this development board, I found this little snippet in the schematic:

http://www.vivistar.com/arm/no_rtck.png

Digging out my jewelry loupe and looking at the teeny surface mounts for R3 and R4, R3 is simply not present. Any one know what a resistance value of “NP” for R4 would be? Not Provided? So… RTCK is not currently connected to the JTAG connector.

Other than providing another unencumbered ADC channel, any ideas why they would defeat RTCK?

Is it worth hooking up RTCK?