I am programming a pro mini and if I add a serial.begin(9600) to a sketch, upload will fail and all future uploads of any other sketch will fails as well (including example blink). Prior to fail other sketches will upload just fine.
adruino - Pro mini from adafruit
system lenovo p40 with windows 10 pro 1709
ide 1.8.0 OR 1.8.5
using FTDI232 to interface to pro mini
error message is:
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of ... : not in sync: resp=0x20 quits after 10 trys.
only way to get communication back is to
change ide 1.8.0 to 1.8.5
un-install completely the IDE, reboot,
2)re-install the IDE (1.8.0),
then reboot again.
avoid any sketch code which includes serial.
I have tried without a fix the following (except the un-install - reinstall proceedure above):
reboots
unplug / replug the FTDI232
push the reset button on the pro mini
upgrade from ide 1.8.0 to ide 1.8.5
install FTDI232 drivers from ftdi.com using CDM21228_Setup.exe
when I cause the upload to fail, normally takes a few attempts to fix to get the pro mini uploads back. This can be reproduced easily for me, take the blink example upload, works fine. Change timing in blink, upload and the led timing changes appropriately. Add serial.begin(9600) after void setup() { line.
upload will now fail. Remove the serial.begin(9600) line, try to upload will fail consistently. including shutdowns and restarts, etc.
Thanks. Gary
by the way, I wanted to add serial so I could watch the sketch execution through the serial monitor.
I uninstall using "Your Uninstaller!" in super mode which:
uses program uninstaller
scrubs the registry and searches windows directories
and I then go and delete install directory. I will use the PDF you supplied next time to see if there is anything else...
It has been a bit since my last sketch on a Leonardo, So The sketches I initially ran on the pro mini were versions of the blink example to verify I had communications. They ran fine.
The sketch I am working on reads a number of analog inputs (water level) and then writes a number of digital outputs (to look line float sensor inputs to an aquarium controller). For this, it would be nice to use the serial monitor to see what the analog inputs were doing.
SO I went and ran the IDE File-Examples-01 Basics-analog read serial example. I got the error I indicated then went back to run the prior blink sketch. It now fails as well. SO I read the suggested troubling link and searched the web, nothing appropriate. I then upgraded to IDE 1.8.5 still failed, I installed the FDTI drivers, still failed. Ran virus checkers, other programs as the IDE is java to see if there was something nothing. So I uninstalled the IDE, scrubbed directories and reinstalled 1.8.0.
Blink now runs again. So I retried IDE File-Examples-01 Basics-analog read serial example. failed and blink nows fails as well as well as any other example. SO I uninstalled 1.8.0, scrubbed and then ran blink, it runs. Then upgraded to 1.8.5, blink still runs so not an ide 1.8.5 Issue. Then I added ONLY the serial.begin line from the example to blink sketch (following the analog read example), IDE fails now for any code examples including prior running ones. to recover, I need to un-install, scrub, reinstall. Then things are working again. I am only using supplied examples, not my sketch.
When it dies, I can compile, just not upload.
Thanks again, Hopefully, I answered your questions. Any others?
I think this is a bug in the IDE when using the pro mini and FTDI232 setup. Prior sketches with Leonardo included serial and they ran fine. And I had used the FDTI232 on a different arduino as well. If I had a code issue the compile would catch. I could always go back to a prior running sketch and redo. this case the IDE breaks and stays broken, I have not dusted off a Leonardo to si if it is now broken as I think I have deleted the sketches for that when I deleted the IDE. I did not want to erase what is loaded on that.
There are other sources using FTDIGATE as a search term.
There are also a couple of different fixes but I have not suffered from it so you would have to search those out.
It is also the biggest single reason that manufacturers moved to other chips such as the CH340, CP2012, and Arduino moved to the Atmega for the USB serial communications.
There is still an FTDI driver included in a zip file in the DRVERS section of the IDE install that might also be worth a try.
Simply unzip that small archive and install that one.
My own recommendation is to do so as Administrator and with Driver Enforcement turned OFF.
They may have turned off bricking but people still suffered AFTER that point.
I can laser engrave most things and the counterfeiters can do it much better than me.
Signed drivers are normally quite secure but as FTDI GATE showed they are not all they seem on occasion.
MS have a bad habit of wrong drivers being accepted for hardware. I currently run an NVidia 610 with the WHQL 630 drivers quite happily as they are better than MS versions and the model doesn't harm on this occasion.
I cannot dispute either way why yoiu see that work and then not.
That would seem to be the crux of the matter and with that in mind maybe it would be better for you to post an actual failing sketch so that others may try to replicate it with YOUR sketch (dont forget to use code tags ( </> )
Windows wont always report a driver issue or change if it thinks it is the same or newer and even then can be fooled into thinking there were no changes. So that is no guarantee.
Item 5 is the best line to follow so please do post up the exact sketch that causes it.
Post a simple sketch one that doesn't require special hardware.
I have a Dell M6300 running Windows 10 Pro 64-bit 1709.
Arduino IDE 1.8.5
I have a clone Pro Mini purchased on eBay connected up via FTDI 232RL adapter purchased on eBay.
the example analog read serial in the IDE will brick the installation, I have included that below. I re-created the issue and checked before and after the removal and re-install, I could not see that the FDTI drivers changed. I am still at a loss at how the setup works repeatedly until I do something serial.
I have placed an order for DSD TECH USB to TTL Serial Converter CP2102 with 4 PIN Dupont Cable just to cross the fdti issue off, I will have that Thursday weather permitting.
I could not find a ch340 converter which had good reviews and 3/5v capability. Also I would have ordered an ARDUINO USB 2 SERIAL MICRO with atmega16U2 but did not have any indication when that would arrive.
Analogreadserial | arduino 1.8.5 example. Reset button was pressed. I did not alter the code in any way. After running this I cannot upload any code including the previously successful blink example. Note I jumpered 5V to the A0 pin so if this worked, I should have read 1023.
IEEE488, I am interested if this works for you.
/*
AnalogReadSerial
Reads an analog input on pin 0, prints the result to the Serial Monitor.
Graphical representation is available using Serial Plotter (Tools > Serial Plotter menu).
Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.
This example code is in the public domain.
*/
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
// print out the value you read:
Serial.println(sensorValue);
delay(1); // delay in between reads for stability
}
Windows 10 Pro 64-bit
Version 1709 (OS Build 16299.192)
COM5 with the FTDI adapter.
Driver is 8/16/2017 2.12.28.0
I am getting readings in the Serial Monitor.
Arduino Pro Mini RX <----> FTDI TX
Arduino Pro Mini TX <----> FTDI RX
Arduino Pro Mini VCC <----> FTDI VCC
Arduino Pro Mini GND <----> FTDI GND
Arduino Pro Mini DTR <----> FTDI DTR
Thanks, IEEE488. I will do the following: remove the windows FDTI drivers and allow windows to reload. If that does not work, I will retry with DSD TECH USB to TTL Serial Converter CP2102 Thursday or Friday. Appreciate that you ran the sketch successfully.
To IEEE488 The FDTI323number is a typo on my part in the forum header, I have a FDTI232. If I try to update driver, windows comes back that I already have the latest. I turned off driver signature enforcement and installed the FDTI drivers, no fix.
To ballscrewbob, I tried your suggestions of:
turning off driver signature enforcement and then installed drivers from the IDE directory. no fix
followed exactly the removal PDF including CCCLEANER and WISE Registry then turned off Driver signature enforcement and then reinstall of IDE 1.8.0(noticed it installs USB drivers, was not sure that that was occurring if driver signature enforcement) This time the FDTI232 would fail even with starting with blink (no serial yet).
A number of reinstalls, and still could not get it to work. I ended up recovering to a installpoint snapshot I had at the beginning of the year. Then I then updated the system and did a clean install of IDE 1.8.0. Blink now works again.
I did not follow-up with analogreadserial, the project I am working on will work without serial, SO I figured I would wait until the DSD TECH USB to TTL Serial Converter CP2102 arrives tomorrow. If blink and analogreadserial both work with the CP2102, I will then try the analogreadserial with the FDTI232. If that fails I will toss the FDTI232. Thanks for the advice...
To all, I went ahead and tried the tutorial analogreadserial, it uploaded just fine this time. Not sure what changed this time but I created a restore point.
Wired up the DSD TECH USB to TTL Serial Converter CP2102 (brought out DTR). Existing windows drivers worked file, SO I am good with 2 programming options. Thanks a million to all both of you for your help, Gary