I checked stlink_usb.c in gdb and the problem is apparently in ST-Link. It probably starts one extra memory read with incremented TAR. What is really annoying that error is hidden till the next memory read (or perhaps write). stlink_usb_read_mem() should retry once if it gets status code 0x15.
Tom On 4.2.2015 18:02, Tomas Vanek wrote: > Hi all, > > time to time I encounter an error reading a configuration register using > ST-Link V2. > I had to make a workaround in psoc4 driver for reading > PSOC4_SPCIF_GEOMETRY @ 0x400E0000. > Today I found that it looks like word access reads more than one word > and triggers an exception when the next word is not readable. > The problem is dependent somehow on read address. Zero in last nibble of > address or so. > Low level adapter works OK. > > On Freescale KL17 there is a register SIM SOPT5 @ 0x40048010. Next word > is a gap. > See: >> mdb 0x40048010 4 > 0x40048010: 00 00 00 00 >> mdh 0x40048010 2 > 0x40048010: 0000 0000 >> mdw 0x40048010 > 0x40048010: 00000000 > jtag status contains invalid mode value - communication failure > Polling target klx.cpu failed, GDB will be halted. Polling again in 100ms > Previous state query failed, trying to reconnect > Polling target klx.cpu succeeded again, trying to reexamine > klx.cpu: hardware has 2 breakpoints, 2 watchpoints > > Is the problem inside ST-Link firmware or somewhere in hla_target.c:766 > adapter_read_memory() ?? > > Tom > > > Open On-Chip Debugger 0.9.0-dev-00259-ge2eb0f3 (2015-01-30-16:41) > Licensed under GNU GPL v2 > For bug reports, read > http://openocd.sourceforge.net/doc/doxygen/bugs.html > Info : The selected transport took over low-level target control. The > results might differ compared to plain JTAG/SWD > Info : add flash_bank kinetis klx.flash > adapter speed: 1000 kHz > none separate > Info : add flash_bank kinetis pflash.0 > Info : Unable to match requested speed 1000 kHz, using 950 kHz > Info : Unable to match requested speed 1000 kHz, using 950 kHz > Info : clock speed 950 kHz > Info : STLINK v2 JTAG v14 API v2 SWIM v0 VID 0x0483 PID 0x3748 > Info : using stlink api v2 > Info : Target voltage: 2.906604 > Info : klx.cpu: hardware has 2 breakpoints, 2 watchpoints > Warn : Cannot check flash security status with a high-level adapter > Warn : Cannot check flash security status with a high-level adapter > target state: halted > target halted due to debug-request, current mode: Thread > xPSR: 0x01000000 pc: 0x1c0000c0 msp: 0x20000688 > Info : accepting 'telnet' connection on tcp/4444 > User : 51 14941 command.c:546 command_print(): debug_level: 3 > Debug: 52 26207 command.c:145 script_debug(): command - ocd_command > ocd_command type ocd_mdb 0x40048010 4 > Debug: 53 26207 command.c:145 script_debug(): command - mdb ocd_mdb > 0x40048010 4 > Debug: 55 26211 hla_target.c:766 adapter_read_memory(): > adapter_read_memory 0x40048010 1 4 > User : 56 26215 command.c:546 command_print(): 0x40048010: 00 00 00 00 > Debug: 57 32733 command.c:145 script_debug(): command - ocd_command > ocd_command type ocd_mdh 0x40048010 2 > Debug: 58 32733 command.c:145 script_debug(): command - mdh ocd_mdh > 0x40048010 2 > Debug: 60 32736 hla_target.c:766 adapter_read_memory(): > adapter_read_memory 0x40048010 2 2 > User : 61 32740 command.c:546 command_print(): 0x40048010: 0000 0000 > Debug: 62 38146 command.c:145 script_debug(): command - ocd_command > ocd_command type ocd_mdw 0x40048010 > Debug: 63 38147 command.c:145 script_debug(): command - mdw ocd_mdw > 0x40048010 > Debug: 65 38150 hla_target.c:766 adapter_read_memory(): > adapter_read_memory 0x40048010 4 1 > User : 66 38154 command.c:546 command_print(): 0x40048010: 00000000 > Debug: 67 38259 stlink_usb.c:398 stlink_usb_error_check(): > unknown/unexpected STLINK status code 0x15 > Error: 68 38259 hla_target.c:462 adapter_poll(): jtag status contains > invalid mode value - communication failure > User : 69 38260 target.c:2416 handle_target(): Polling target klx.cpu > failed, GDB will be halted. Polling again in 100ms > Debug: 70 38262 target.c:1405 target_call_event_callbacks(): target > event 0 (gdb-halt) > Info : 71 38463 stlink_usb.c:942 stlink_usb_state(): Previous state > query failed, trying to reconnect > User : 72 38470 target.c:2426 handle_target(): Polling target klx.cpu > succeeded again, trying to reexamine > Debug: 73 38471 hla_target.c:766 adapter_read_memory(): > adapter_read_memory 0xe000ed00 4 1 > ... > > ------------------------------------------------------------------------------ Dive into the World of Parallel Programming. The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ OpenOCD-devel mailing list OpenOCD-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openocd-devel