Cannot Upload - to FTDI MEGAs only

Recently I've been unable to complete the upload of a modified sketch to just three of my numerous Arduino boards. Interestingly all three use an FTDI interface for the USB (i.e. not ATMega16U2). The 3 boards are an old MEGA1280, and two Sparkfun MEGApro's with a FTDI breakout for the USB interface.

All these boards have worked fine for years, and they still work fine, just won;t upload. They run the sketches (loaded a few weeks ago) and the Serial Monitor works fine, except any upload attempt always fails with errors like those shown below.

I wonder what changed recently to cause this?

Sketch uses 50440 bytes (19%) of program storage space. Maximum is 253952 bytes.
Global variables use 3611 bytes (44%) of dynamic memory, leaving 4581 bytes for local variables. Maximum is 8192 bytes.
avrdude: ser_open(): can't open device "\\.\COM8": Access is denied.


avrdude: ser_drain(): read error: The handle is invalid.


avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.


avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.


avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.


avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.


avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.


avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_send(): failed to send command to serial port
avrdude: ser_recv(): read error: The handle is invalid.


avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
Failed uploading: uploading error: exit status 1`

Please post error messages in code tags (the <CODE/> button).

Have you selected the right port?
And do you still have the Serial Monitor open on the port?

The Serial Monitor needs to be closed before uploading with IDE 2.x.

There is one known issue in IDE2.x related to FTDI chips.

You don't mention it but the known problem occurs when you have the serial monitor open.

I'm not sure if that results in the error message that you get.

1 Like

Thanks for your suggestions.

I haven't been actively closing the Serial Monitor so I'll give that a go later. Although I am able to upload to any of my other boards (MEGAs without FTDI and UNOs) even if Serial Monitor is open.

I was using IDE 1.8.19 until maybe two months ago and everything worked fine. I changed to IDE2.x and I'm pretty sure everything worked fine at first, including on FTDI boards. but it's curious this problem only arose in last few weeks.

I tested but it makes no difference if Serial Monitor is open or closed when I try to upload a sketch. Same errors as my post #1.

So still not solved. Other suggestions welcomed ...!

Hi @ninja2. I know you already said you have closed Serial Monitor, but just to make sure I will explain that you must click the X icon on the "Serial Monitor " tab in the bottom panel of the Arduino IDE window to close the tab before attempting an upload:

215050213-e6c41c1a-0eae-448a-ae91-f2acefedf793

Something that wasn't mentioned previously is that having Serial Plotter open also causes the same problem. In this case the procedure is a bit more complex:

  1. Close the "Serial Plotter" window.
  2. If the "Serial Monitor" view is not already open, select Tools > Serial Monitor from the Arduino IDE menus to open it.
    We must do an open/close cycle on Serial Monitor as a workaround for a bug in Serial Plotter
  3. Click the X icon on the "Serial Monitor" tab in the bottom panel of the Arduino IDE window to close the tab.
1 Like

thanks for your suggestions ptillisch.
I followed them meticulously but unfortunalely the uplaod stil failed with these messages:

Sketch uses 50488 bytes (19%) of program storage space. Maximum is 253952 bytes.
Global variables use 3645 bytes (44%) of dynamic memory, leaving 4547 bytes for local variables. Maximum is 8192 bytes.
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
Failed uploading: uploading error: exit status 1

Note that you you are no longer getting the "Access is denied." error. The upload is now failing for a completely different reason.

You have what I like to refer to as a "problem stack". When undertaking complex endeavors, the will often be multiple unrelated problems stacked on top of each other. This means that solving one problem (in this case the "Access is denied." error caused by the IDE bug) only gets you to the next one (the "timeout" error).

That makes it difficult to see that any progress is being made, but I do think you have indeed made progress by getting to this new error.


I'm going to ask you to post the full verbose output from an upload attempt.


:exclamation: This procedure is not intended to solve the problem. The purpose is to gather more information.


Please do this:

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Uncheck the box next to Show verbose output during: compilation in the "Preferences" dialog.
  3. Check the box next to Show verbose output during: ☐ upload.
  4. Click the "OK" button.
  5. Attempt an upload, as you did before.
  6. Wait for the upload to fail.
  7. You will see a "Upload error: ..." notification at the bottom right corner of the Arduino IDE window. Click the "COPY ERROR MESSAGES" button on that notification.
  8. Open a forum reply here by clicking the "Reply" button.
  9. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
    Code tags icon on toolbar
  10. Press Ctrl+V.
    This will paste the error output from the upload into the code block.
  11. Move the cursor outside of the code tags before you add any additional text to your reply.
  12. Click the "Reply" button to post the output.

Please also tell us whether you were uploading to the Mega 1280 board or the Sparkfun MEGApro during the above procedure.

done as requested:

FQBN: arduino:avr:mega
Using board 'mega' from platform in folder: C:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
Using core 'arduino' from platform in folder: C:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6

Detecting libraries used...
C:\Users\cj\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\mega C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\sketch\O2sensor.ino.cpp -o nul
Alternatives for DS1307RTC.h: [DS1307RTC@1.4.1]
ResolveLibrary(DS1307RTC.h)
  -> candidates: [DS1307RTC@1.4.1]
C:\Users\cj\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\mega -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\DS1307RTC C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\sketch\O2sensor.ino.cpp -o nul
Alternatives for TimeLib.h: [Time@1.6.1]
ResolveLibrary(TimeLib.h)
  -> candidates: [Time@1.6.1]
C:\Users\cj\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\mega -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\DS1307RTC -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\Time C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\sketch\O2sensor.ino.cpp -o nul
Alternatives for SdFat.h: [SdFat@2016.7.24]
ResolveLibrary(SdFat.h)
  -> candidates: [SdFat@2016.7.24]
C:\Users\cj\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\mega -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\DS1307RTC -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\Time -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\sketch\O2sensor.ino.cpp -o nul
Alternatives for SPI.h: [SPI@1.0]
ResolveLibrary(SPI.h)
  -> candidates: [SPI@1.0]
C:\Users\cj\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\mega -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\DS1307RTC -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\Time -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\sketch\O2sensor.ino.cpp -o nul
Alternatives for Wire.h: [Wire@1.0]
ResolveLibrary(Wire.h)
  -> candidates: [Wire@1.0]
C:\Users\cj\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\mega -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\DS1307RTC -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\Time -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\sketch\O2sensor.ino.cpp -o nul
Alternatives for LiquidCrystal.h: [LiquidCrystal@1.0.7]
ResolveLibrary(LiquidCrystal.h)
  -> candidates: [LiquidCrystal@1.0.7]
C:\Users\cj\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\mega -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\DS1307RTC -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\Time -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -IC:\Users\cj\AppData\Local\Arduino15\libraries\LiquidCrystal\src C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\sketch\O2sensor.ino.cpp -o nul
Alternatives for OneWire.h: [OneWire@2.3.7]
ResolveLibrary(OneWire.h)
  -> candidates: [OneWire@2.3.7]
C:\Users\cj\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\mega -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\DS1307RTC -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\Time -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -IC:\Users\cj\AppData\Local\Arduino15\libraries\LiquidCrystal\src -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\OneWire C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\sketch\O2sensor.ino.cpp -o nul
Alternatives for DallasTemperature.h: [DallasTemperature@3.9.0]
ResolveLibrary(DallasTemperature.h)
  -> candidates: [DallasTemperature@3.9.0]
C:\Users\cj\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\mega -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\DS1307RTC -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\Time -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -IC:\Users\cj\AppData\Local\Arduino15\libraries\LiquidCrystal\src -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\OneWire -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\DallasTemperature C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\sketch\O2sensor.ino.cpp -o nul
Alternatives for Streaming.h: [Streaming@6.1.1]
ResolveLibrary(Streaming.h)
  -> candidates: [Streaming@6.1.1]
C:\Users\cj\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\mega -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\DS1307RTC -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\Time -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -IC:\Users\cj\AppData\Local\Arduino15\libraries\LiquidCrystal\src -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\OneWire -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\DallasTemperature -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\Streaming\src C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\sketch\O2sensor.ino.cpp -o nul
Alternatives for TimedAction.h: [TimedAction]
ResolveLibrary(TimedAction.h)
  -> candidates: [TimedAction]
C:\Users\cj\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\mega -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\DS1307RTC -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\Time -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -IC:\Users\cj\AppData\Local\Arduino15\libraries\LiquidCrystal\src -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\OneWire -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\DallasTemperature -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\Streaming\src -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\TimedAction C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\sketch\O2sensor.ino.cpp -o nul
Using cached library dependencies for file: c:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\DS1307RTC\DS1307RTC.cpp
Using cached library dependencies for file: c:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\Time\DateStrings.cpp
Using cached library dependencies for file: c:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\Time\Time.cpp
Using cached library dependencies for file: c:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src\FatLib\FatFile.cpp
Using cached library dependencies for file: c:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src\FatLib\FatFileLFN.cpp
Using cached library dependencies for file: c:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src\FatLib\FatFilePrint.cpp
Using cached library dependencies for file: c:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src\FatLib\FatFileSFN.cpp
Using cached library dependencies for file: c:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src\FatLib\FatVolume.cpp
Using cached library dependencies for file: c:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src\FatLib\FmtNumber.cpp
Using cached library dependencies for file: c:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src\FatLib\StdioStream.cpp
Using cached library dependencies for file: c:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src\FatLib\fstream.cpp
Using cached library dependencies for file: c:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src\FatLib\istream.cpp
Using cached library dependencies for file: c:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src\FatLib\ostream.cpp
Using cached library dependencies for file: c:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src\MinimumSerial.cpp
Using cached library dependencies for file: c:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src\SdCard\SdSpiCard.cpp
Using cached library dependencies for file: c:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src\SdCard\SdSpiCardEX.cpp
Using cached library dependencies for file: c:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src\SdCard\SdioCardEX.cpp
Using cached library dependencies for file: c:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src\SdCard\SdioTeensy.cpp
Using cached library dependencies for file: c:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src\SpiDriver\SdSpiESP8266.cpp
Using cached library dependencies for file: c:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src\SpiDriver\SdSpiSAM3X.cpp
Using cached library dependencies for file: c:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src\SpiDriver\SdSpiSTM32F1.cpp
Using cached library dependencies for file: c:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src\SpiDriver\SdSpiTeensy3.cpp
Using cached library dependencies for file: C:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src\SPI.cpp
Using cached library dependencies for file: C:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src\Wire.cpp
Using cached library dependencies for file: C:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src\utility\twi.c
Using cached library dependencies for file: C:\Users\cj\AppData\Local\Arduino15\libraries\LiquidCrystal\src\LiquidCrystal.cpp
Using cached library dependencies for file: c:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\OneWire\OneWire.cpp
Using cached library dependencies for file: c:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\DallasTemperature\DallasTemperature.cpp
Using cached library dependencies for file: c:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\TimedAction\TimedAction.cpp
Generating function prototypes...
C:\Users\cj\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\mega -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\DS1307RTC -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\Time -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat\src -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI\src -IC:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire\src -IC:\Users\cj\AppData\Local\Arduino15\libraries\LiquidCrystal\src -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\OneWire -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\DallasTemperature -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\Streaming\src -Ic:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\TimedAction C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\sketch\O2sensor.ino.cpp -o C:\Users\cj\AppData\Local\Temp\2608962837\sketch_merged.cpp
C:\Users\cj\AppData\Local\Arduino15\packages\builtin\tools\ctags\5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives C:\Users\cj\AppData\Local\Temp\2608962837\sketch_merged.cpp
Compiling sketch...
"C:\\Users\\cj\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR "-IC:\\Users\\cj\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\cj\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\mega" "-Ic:\\Users\\cj\\Documents\\ARDUINO\\SKETCHES\\libraries\\DS1307RTC" "-Ic:\\Users\\cj\\Documents\\ARDUINO\\SKETCHES\\libraries\\Time" "-Ic:\\Users\\cj\\Documents\\ARDUINO\\SKETCHES\\libraries\\SdFat\\src" "-IC:\\Users\\cj\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\SPI\\src" "-IC:\\Users\\cj\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\libraries\\Wire\\src" "-IC:\\Users\\cj\\AppData\\Local\\Arduino15\\libraries\\LiquidCrystal\\src" "-Ic:\\Users\\cj\\Documents\\ARDUINO\\SKETCHES\\libraries\\OneWire" "-Ic:\\Users\\cj\\Documents\\ARDUINO\\SKETCHES\\libraries\\DallasTemperature" "-Ic:\\Users\\cj\\Documents\\ARDUINO\\SKETCHES\\libraries\\Streaming\\src" "-Ic:\\Users\\cj\\Documents\\ARDUINO\\SKETCHES\\libraries\\TimedAction" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\sketch\\O2sensor.ino.cpp" -o "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\sketch\\O2sensor.ino.cpp.o"
Compiling libraries...
Compiling library "DS1307RTC"
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\DS1307RTC\DS1307RTC.cpp.o
Compiling library "Time"
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\Time\Time.cpp.o
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\Time\DateStrings.cpp.o
Compiling library "SdFat"
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\SdFat\FatLib\FmtNumber.cpp.o
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\SdFat\FatLib\FatFileLFN.cpp.o
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\SdFat\FatLib\FatFilePrint.cpp.o
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\SdFat\FatLib\StdioStream.cpp.o
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\SdFat\FatLib\FatVolume.cpp.o
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\SdFat\FatLib\fstream.cpp.o
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\SdFat\FatLib\istream.cpp.o
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\SdFat\FatLib\FatFile.cpp.o
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\SdFat\FatLib\FatFileSFN.cpp.o
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\SdFat\SdCard\SdioTeensy.cpp.o
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\SdFat\SpiDriver\SdSpiESP8266.cpp.o
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\SdFat\SdCard\SdSpiCardEX.cpp.o
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\SdFat\MinimumSerial.cpp.o
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\SdFat\SdCard\SdSpiCard.cpp.o
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\SdFat\SpiDriver\SdSpiSTM32F1.cpp.o
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\SdFat\FatLib\ostream.cpp.o
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\SdFat\SdCard\SdioCardEX.cpp.o
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\SdFat\SpiDriver\SdSpiSAM3X.cpp.o
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\SdFat\SpiDriver\SdSpiTeensy3.cpp.o
Compiling library "SPI"
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\SPI\SPI.cpp.o
Compiling library "Wire"
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\Wire\Wire.cpp.o
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\Wire\utility\twi.c.o
Compiling library "LiquidCrystal"
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\LiquidCrystal\LiquidCrystal.cpp.o
Compiling library "OneWire"
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\OneWire\OneWire.cpp.o
Compiling library "DallasTemperature"
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\DallasTemperature\DallasTemperature.cpp.o
Compiling library "Streaming"
Compiling library "TimedAction"
Using previously compiled file: C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D\libraries\TimedAction\TimedAction.cpp.o
Compiling core...
Using precompiled core: C:\Users\cj\AppData\Local\Temp\arduino\cores\arduino_avr_mega_cpu_atmega2560_c2827c15a2b770c8806c7933a773e3e6\core.a
Linking everything together...
"C:\\Users\\cj\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega2560 -o "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D/O2sensor.ino.elf" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\sketch\\O2sensor.ino.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\DS1307RTC\\DS1307RTC.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\Time\\DateStrings.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\Time\\Time.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\SdFat\\FatLib\\FatFile.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\SdFat\\FatLib\\FatFileLFN.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\SdFat\\FatLib\\FatFilePrint.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\SdFat\\FatLib\\FatFileSFN.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\SdFat\\FatLib\\FatVolume.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\SdFat\\FatLib\\FmtNumber.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\SdFat\\FatLib\\StdioStream.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\SdFat\\FatLib\\fstream.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\SdFat\\FatLib\\istream.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\SdFat\\FatLib\\ostream.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\SdFat\\MinimumSerial.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\SdFat\\SdCard\\SdSpiCard.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\SdFat\\SdCard\\SdSpiCardEX.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\SdFat\\SdCard\\SdioCardEX.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\SdFat\\SdCard\\SdioTeensy.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\SdFat\\SpiDriver\\SdSpiESP8266.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\SdFat\\SpiDriver\\SdSpiSAM3X.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\SdFat\\SpiDriver\\SdSpiSTM32F1.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\SdFat\\SpiDriver\\SdSpiTeensy3.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\SPI\\SPI.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\Wire\\Wire.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\Wire\\utility\\twi.c.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\LiquidCrystal\\LiquidCrystal.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\OneWire\\OneWire.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\DallasTemperature\\DallasTemperature.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D\\libraries\\TimedAction\\TimedAction.cpp.o" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D/..\\..\\cores\\arduino_avr_mega_cpu_atmega2560_c2827c15a2b770c8806c7933a773e3e6\\core.a" "-LC:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D" -lm
"C:\\Users\\cj\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D/O2sensor.ino.elf" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D/O2sensor.ino.eep"
"C:\\Users\\cj\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -R .eeprom "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D/O2sensor.ino.elf" "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D/O2sensor.ino.hex"

Using library DS1307RTC at version 1.4.1 in folder: C:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\DS1307RTC 
Using library Time at version 1.6.1 in folder: C:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\Time 
Using library SdFat at version 2016.7.24 in folder: C:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\SdFat 
Using library SPI at version 1.0 in folder: C:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\SPI 
Using library Wire at version 1.0 in folder: C:\Users\cj\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire 
Using library LiquidCrystal at version 1.0.7 in folder: C:\Users\cj\AppData\Local\Arduino15\libraries\LiquidCrystal 
Using library OneWire at version 2.3.7 in folder: C:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\OneWire 
Using library DallasTemperature at version 3.9.0 in folder: C:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\DallasTemperature 
Using library Streaming at version 6.1.1 in folder: C:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\Streaming 
Using library TimedAction in folder: C:\Users\cj\Documents\ARDUINO\SKETCHES\libraries\TimedAction (legacy)
"C:\\Users\\cj\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-size" -A "C:\\Users\\cj\\AppData\\Local\\Temp\\arduino\\sketches\\7746682E48B86B7B32CF25D6F860643D/O2sensor.ino.elf"
Sketch uses 40428 bytes (15%) of program storage space. Maximum is 253952 bytes.
Global variables use 3555 bytes (43%) of dynamic memory, leaving 4637 bytes for local variables. Maximum is 8192 bytes.
"C:\Users\cj\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\cj\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega2560 -cwiring "-PCOM9" -b115200 -D "-Uflash:w:C:\Users\cj\AppData\Local\Temp\arduino\sketches\7746682E48B86B7B32CF25D6F860643D/O2sensor.ino.hex:i"

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Users\cj\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

         Using Port                    : COM9
         Using Programmer              : wiring
         Overriding Baud Rate          : 115200
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer

avrdude done.  Thank you.

Failed uploading: uploading error: exit status 1

I did notice that the 'access is denied' error dissappeared. I take it that whenever this error appears again I should first check the Serial Monitor and Plotter are closed.

It may help if I explain my recent usage. I took several years break from my Arduino hobby until maybe 2 months ago when I started fiddling again, using IDE 1.8.19 that was still sitting on two of my computers. It was maybe a month ago that I upgraded to IDE 2.2 and I've been learning the new interface since. Maybe two weeks ago I did turn Serial Monitor on, but I didn't use it or spend any time on it. It may be that was the trigger for the 'access denied' errors to start appearing on any board with an FTDI USB I/F?

One thing I noticed immediately using IDE 2 is there seems to be no way to display the Serial Monitor in a window of its own, unlike IDE 1.8.19. So I was experimenting with having two different sketches open, with the Serial Monitor open in the other (unrelated) sketch. A bit clunky although it works OK, but maybe this method was a trigger for my 'access denied' issue?

Meanwhile I may re-install IDE 1.8.19 on one of my computers, to test if it's an IDE 2 issue.

Please provide the other information I requested:

That is correct. In my experience, the problem occurs 100% reliably so you will need to get into the habit of closing Serial Monitor and Serial Plotter before every upload.

Arduino IDE 2.x will automatically reopen Serial Monitor again when you open a sketch if it was open the last time you had the sketch open. So if you opened it once and never closed it again after that, Serial Monitor will continue to be open while uploading the sketch even weeks later.

You might not notice the fact that Serial Monitor is open because the tabbed design of the bottom panel of the IDE means that if you have the "Output" view selected then you don't see the "Serial Monitor" view (other than its tab).

The Arduino IDE developers are tracking this deficiency here:

If you have a GitHub account, you can subscribe to that issue to get notifications of any new developments related to this subject:

image

The workaround is:

  1. Select File > New Sketch from the Arduino IDE menus.
    A new Arduino IDE window will open.
  2. Select Tools > Serial Monitor from the Arduino IDE menus.
  3. Hover the mouse pointer over the top border of the bottom panel.
    The mouse pointer will change into a resize icon.
  4. Click and drag the border up until it reaches its maximum height.

You can now use that Arduino IDE window solely for Serial Monitor, switching back to the other Arduino IDE window to do sketch editing, compile, upload, etc. operations just as you would do with the Arduino IDE 1.x Serial Monitor.

I recommend you to wait. I might be able to provide you with a simple solution once you provide the information I requested.

Great info many thanks again. I'll look into all the details a bit later.

Meanwhile the compilation / upload report above was for my old MEGA 1280.

OK, great. Please try this:

  1. Select Tools > Processor ATmega1280 from the Arduino IDE menus.
  2. Upload the sketch to your "MEGA 1280" board.

Arduino used a single board definition for both the Mega 2560 and the Mega 1280 boards but a different configuration is needed depending on which board you are targeting so they added this Tools > Processor menu in order to allow the user to select which variant of the board they are using. From the output you shared in your previous reply, I can see that you had "ATmega2560 (Mega 2560)" selected from the menu. I believe that is the cause of the most recent "avrdude: stk500v2_getsync(): timeout communicating with programmer" upload failure.

1 Like

OK that worked :slight_smile:. Still a bit embarrasing that I didn't even notice that 1280 processor item in the tools menu ... reminds me of that video of basketball game with a gorilla walking through the middle ... that most don't notice !

So now I'm hoping you have a similar magic solution for my Sparkfun MEGApro boards ? (with USB connected using a Sparkfun FTDI breakout).

Actually I'll retry uploading on one of them anyway. Maybe they only need the Serial Monitor closed ... standby!

Yay, uploaded to a MEGApro too ... :slight_smile:
So seems the solutions are the Serial Monitor fix for MEGApro and MEGA1280, plus Processor setting fot the MEGA 1280 .

Great work, thanks ptillisch

PS: I wanted to mark two of your posts as the solution (#6 and #13) but seems I can't nominate more than one post.

1 Like

You are welcome. I'm glad everything is working with all your boards now. Thanks for taking the time to post an update with your results.

Regards,
Per

As an aside, IMO its quite odd/curious that the Serial Monitor issue doesn't arise for all baords, only those with FTDI interface ?

It is indeed. The primary developer of the Arduino IDE, Akos Kitta, did an investigation and reported their findings here:

This is what is happening:

  1. client (IDE2) ends the stream
  2. server (CLI) receives the end of the stream, kills the monitor process
  3. the stream is already closed on the client, it does not wait for the server, the server is still killing the processes (maybe),
  4. the client starts an upload
  5. :boom:

So the code that allows Arduino IDE to juggle control over the serial port between the Serial Monitor process and the upload tool process doesn't wait to make sure the Serial Monitor process has finished giving up control over the port before it starts the upload tool. It just sends the signal to disconnect the port from the Serial Monitor and then immediately starts the upload tool. If for some reason it takes a little bit of time for the Serial Monitor to disconnect from the port, or maybe if the port takes some time to be ready to use again after that disconnection, then the upload tool tries to open the port too soon and you hit that ":boom:" step (which in this case is AVRDUDE failing with an "Access is denied" error).

It seems that for some reason it takes a little longer for the port produced on a Windows machine (the bug does not affect Linux or macOS) by an FTDI FT232R chip to be freed up than the ports produced by other USB to serial adapter chips (even the cheap CH340 doesn't have this problem). I don't know whether the slowness is in the Windows driver or the chip itself.

uurrgghh. ugly / tricky issue, but that's an impressive diagnosis, tks

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.