The sketch is the Blinky one (Example 1) from the [Pro Micro & Fio V3 Hookup Guide. As for dealing with the Serial objects, I did one better. I commented them out altogether. Here’s the resulting sketch:
/* Pro Micro Test Code
by: Nathan Seidle
modified by: Jim Lindblom
SparkFun Electronics
date: September 16, 2013
license: Public Domain - please use this code however you'd like.
It's provided as a learning tool.
This code is provided to show how to control the SparkFun
ProMicro's TX and RX LEDs within a sketch. It also serves
to explain the difference between Serial.print() and
Serial1.print().
*/
int RXLED = 17; // The RX LED has a defined Arduino pin
// Note: The TX LED was not so lucky, we'll need to use pre-defined
// macros (TXLED1, TXLED0) to control that.
// (We could use the same macros for the RX LED too -- RXLED1,
// and RXLED0.)
void setup()
{
pinMode(RXLED, OUTPUT); // Set RX LED as an output
// TX LED is set as an output behind the scenes
//Serial.begin(9600); //This pipes to the serial monitor
//Serial.println("Initialize Serial Monitor");
//delay(1000);
//Serial1.begin(9600); //This is the UART, pipes to sensors attached to board
//Serial1.println("Initialize Serial Hardware UART Pins");
//delay(1000);
}
void loop()
{
//Serial.println("Hello world!"); // Print "Hello World" to the Serial Monitor
//Serial1.println("Hello! Can anybody hear me?"); // Print "Hello!" over hardware UART
digitalWrite(RXLED, LOW); // set the RX LED ON
TXLED0; //TX LED is not tied to a normally controlled pin so a macro is needed, turn LED OFF
delay(1000); // wait for a second
digitalWrite(RXLED, HIGH); // set the RX LED OFF
TXLED1; //TX LED macro to turn LED ON
delay(1000); // wait for a second
}
The change made no difference. And paulvha, I read through your referenced forum entry. Unfortunately the symptoms there are different (and far worse). In that case the board wasn’t being recognized. The COM port wasn’t showing up at all. In my case the /dev device shows up just fine. Also, the upload works just fine. The problem as I mentioned is the “jump” (however it’s done) from the boot loader to the sketch. Something goes wrong with that and the sketch doesn’t run. However, when I power cycle the board, then it runs! So the upload is fine. (Searching the internet, I see plenty of cases where someone “bricked” the Pro Micro, or the board doesn’t show up at all, or uploads don’t work at all, etc. But I haven’t found a single case where the upload works but execution failed immediately afterwards, but is fixed by a power cycle.)
The other nasty problem I mentioned is how reset is handled. For me, doing a board reset causes the board to no longer be recognized. It falls off the USB device list. It also doesn’t run the sketch. But again, power cycling the board fixes the problem. It shows up in the USB device list and runs the sketch.
The reset problem is what’s really bothering me. I can see the boot loader somehow failing to “jump” to the sketch. But the IDE resets the board! So how is a manual reset not working? I realize the reset the IDE is doing is through USB whereas I’m doing it by grounding the RST pin. But still. The behavior makes me feel like I have a defective board. But I’m not giving up yet.
The other thing I’ve wondered is if I have a corrupted boot loader. However, if that were true, I’d think something else would (severely) fail, and not just the final “jump” to the sketch. Also, what gives with the board reset? That also could be a bad boot loader, but why would a reset via USB work but a reset via the RST pin not? And that’d mean there were not one but two very targeted failures of the boot loader.
edit: Ah. As for the reset behavior, probably what’s happening there is the boot loader resets, sees that there’s nothing else for it to do, and tries to “jump” to the sketch and fails. So the problems are likely the same. But with that said, why would reseting the board (or uploading a sketch) cause the sketch to fail to run, but power cycling the board (which also resets the boot loader I’d think) work properly?](Pro Micro & Fio V3 Hookup Guide - SparkFun Learn)