openocd crashes with stm32 on one PC

Hi!

I have a funny situation. I built openocd-0.4.0 against the FTDI libs and for windows around the time when 0.4.0 was released. The package is installed on two different machines each used with an openocd-usb dongle. Both installations where working perfectly throug a long time of at91sam7/9 development.

Now we started to develop on STM32F10x devices and here it gets funny.

While one installation is continueing perfect work, on the other openocd crashes. But it only crashes at reset commands.

Here is what I tested:

I tested dongle 1 ( from the crashing installation) with the other PC: working.

I tested the STM3210C-EVAL kit with both adapters on the other machine: working

I got back to my machine: crashes.

I can take the other openocd-usb dongle with me at the weekend to test the other way round.

What I recoginzed was, that I cannot flash the STM3210C-EVAL kit via its bootloader if the dongle is connected on this PC where it crashes.

Now here is the debug output of the crash situation. I started up openocd -f interface/openocd-usb.cfg -f target/stm32.cfg -c init

Debug: 252 14000 core.c:719 jtag_add_reset(): JTAG reset with TLR instead of TRST
Debug: 253 14000 core.c:322 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 254 14000 core.c:1402 jtag_init_inner(): Init JTAG chain
Debug: 255 14016 core.c:322 jtag_call_event_callbacks(): jtag event: TAP reset
Debug: 256 14016 core.c:1050 jtag_examine_chain(): DR scan interrogation for IDCODE/BYPASS
Debug: 257 14016 core.c:322 jtag_call_event_callbacks(): jtag event: TAP reset
Info : 258 14016 core.c:950 jtag_examine_chain_display(): JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0
x3)
Info : 259 14016 core.c:950 jtag_examine_chain_display(): JTAG tap: stm32.bs tap/device found: 0x06418041 (mfg: 0x020, part: 0x6418, ver: 0x
0)

Around here I entered “reset init” via telnet and it goes on here:

Debug: 260 14016 core.c:1214 jtag_validate_ircapture(): IR capture validation scan
Debug: 261 14016 core.c:1275 jtag_validate_ircapture(): stm32.cpu: IR capture 0x01
Debug: 262 14016 core.c:1275 jtag_validate_ircapture(): stm32.bs: IR capture 0x01
Debug: 263 14016 command.c:133 script_debug(): command - ocd_command ocd_command type ocd_stm32.cpu cget -chain-position
Debug: 264 14031 command.c:133 script_debug(): command - ocd_stm32.cpu ocd_stm32.cpu cget -chain-position
Debug: 265 14031 command.c:133 script_debug(): command - ocd_command ocd_command type ocd_jtag tapisenabled stm32.cpu
Debug: 266 14031 command.c:133 script_debug(): command - ocd_jtag ocd_jtag tapisenabled stm32.cpu
Debug: 267 14031 command.c:133 script_debug(): command - ocd_command ocd_command type ocd_stm32.cpu arp_examine
Debug: 268 14031 command.c:133 script_debug(): command - ocd_stm32.cpu ocd_stm32.cpu arp_examine
Debug: 269 14031 arm_adi_v5.c:887 ahbap_debugport_init():
Debug: 270 14031 arm_adi_v5.c:972 ahbap_debugport_init(): MEM-AP #0 ID Register 0x1005d, Debug ROM Address 0xffffffff
Debug: 271 14031 command.c:133 script_debug(): command - ocd_command ocd_command type ocd_stm32.cpu invoke-event reset-assert-pre
Debug: 272 14031 command.c:133 script_debug(): command - ocd_stm32.cpu ocd_stm32.cpu invoke-event reset-assert-pre
Debug: 273 14047 command.c:133 script_debug(): command - ocd_command ocd_command type ocd_stm32.cpu cget -chain-position
Debug: 274 14047 command.c:133 script_debug(): command - ocd_stm32.cpu ocd_stm32.cpu cget -chain-position
Debug: 275 14047 command.c:133 script_debug(): command - ocd_command ocd_command type ocd_jtag tapisenabled stm32.cpu
Debug: 276 14047 command.c:133 script_debug(): command - ocd_jtag ocd_jtag tapisenabled stm32.cpu
Debug: 277 14047 command.c:133 script_debug(): command - ocd_command ocd_command type ocd_stm32.cpu arp_reset assert 1
Debug: 278 14047 command.c:133 script_debug(): command - ocd_stm32.cpu ocd_stm32.cpu arp_reset assert 1
Debug: 279 14047 cortex_m3.c:833 cortex_m3_assert_reset(): target->state: halted

Here the windows popup explains me that there was a problem and the advanced information is not much:

AppName: openocd.exe AppVer: 0.0.0.0 ModName: unknown

ModVer: 0.0.0.0 Offset: e00ff003

Ah, by the way, if I do not issue a reset command I can execute a flash write_image … and it works. But for debugging with insight I definately need reset to work…

What to do?

Thanks in advance and best regards

Ulrich

I am pretty certain this has been fixed in latest git master.

https://sourceforge.net/apps/trac/openocd/ticket/23

Cheers

Spen

Thanks for the hint!

When I compiled openOCD myself that time, I forgot to take it with me to the other machine. So I did an git update there too and compiled it again. So that version might have been newer. I copied the binaries from the working machine over to the one where it failed and now it works fine.

But as I am using TSM32 mor often now, I will do an update and check if there are interesting improvements.

I have some troubles using insight, where the variables inside functions are shown correct and the assembly code is correct too, but the function shown has nothing to do with the positin of the assembly or PC in general.

Best regards

Ulrich