On Fri, Mar 13, 2015 at 10:28:41AM +0300, Paul Fertser wrote:
> On Thu, Mar 12, 2015 at 10:58:59AM +0100, Tomas Vanek wrote:
> > >1. Does this patch introduce a regression in current psoc4 support or not?
> >
> > Unfortunately yes.
> > arp_waitstate fails in the state "need-to-be-reconnected" (log
> > ocd_reset_halt_psos.txt)
> 
> I'll try to digest that. Do I understand it right that it's with
> hardware srst and 2596 applied? It's very strange because 2596
> shouldn't affect reset when srst is used. If only it worked by chance
> and fixes in 2596 exposed another bug.

Let's try to analyse this together :)

> Debug: 1292 22287 command.c:145 script_debug(): command - ocd_command 
> ocd_command type ocd_reset halt

So you try to "reset halt" it with SRST, ok.

> [so far so good]
> Debug: 1348 22356 core.c:648 swd_add_reset(): SRST line released
> Debug: 1349 22407 command.c:145 script_debug(): command - ocd_command 
> ocd_command type ocd_psoc4.cpu invoke-event reset-deassert-post
> Debug: 1350 22408 command.c:145 script_debug(): command - ocd_psoc4.cpu 
> ocd_psoc4.cpu invoke-event reset-deassert-post
> Debug: 1351 22408 command.c:145 script_debug(): command - ocd_command 
> ocd_command type ocd_psoc4.cpu arp_waitstate running 200
> Debug: 1352 22408 command.c:145 script_debug(): command - ocd_psoc4.cpu 
> ocd_psoc4.cpu arp_waitstate running 200
> Debug: 1353 22409 ftdi.c:944 ftdi_swd_run_queue(): Executing 2 queued 
> transactions
> Debug: 1354 22409 ftdi.c:976 ftdi_swd_run_queue(): JUNK AP read reg 0 = 
> ffffffff

And here "arp waitstate" fails. Do you think it wouldn't fail if there
was enough of a delay after srst deassertion? Also, I would expect
ahbap_debugport_init called after the release to help here, have you
tried it? Also, you can try catching "arp waitstate" errors in Tcl
(since it's your custom reset_inner procedure already) and run it
several times. IMHO, more real life testing needed here to understand
how to handle it best.

> ...
> Debug: 3538 106494 command.c:145 script_debug(): command - ocd_command 
> ocd_command type ocd_reset

So you're trying to reset it now.

> Debug: 3547 106496 command.c:145 script_debug(): command - ocd_psoc4.cpu 
> ocd_psoc4.cpu invoke-event reset-assert-pre
> Debug: 3548 106496 command.c:145 script_debug(): command - ocd_command 
> ocd_command type ocd_mww 0x40030014 0

Your custom command to manipulate that test bit failed, but you can
just catch the exception in Tcl, then the reset would proceed further
and would probably work.

-- 
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:[email protected]

------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to