Due to high demand expect some shipping delays at this time, orders may not ship for 3-4 business days. On MLK Day no orders will be shipped.
0

Fetaher Sense (nRF52840) COM Port problem on Arduino IDE
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Fetaher Sense (nRF52840) COM Port problem on Arduino IDE

by MassimoManca on Sun Dec 05, 2021 1:14 pm

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.

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

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

by adafruit_support_carter on Mon Dec 06, 2021 2:06 pm

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

adafruit_support_carter
 
Posts: 22268
Joined: Tue Nov 29, 2016 2:45 pm

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

by MassimoManca on Tue Dec 07, 2021 7:25 am

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.

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

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

by Mr_Panda on Tue Dec 07, 2021 8:26 am

Code: Select all | TOGGLE FULL SIZE
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).

Mr_Panda
 
Posts: 4
Joined: Fri Sep 24, 2021 12:27 pm

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

by MassimoManca on Tue Dec 07, 2021 10:50 am

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.

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

Please be positive and constructive with your questions and comments.