Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Serial interface locks up on Arduino Nano Matter on Mac #73

Open
technoblogy opened this issue Jul 11, 2024 · 7 comments
Open

[bug] Serial interface locks up on Arduino Nano Matter on Mac #73

technoblogy opened this issue Jul 11, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@technoblogy
Copy link

technoblogy commented Jul 11, 2024

Hardware

Arduino Nano Matter

Core version

2.0.0

Arduino IDE version

2.3.2

Operating system

macOS Catalina 10.15.7

Radio stack variant

Matter

OpenThread Border Router device (if using Matter)

N/A

Issue description

In some situations the Serial interface locks up on the Arduino Nano Matter, making further serial communication impossible until the board is reset.

I can demonstrate this in two different situations. These may have the same cause, or there may be two different problems:

Entering text into the Serial Monitor causes the Serial to hang up after about 384 characters.

Run the following sketch:

void setup() {  
  Serial.begin(9600);
}

int Count = 0;

void loop (void) {
  if (Serial.available()) {
    Serial.read(); Count++;
    if (Count % 64 == 0) Serial.println(Count);
  }
}

Then cut and paste all the following text (total 512 characters) into the Serial Monitor input field, and press Return:

$0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
$0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
$0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
$0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
$0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
$0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
$0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
$0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ

The Serial Monitor prints:

64
128
192
256
320
384

ie it hangs up after 384 characters and doesn't reach 512.

Once it hangs up the Serial is totally unresponsive, and the only solution seems to be to reset the processor.

This test works fine on all other Arduino boards I've tested.

Entering a string of exactly 63 characters into the Serial monitor causes it to lock up.

Install this program:

void setup() { 
Serial.begin(9600);
}

void loop (void) {
if (Serial.available()) Serial.write(Serial.read());
}

Repeatedly copy and paste this string of 63 characters into the Serial Monitor, and press Return:

0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ&

After the first attempt the Serial Monitor locks up and becomes unresponsive.

I have verified that the issue doesn't occur on Windows 10.

I have previously reported a similar issue on the RP2040: arduino/ArduinoCore-mbed#193

Serial output

See above.

RTT output (if using Matter)

N/A

Minimal reproducer code

See above.

@leonardocavagnis
Copy link
Contributor

Dear @technoblogy,
thanks for report!
Do you encounter the same issue when using an external serial terminal (as screen, CoolTerm, ...)?

@technoblogy
Copy link
Author

I've tested it with screen, and same result:

Screen Shot 2024-07-15 at 09 55 06

@leonardocavagnis
Copy link
Contributor

I tested on my macOS Sonoma 14.5 and I encountered the same issue.
Unlike you, it hangs up after the first 64 chars. After many attempts, I found out that issue occurs only if you send exactly 64 chars or a multiple of it (128, 192, ...) and only on macOS.

Thanks for check it and for your detailed report!
I'm working on resolving it.

@technoblogy
Copy link
Author

@leonardocavagnis any news about this?

I'd be happy to test a preliminary fix when you have one available.

@leonardocavagnis
Copy link
Contributor

@technoblogy Unfortunately, it seems a bug of MacOS system. I'm investigating on it, I will be back to you if I find out something.

@technoblogy
Copy link
Author

technoblogy commented Aug 2, 2024

Unfortunately, it seems a bug of MacOS system.

I don't see how that can be possible. I've tested my application with a variety of other boards on MacOS and the problem doesn't occur with any of them. For examples of the boards that work see:

uLisp - Performance

@technoblogy
Copy link
Author

@leonardocavagnis Any success with solving this? I'd love to make my Lisp system, uLisp, available on the Arduino Nano Matter, and this is the only remaining issue I need to resolve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants