On 3.2.2015 12:18, Paul Fertser (Code Review) wrote:
> Paul Fertser has posted comments on this change.
>
> Change subject: psoc4: support for Cypress PSoC 41xx/42xx family
> ......................................................................
>
>
> Patch Set 4: Code-Review-2
>
> Hey Tomas,
>
> Sorry for the slow review.
>
> The patch looks fine to me but unfortunately missing documentation. Could you 
> please add the description of the flash driver and its two custom commands to 
> openocd.texi and mention it in README? Or would you prefer me doing it and 
> pushing an updated version? I'm putting -2 for now but I promise to remove it 
> promptly.
>
> BTW, have you tested this driver with JLink or FTDI? I wonder if it depends 
> on proper SWD WAIT handling or not.
>
Oops, I've never seen that texi doc goes so deep, that a flash driver is 
decribed here.
Kind of "If all else fails read the manual". I usually read the code first.
I'll look to it.

PSoC 4 support was tested with FTDI (an old ft2232c) and ST-Link V2.

> http://openocd.zylin.com/#/c/2282/4/tcl/target/psoc4.cfg
> File tcl/target/psoc4.cfg:
>
> Line 43: # High level adapter stops working after SRST and needs OpenOCD 
> restart.
> Is this true with the current stlink code as well? I've made it handle 
> reconnection transparently recently, so I can fully disconnect and powercycle 
> the target and it doesn't require OpenOCD restart anymore.
Paul, the problem is probably in the ST-Link itself, not in OpenOCD. I 
can disconnect and powercycle and PSoC4 gets connected again without 
restart.
However after
> reset_config srst_only
srst_only separate srst_gates_jtag srst_open_drain connect_deassert_srst

and reset, ST-Link locks (both green and red LED are on) a stay in this 
state until OpenOCD started again.
Today I once experienced that even next run of OpenOCD did not conected
"Error: init mode failed (unable to connect to the target)"
but I'm not able to replicate this with -d 3.

Here is debug log, if you like to analyze:

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
adapter speed: 1500 kHz
Info : The selected transport took over low-level target control. The 
results might differ compared to plain JTAG/SWD
adapter speed: 1500 kHz
Info : Unable to match requested speed 1500 kHz, using 1200 kHz
Info : Unable to match requested speed 1500 kHz, using 1200 kHz
Info : clock speed 1200 kHz
Info : STLINK v2 JTAG v14 API v2 SWIM v0 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 2.900059
Info : psoc4.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : accepting 'telnet' connection on tcp/4444
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0xa1000000 pc: 0x10000046 msp: 0x20000fe8
pc (/32): 0x10000046
pc (/32): 0x00000010
msp (/32): 0x20001000
User : 54 75190 command.c:546 command_print(): debug_level: 3

Debug: 55 81701 command.c:145 script_debug(): command - ocd_command 
ocd_command type ocd_reset
Debug: 56 81701 command.c:145 script_debug(): command - reset ocd_reset
Debug: 58 81706 command.c:145 script_debug(): command - ocd_command 
ocd_command type ocd_target names
Debug: 59 81706 command.c:145 script_debug(): command - ocd_target 
ocd_target names
Debug: 60 81706 command.c:145 script_debug(): command - ocd_command 
ocd_command type ocd_psoc4.cpu invoke-event reset-assert-pre
Debug: 61 81707 command.c:145 script_debug(): command - ocd_psoc4.cpu 
ocd_psoc4.cpu invoke-event reset-assert-pre
Debug: 62 81707 command.c:145 script_debug(): command - ocd_command 
ocd_command type ocd_mww 0x40030014 0
Debug: 63 81708 command.c:145 script_debug(): command - mww ocd_mww 
0x40030014 0
Debug: 65 81709 hla_target.c:780 adapter_write_memory(): 
adapter_write_memory 0x40030014 4 1
Debug: 66 81713 command.c:145 script_debug(): command - ocd_command 
ocd_command type ocd_psoc4.cpu arp_reset assert 0
Debug: 67 81713 command.c:145 script_debug(): command - ocd_psoc4.cpu 
ocd_psoc4.cpu arp_reset assert 0
Debug: 68 81713 target.c:1726 target_free_all_working_areas_restore(): 
freeing all working areas
Debug: 69 81713 hla_target.c:499 adapter_assert_reset(): 
adapter_assert_reset
Debug: 70 81719 stlink_usb.c:398 stlink_usb_error_check(): 
unknown/unexpected STLINK status code 0x16
Debug: 71 81722 command.c:145 script_debug(): command - ocd_command 
ocd_command type ocd_psoc4.cpu invoke-event reset-assert-post
Debug: 72 81722 command.c:145 script_debug(): command - ocd_psoc4.cpu 
ocd_psoc4.cpu invoke-event reset-assert-post
Debug: 73 81722 command.c:145 script_debug(): command - ocd_command 
ocd_command type ocd_psoc4.cpu invoke-event reset-deassert-pre
Debug: 74 81723 command.c:145 script_debug(): command - ocd_psoc4.cpu 
ocd_psoc4.cpu invoke-event reset-deassert-pre
Debug: 75 81723 command.c:145 script_debug(): command - ocd_command 
ocd_command type ocd_transport select
Debug: 76 81724 command.c:145 script_debug(): command - ocd_transport 
ocd_transport select
Debug: 77 81724 command.c:145 script_debug(): command - ocd_command 
ocd_command type ocd_psoc4.cpu invoke-event reset-deassert-post
Debug: 78 81724 command.c:145 script_debug(): command - ocd_psoc4.cpu 
ocd_psoc4.cpu invoke-event reset-deassert-post
Debug: 79 81725 command.c:145 script_debug(): command - ocd_command 
ocd_command type ocd_psoc4.cpu invoke-event reset-end
Debug: 80 81725 command.c:145 script_debug(): command - ocd_psoc4.cpu 
ocd_psoc4.cpu invoke-event reset-end


