From: Joerg W. <j...@ur...> - 2016-03-06 11:05:25
|
As Philip Mulrane wrote: > In jtag2usb.cc I changed all hid_read_timeout() calls (I assume this is > what you meant), increasing the timeout parameter by a factor of 10. Ah, yes, of course, hid_read_timeout(). Actually, only one call matters here, the one inside the (fragment reassembly) loop after // Query response The timeout there is currently 500 ms, which I thought ought to be enough, even for things like writing flash pages (which currently doesn't work for debugWIRE targets, not even in AVRDUDE – I don't know what I'm doing wrong by now). > The > output (-d) looked identical, same error. This is quite strange, because apparently, in your original mail, the next query for an event (which is always being polled while no command request is being worked on) yielded the command response: > command "AVR sign-on" [0x12, 0x10] > 0E 00 06 00 12 10 00 00 > Querying for response: hid_read() failed (0) > Querying for event: unexpected response (0x81) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ So why does it not arrive at the point where we are asking for it? Is this on Linux? Perhaps you could trace the underlying USB transport using Wireshark there to get an idea what's happening. We could perhaps turn this into a state machine that correctly files the responses received, depending on their ID field (command response vs. event respsonse), but I'd like to try keeps simple if possible. We first have to understand why it's not working in the first place. If you completely fail, I'd kindly ask you for getting me your board (I could get you one of mine in exchange, Atmel kindly sponsored me some XplainedMini so I could develop AVRDUDE for them). I've got an USB analyzer here, perhaps that helps debugging. > I also tried with a Sam D20 > xplained pro, and it fails also, but it fails more or less immediately. > This is the output of -d (for the Sam d20): > > command "AVR sign-on" [0x12, 0x10] > > 0E 00 06 00 12 10 00 00 > > Received 0x81 0x11 0x00 0x07 0x0e 0x06 > > read: 0e 06 00 12 a0 00 20 > > > > Got message seqno 6 (command_sequence == 6) > > response: 12 A0 00 20 > > initJtagBox() failed: no answer from target Here, the response arrives without any problems within those 500 ms timeout. It's just that the response (in essence) tells you that the target does not respond since it is not an AVR, but you're trying to talk to it as an AVR device. So, this is expected behaviour. -- cheers, Joerg .-.-. --... ...-- -.. . DL8DTL http://www.sax.de/~joerg/ Never trust an operating system you don't have sources for. ;-) |