# pyocd programming is slower than expected

I am using pyocd to program a MAX32660 using a MAX32660-EVSYS via SWD. pyocd is reporting a bit rate that is less than 1/5 of the clock frequency I chose.

pyocd flash build/test_debug.elf --target max32660 --frequency 10000
[====================] 100%
0037168:INFO:loader:Erased 0 bytes (0 sectors), programmed 0 bytes
(0 pages), skipped 8192 bytes (8 pages) at 0.23 kB/s


This result is surprising because the SWD protocol itself appears to have less than 2X overhead. In this example the flash is not actually programmed because there is no change in the data, and in any case the flash is much faster than the time this programming takes.

This becomes a major issue if I want to use SWD wiring that is more than 3 inches long, as apparently there is a very weak driver in either the MAX32660 or MAX32660-EVSYS, requiring the frequency to be set extremely low.

What can explain this very slow operation?

• It appears to me that your command didn't actually program anything at all. It says "programmed 0 bytes". The reported data rate is probably meaningless. – Elliot Alderson Feb 1 at 1:52
• @Elliot. Good observation, but I don't agree with your logic. The reported data is in proportion to stopwatch measurements. Surely what it is reporting is including the time that it takes to read the EEPROM, to determine which sectors to program. Yes, in this case, the answer is zero sectors, but that doesn't mean that the operation is instant. In fact it takes over 10 seconds! – personal_cloud Feb 13 at 20:54