Debug: 190 119712 command.c:145 script_debug(): command - ocd_command 
ocd_command type ocd_reset_config srst_only
Debug: 191 119712 command.c:145 script_debug(): command - reset_config 
ocd_reset_config srst_only
User : 193 119715 command.c:546 command_print(): srst_only separate 
srst_gates_jtag srst_open_drain connect_deassert_srst
Debug: 194 158580 command.c:145 script_debug(): command - ocd_command 
ocd_command type ocd_reset
Debug: 195 158580 command.c:145 script_debug(): command - reset ocd_reset
Debug: 197 158583 command.c:145 script_debug(): command - ocd_command 
ocd_command type ocd_target names
Debug: 198 158583 command.c:145 script_debug(): command - ocd_target 
ocd_target names
Debug: 199 158583 command.c:145 script_debug(): command - ocd_command 
ocd_command type ocd_psoc4.cpu invoke-event reset-assert-pre
Debug: 200 158584 command.c:145 script_debug(): command - ocd_psoc4.cpu 
ocd_psoc4.cpu invoke-event reset-assert-pre
Debug: 201 158584 command.c:145 script_debug(): command - ocd_command 
ocd_command type ocd_mww 0x40030014 0
Debug: 202 158584 command.c:145 script_debug(): command - mww ocd_mww 
0x40030014 0
Debug: 204 158585 hla_target.c:780 adapter_write_memory(): 
adapter_write_memory 0x40030014 4 1
Debug: 205 158589 command.c:145 script_debug(): command - ocd_command 
ocd_command type ocd_psoc4.cpu arp_reset assert 0
Debug: 206 158590 command.c:145 script_debug(): command - ocd_psoc4.cpu 
ocd_psoc4.cpu arp_reset assert 0
Debug: 207 158590 target.c:1726 target_free_all_working_areas_restore(): 
freeing all working areas
Debug: 208 158590 hla_target.c:499 adapter_assert_reset(): 
adapter_assert_reset
Debug: 209 158594 hla_interface.c:132 hl_interface_execute_queue(): 
hl_interface_execute_queue: ignored
Debug: 210 158595 core.c:720 jtag_add_reset(): SRST line asserted
Debug: 211 158598 stlink_usb.c:398 stlink_usb_error_check(): 
unknown/unexpected STLINK status code 0x9
User : 212 158600 command.c:546 command_print(): in procedure 'reset' in 
procedure 'ocd_bouncer'
Debug: 213 158602 command.c:628 run_command(): Command failed with error 
code -4
User : 214 158602 command.c:666 command_run_line(): in procedure 'reset'
Debug: 215 158708 stlink_usb.c:398 stlink_usb_error_check(): 
unknown/unexpected STLINK status code 0x16
Error: 216 158708 hla_target.c:462 adapter_poll(): jtag status contains 
invalid mode value - communication failure
User : 217 158710 target.c:2416 handle_target(): Polling target 
psoc4.cpu failed, GDB will be halted. Polling again in 100ms
Debug: 218 158712 target.c:1405 target_call_event_callbacks(): target 
event 0 (gdb-halt)
Info : 219 158913 stlink_usb.c:942 stlink_usb_state(): Previous state 
query failed, trying to reconnect
Debug: 220 158917 stlink_usb.c:398 stlink_usb_error_check(): 
unknown/unexpected STLINK status code 0x9
Error: 221 158918 hla_target.c:462 adapter_poll(): jtag status contains 
invalid mode value - communication failure
User : 222 158920 target.c:2416 handle_target(): Polling target 
psoc4.cpu failed, GDB will be halted. Polling again in 300ms

... polls forever




------------------------------------------------------------------------------
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

Reply via email to