From: Thomas S. <tho...@gm...> - 2014-06-25 21:47:23
|
Andreas, Thanks for the very insightful reply. 1 and 2 don't seem options for me. For 3, any recommendations on a FTDI based adapter that works with those changes? For 4, how much work do you think this will be? Any guidelines on it? I am definitely considering this route, as the CMSIS-DAP devices are becoming more and more numerous on so many eval kits. I am also looking at option 5, as we have some BBBs that can use the BitBang method too. Cheers, - Thomas On Mon, Jun 23, 2014 at 4:42 PM, Andreas Fritiofson < and...@gm...> wrote: > > > > On Mon, Jun 23, 2014 at 11:46 PM, Thomas Schmid <tho...@gm...> > wrote: > >> Hello, >> >> We are trying to switch over our part programming to use CMSIS-DAP, since >> some of the newer parts we work with only support SWD programming. Our >> specific setup is the new Atmel ICE (EDBG version) with the Atmel SAMR21. >> We have it all working, but programming the flash is very slow (~1kB/s). To >> do some tests, I chose one of our other SAM4S platforms that can do both >> JTAG and SWD programming. Using a Segger JLink vs the Atmel ICE is like >> light and day (with same adapter_khz settings). >> >> Does anybody else have this problem, and maybe a solution for it? Or does >> anybody have an idea where the bottle neck could be? I started to look at >> the SWD signals, and there seems to be a lot of wait time between commands >> on the bus. >> >> > Hi! > > The problem is that the CMSIS-DAP implementation in OpenOCD is > synchronous, i.e. it only has a single DAP access outstanding at any time. > USB round trips makes that unbearably slow. There are patches that are > going to be merged very soon that changes the API so that the driver can be > rewritten into an asynchronous style. But these patches are only to support > the SWD implementation for the FTDI driver, the CMSIS-DAP driver has not > been rewritten yet. > > So your options right now are to: > > 1. Live with the slow speed and know that it's going to improve some time > in the future. > 2. Get an ST-Link (like on the ST discovery boards) and live with the fact > that you won't have the same level of control (for example, no vector > catch). > 3. Get a suitable FTDI based adapter and use the SWD patches currently in > Gerrit [1] (or wait for them to get merged). This option is speedy, i.e. > 700 kByte/s memory R/W. Flash programming speed of course also depends on > the flash driver in OpenOCD and the actual flash controller. > 4. Maybe the best option (for everyone else at least :)), rewrite the > CMSIS-DAP driver yourself, on top of the asynchronous API [2]. > 5. There's also the possibility to fix/update the JLink, Versaloon or RPi > SWD driver [3] that is also depending on the above API changes. > > Also note that the EDBG CMSIS-DAP implementation is IMHO broken [4] and > may require quirks that harms performance, even in asynchronous mode. > > Regards, > Andreas > > [1] The change series ending with http://openocd.zylin.com/2184 > [2] http://openocd.zylin.com/1959 which is also included in [1] > [3] http://openocd.zylin.com/2141 http://openocd.zylin.com/1947 > http://openocd.zylin.com/2004 > [4] http://openocd.zylin.com/#/c/2088/3/src/target/cortex_m.c,cm > |