Weird: serial doesn't work if inadvertently changing used programmer

Hello folks,

I’m massively using the USB cable + FTDI breakout from Sparkfun to program my Pro Minis 8Mhz/3v3. I have always used the default programmer in the IDE, namely: Tools → Programmer → AVRISP MKII.
In this days I’m “playing” with an USBasp dongle.

Yesterday has happened that I need to flash a pro mini in the previous old manner.
Unfortunately, when setting back to my usual configuration (Tools → Board ->Arduino Pro or Pro mini) I have inadvertently forgot to change the Programmer from “USBasp” to “AVRISP MKII”.

Flashing has be done without problems, but when I went to my garage to connect my pro mini to my OBD-decoder (to test it as usually) the arduino could not connect to the decoder via the usual serial interface (pins TX0 and TXI).

After some imprecations I had to idea to check again the IDE configuration and… bingo! I’ve found my configuration error. :-[
I’ve set back the programmer to “AVRISP MKII”, flashed again the arduino, and all was working fine as before. :slight_smile:

So, just for a sake of curiosity, I would to know why/how a different programmer can affect even the communication over the serial line using the standard serial pins.
The management of that pins should be rock-solid in every programmer, isn’t it?

The Tools > Programmer menu selection should make absolutely no difference for a standard Upload to a Pro Mini. That menu selection only matters for the Tools > Burn Bootloader and Sketch > Upload Using Programmer. There are some boards that don't support uploading via serial and their board definitions are configured so that the actions you take to normally do a standard Upload operation actually do Upload Using Programmer but the Pro Mini is not one of those boards.

Are you sure the problem wasn't something completely unrelated to the Tools > Programmer menu selection? If this was really the problem you should be able to reproduce it by selecting the USBasp programmer.

Hi,

I'm 99,99% sure that, after returning to my secret "hobby-laboratory", I only changed the Programmer under the "Tools" menu and I have pressed the upload-button (the one with arrow draw on it).

All other selections was:

Board = Arduino Pro or Pro mini
Processor = ATMega328 (3.3V, 8 Mhz)
Port = /dev/ttyUSB0

I will try to make another test in the weekend (if my family allows that) and to post here the screenshots of the used IDE-configurations.

IMPORTANT!

Exactly in this moment, I'm making my experiments in programming the Pro Mini with the USBasp.
I can confirm you that pressing the upload-button or selecting Sketch -> Upload Using Programmer are doing the same thing/action when "USBasp" is selected as programmer.

Note: the downloaded sketch size was around 29K, more than enough to be accommodated in the standard Pro mini with 2K bootloader size.

Maybe you mean that I had to intentionally select the command "Sketch" -> "Upload" in place of pressing the download button???

My IDE version is 1.8.1.

gimpo:
I can confirm you that pressing the upload-button or selecting Sketch → Upload Using Programmer are doing the same thing/action when “USBasp” is selected as programmer.
[/quote]
Which hardware package are you using (e.g. Arduino AVR Boards)? Normally pressing the upload button should be the same as Sketch > Upload, not Sketch > Upload Using Programmer. Holding Shift while pressing the upload button does the same thing as Sketch > Upload Using Programmer. As I said before, there are some board definitions where that is not the case but the Arduino AVR Boards Pro Mini definition is not one of them.

I'm using the MiniCore package.

It is placed in .arduino15/packages/MiniCore/ folder.

I'm not used to press the shift-key while clicking on the upload button. I never done that because I'm lazy. :smiley:

With MiniCore if you have Tools > Bootloader > No selected then the Upload button does the same operation as Sketch > Upload Using Programmer. If you have Tools > Bootloader > Yes selected then the Upload button does the same operation as Sketch > Upload.

Aaaaaaaaaaaaah!
So the mystery is solved.

So, even by pressing the same button:

the first time I have uploaded the sketch using the USBasp programmer,
the second time I have uploaded the sketch using the AVRISP MKII programmer.

More important: why the first upload stopped the serial line from working?
My sketch started normally, doing his initialization stuff, display init, etc. etc. Then it sent a "wake-up" message to my OBD-device over the serial, but no response.
Maybe some different memory I/O mapping?
Maybe the programmer was assuming that all of the 32K was available and this caused (somehow) the wrong behaviour?