vdudouyt / stm8flash

program your stm8 devices with SWIM/stlinkv(1,2)
GNU General Public License v2.0
403 stars 183 forks source link

stlinkv2: Increase TRY(..) sleep to 10ms #60

Closed vkoutny closed 7 years ago

vkoutny commented 7 years ago

Ebay-style stlink-v2 and stm8s005k6 doesn't work with current value of 3ms (but works just fine with original stlink-v2) - read/write actions fail with "Tries exceeded". It seems the programmer can't process read/write commands if we ask for status too quickly - increasing the in-loop delay helps while just increasing the number of retries doesn't help.

The limit we have to wait is somewhere between 6.5ms (doesn't work at all) to 7ms (works always), with 6.8ms having about 50% success rate; so let's use 10ms to be on a safe side.

Signed-off-by: Vladimir Koutny vladimir.koutny@streamunlimited.com