From: Armin O. <arm...@gm...> - 2014-10-17 19:29:55
|
I had the chance to trace usb-communication on a windows PC with AVR Studio 6.2. There the set device description looks a little different mainly i found these telegrams: 1b 05 00 23 00 00 00 0e 36 02 00 1f 10 00 00 20 00 00 00 00 00 00 00 fe 01 00 00 01 00 02 04 01 04 00 00 00 27 1f 1e 1c 1d 57 00 56 0a 1b 06 00 0c 00 00 00 0e 36 80 00 08 ff ff ff ff fb ff ff ff 55 81 1b 07 00 0c 00 00 00 0e 36 88 00 08 df bf fe ff fb ff 7f fa 0a 00 1b 08 00 18 00 00 00 0e 36 81 00 14 ff ff ff ff fe ff fe ff ff ff ff ff ff fe ff ff ff ff ff ff 20 cf 1b 09 00 18 00 00 00 0e 36 89 00 14 ff ff 0f ff be ff be ff fa ff ff ff ff fe ff ff ff ff ff ff d6 6c The command will always be send as set XMegaParms (although we're talking about an attiny here). The last four look like the ordinary SFR-Maps for Read and Write access (although no Shadow-List here). The first one looks to me as what is described as jtag3_device_desc_type in jtag.h. The most interesting here is that the byte defined as always_one now is 4. Which perfectly matches with my earlier thought about how that information that 4 buffers need to be filled per page-erase gets to the Dragon. So i simply patched those commands into the setDeviceDescriptor like copied below and it works just fine. For a cleaner solution of course some way has to be found to merge these four commands into the device-description structure. And by the way when I patched those lines, it occurred to me as if there is a delete [] missing after the call to doJtagCommand. But I'm not an c++ expert, since mostly working on µC with C. I hope this helps... at least somebody ;-) Armin uchar msg1[] = {0x36, 0x02, 0x00, 0x1f, 0x10, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x01, 0x00, 0x02, 0x04, 0x01, 0x04, 0x00, 0x00, 0x00, 0x27, 0x1f, 0x1e, 0x1c, 0x1d, 0x57, 0x00 }; uchar msg2[] = {0x36, 0x80, 0x00, 0x08, 0xff, 0xff, 0xff, 0xff, 0xfb, 0xff, 0xff, 0xff}; uchar msg3[] = {0x36, 0x88, 0x00, 0x08, 0xdf, 0xbf, 0xfe, 0xff, 0xfb, 0xff, 0x7f, 0xfa}; uchar msg4[] = {0x36, 0x81, 0x00, 0x14, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; uchar msg5[] = {0x36, 0x89, 0x00, 0x14, 0xff, 0xff, 0x0f, 0xff, 0xbe, 0xff, 0xbe, 0xff, 0xfa, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; //doJtagCommand(command, devdescrlen, response, respSize); doJtagCommand(msg1, sizeof(msg1), response, respSize); delete [] response; doJtagCommand(msg2, sizeof(msg2), response, respSize); delete [] response; doJtagCommand(msg3, sizeof(msg3), response, respSize); delete [] response; doJtagCommand(msg4, sizeof(msg4), response, respSize); delete [] response; doJtagCommand(msg5, sizeof(msg5), response, respSize); delete [] response; |