Hi,
just tried avrdude with new ft232rl-based programmer. I have couple of
fixes for ft245r. Here is the first one. The second patch I send in a
separate e-mail, because fixes are not related to each other.
This patch fixes a small error. After ft245r_cmd call ft245r_out is not anymore
in sync with real state of SCK and maybe MOSI (depends on the latest
sent data bit). set_data updates ft245r_out to be in sync. After
set_data SCK is always ON and MOSI's state is the latest data bit.
But after that ft245r_cmd adds 0 byte to reset all signals after the
command, but it does not update internal ft245r_out variable and state
of SCK and MOSI is not cleared.
Because of that functions set_pin/set_reset/set_buff/.../ can trigger
occasionally SCK and MOSI from low to high. Trigger of SCK looks to uC as a new
bit and
can mess-up all bit-bang operations.
This is a minor bug, because it should never happen in normal case.
The only case then it happened was ft245r_initialize where
set_reset(pgm, OFF) triggered SCK on and broke flash process. But
this was fixed another way by commit
http://svn.savannah.nongnu.org/viewvc/trunk/avrdude/ft245r.c?root=avrdude&r1=1324&r2=1331
But I think that it's useful to apply the patch anyway to avoid spending time
on debugging such strange behavior in the future.
--
Best regards,
Andrey Skvortsov
Secure eMail with gnupg: See http://www.gnupg.org/
PGP Key ID: 0x57A3AEAD
--- avrdude-upstream/ft245r.c 2015-01-26 14:57:06.694284064 +0300
+++ avrdude/ft245r.c 2015-01-26 17:46:42.898258686 +0300
@@ -510,7 +540,7 @@
for (i=0; i<4; i++) {
buf_pos += set_data(pgm, buf+buf_pos, cmd[i]);
}
- buf[buf_pos] = 0;
+ ft245r_out = buf[buf_pos] = 0;
buf_pos++;
ft245r_send (pgm, buf, buf_pos);
_______________________________________________
avrdude-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev