On 13.3.2015 10:07, Paul Fertser wrote: > On Fri, Mar 13, 2015 at 10:02:34AM +0100, Tomas Vanek wrote: >>> This is the first fail in SWD communication, The SWD init seq will be >>> sent automatically the very next attempt to talk to the target. If you >>> loop arp_waitstate for few times, it should succeed eventually. >> Unfortunately the very next attempt is sometimes too late. As in >> real life. > If you've configured that testbit to loop in ROM code, it's never too > late. If you didn't, it means the user issued "reset run", so there's > nowhere to hurry. Please show a log where 2596 + a mod to attempt > debugport init up to, say, 10 times fails. I meant too late from tcl script point of view. arp_waitstate has timed out operation. How could script to retry if it raises and error? > >> At least two targets need to send SWD init first. It sounds like an >> acceptable compromise >> to send SWD init when ahbap_debugport_init() retries. > It will be sent automatically, in full accordance with ADIv5, I'm yet > to see the case where that's not enough. > >> Again to be robust, ahbap_debugport_init() should retry until some timeout. >> The question is do we need to configure that timeout? It is like an >> equivalent >> of adapter_nsrst_delay for sysresetreq, well not exactly. > If, say, 10 tries is enough even for PSoC4, I'd settle on a hardcoded > value. Or probably nsrst_delay should be performed after sysresetreq > too, that would seem somewhat logical. > PSoC4 programming specification is very unclear on that:
The times of internal reset (<1 ms) and boot code (<100 us) are not specified exactly. Because they depend on the CPU clock and the size of the code, they can be vary in different revisions of the chip. In this case, the recommended way to enter Test mode suc- cessfully is to start sending the acquire sequence right after XRES is toggled (or power supplied in Power Cycle mode). This sequence is sent iteratively until it succeeds. My guess is 5 ms could include sufficient margin for USB latency etc. I'd recommend a new parameter as adapter_nsrst_delay can be used because of capacitor on srst line (and in this case there is nonsense to apply it after sysresetreq). T ------------------------------------------------------------------------------ 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
