-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug #52653] device initialization often fails in FT232R syncbb mode, due to glitchy start sequence #464
Comments
The code has changed quite a bit, I am not so sure wether this patch is still valid or not. The patch is probably against this older version. There are two changes in the patch.
The current code is still using bitmode switching.
This is probably not relevant any more as the current code has changed and indeed call call ft245r_drain() before read.
|
Just tested with ATmega328p on the Arduino Uno and there is no issue, using a FT232R USB to Serial Converter with AVR ISP header (similar to https://i.stack.imgur.com/lmG5D.png ) from the following discussion.
|
Using faster baudrate of 38400 is also okay.
|
I tested with both cases: the Uno is powered by the USB cable; or it is not connected to the USB cable and powered by the FT232R USB to Serial converter. avrdude 7.0 works fine in both cases. |
@dl8dtl and @mariusgreuel |
I think I encountered a few times of this issue during my testing of FT232R. I will try a bit more. |
My issue is probably different as it was with a buggy Arduini Mega2560 CH340 clone board which may have HW reset issues. So I will change the label. |
Most likely the issue has been fixed and no longer valid. |
I will close this as |
rai42
Tue 12 Dec 2017 11:57:30 PM UTC
Programmer hardware: FTDI FT232RL
Device type: ATmega8
SETUP:
Using a custom board with ATmega8 and FT232RL and the following config/connections:
programmer
id = "ftdi_uni_uC";
desc = "FT232R Synchronous BitBang";
type = "ftdi_syncbb";
connection_type = usb;
baudrate = 38400;
reset = 7; #RI
sck = 3; #CTS
mosi = 6; #DCD
miso = 5; #DSR
;
I used avrdude 6.2 (but the relevant file ft245r.c is identical with 6.3).
THE PROBLEM: I find that device initialization often (about 50% of tries) fails as follows:
$ sudo ./avrdude -p m8 -c ftdi_uni_uC -P ft0
avrdude: Device is not responding to program enable. Check connection.
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
Investigating with an oscilloscope, I found that during ft245r_open() the signals behave as follows:
shortly pulses RESET=1 and SCK=1 simultaneously, then back to 0
This seems to happen due to the switching of bitmodes back&forth in ft245r_drain().
This is followed by the actual init sequence in ft245r_initialize().
It appears that the simultaneous pulsing of RESET and SCK (step 3 above) puts the ATmega (already powered up since VCC is not controlled) in an undefined state. This is not (always) fixed by the folloiwing init sequence, despite pulsing RESET high in accorance with the datasheet.
I assume that programmers that control VCC will not be affected by this problem, since the AVR is not powered up before ft245r_initialize() runs.
PROPOSED PATCH (see attached ft245r.patch):
file #42625: ft245r.patch
This issue was migrated from https://savannah.nongnu.org/bugs/?52653
The text was updated successfully, but these errors were encountered: