Fetaher Sense (nRF52840) COM Port problem on Arduino IDE

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
MassimoManca
 
Posts: 10
Joined: Mon May 27, 2019 9:32 am

Fetaher Sense (nRF52840) COM Port problem on Arduino IDE

Post by MassimoManca »

Hello guys, I want to understand if I am doing something wrong or if this is an error/malfunction.
I have a Feather Sense nRF52840, I am using both Eclipse + Sloeber plugin and Arduino 1.8.6 IDE. This is what happens using Arduino IDE.
1. I select and build an example: Adafruit nRF52 Librarises/hardware/hwinfo.ino
2. I put in boot mode the board pressing 2 times the RESET button, in this way COM28 appears.
3. I upload the sketch, after that COM28 disappears and COM25 appears (I did not change or disconnect the board).
4. I open the serial monitor on COM25 and, as expected, I see the output of the sketch.
5. I press the RESET button but I do not see any output on it.
6. I close the serial monitor.
7. I open TeraTerm on COM25 and press the RESET button, then as expected I see the ouput of the sketch.
So... seems that apart the 1st time no output is provided on serial monitor after any RESET but it is true that the sketch sends the output to COM25 as may be shown using TeraTerm.

User avatar
adafruit_support_carter
 
Posts: 29056
Joined: Tue Nov 29, 2016 2:45 pm

Re: Fetaher Sense (nRF52840) COM Port problem on Arduino IDE

Post by adafruit_support_carter »

When you press reset with the Serial Monitor open, it might be assigning a different COM port after the reset.

MassimoManca
 
Posts: 10
Joined: Mon May 27, 2019 9:32 am

Re: Fetaher Sense (nRF52840) COM Port problem on Arduino IDE

Post by MassimoManca »

Thanks, I found the problem. This board uses the USB port of the MCU so it needs some time to work:

Serial.begin(115200);
while(!Serial) {
;
}

solved the problem.

User avatar
hkayan
 
Posts: 17
Joined: Fri Sep 24, 2021 12:27 pm

Re: Fetaher Sense (nRF52840) COM Port problem on Arduino IDE

Post by hkayan »

Code: Select all

while(!Serial);
This will hang the device until you open your serial monitor if your device has a native USB port. Otherwise it will return True all the time and do nothing.

I did not understand what exactly you meant via
This board uses the USB port of the MCU so it needs some time to work
, but if that is the case, why not just use delay(ms).

MassimoManca
 
Posts: 10
Joined: Mon May 27, 2019 9:32 am

Re: Fetaher Sense (nRF52840) COM Port problem on Arduino IDE

Post by MassimoManca »

Yes, it is just the simplest possible workaround. At the moment it is used only as a debug/log serial communication channel that will be disabled in release mode so does not matter if it may hang the device. If I will have to use the USB port for a different purpose I will modify the loop to be time limited.

Locked
Please be positive and constructive with your questions and comments.

Return to “Feather - Adafruit's lightweight platform”