I'm trying to upload a program to a Mega 2560 using a Bluetooth link to a HC-05 BT module. I have configured the module to output a LOW on it's STATE pin when a connection is made, and confirmed that this is working properly. I also configured it to use 115200 baud in 'data' mode vs the default 9600.
Based on a number of posters who claim to have made this work, I connected the STATE pin output to the Mega reset pin via a 0.2uF cap (I didn't have any 0.1uF's available) and verified that a negative pulse appears on the reset pin when the HC-05 opens a connection.
I verified that I can pass data both ways through the HC-05 using RealTerm on my PC to connect to the HC-05 COM port, with my VS2017/VM setup connected to the Mega with a USB cable
However, when I try to upload a program, the loader times out (verbose output below). I can see the loader establish a connection to the HC-05 module, but nothing happens. I tried manually resetting the Mega with the reset button but that doesn't seem to affect anything either. I'm starting to suspect that there is some other unknown problem with the loader configuration.
Any ideas what I'm doing wrong here?
Compiling debug version of 'BlinkTest' for 'Arduino/Genuino Mega w/ ATmega2560 (Mega 2560)' Program size: 3,048 bytes (used 1% of a 253,952 byte maximum) (1.20 secs) Minimum Memory Usage: 288 bytes (4% of a 8192 byte maximum) Uploading 'BlinkTest' to 'Arduino/Genuino Mega w/ ATmega2560 (Mega 2560)' using 'COM27' Uploader started for board Arduino/Genuino Mega w/ ATmega2560 (Mega 2560) Upload method will be: bootloader Uploading via Bootloader C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avrdude "-CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" -v -V -patmega2560 -cwiring "-PCOM27" -b115200 -D "-Uflash:w:C:\Users\Frank\AppData\Local\Temp\VMBuilds\BlinkTest\mega_atmega2560\Debug/BlinkTest.ino.hex:i" avrdude: Version 6.3-20171130 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2014 Joerg Wunsch System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf" Using Port : COM27 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 The uploader process failed avrdude: stk500v2_getsync(): timeout communicating with programmer avrdude done. Thank you.