Skip to content

Crashing when writing more than 64 bytes to Serial #85

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

Closed
tjpetz opened this issue Nov 6, 2020 · 8 comments
Closed

Crashing when writing more than 64 bytes to Serial #85

tjpetz opened this issue Nov 6, 2020 · 8 comments
Labels
bug Something isn't working nano33ble USBDevice

Comments

@tjpetz
Copy link

tjpetz commented Nov 6, 2020

Writing more than 64 bytes to Serial on the Nano 33 BLE Sense board causes the board to crash and to start blinking the LED in the SOS pattern.

The following code reproduces the problem. The execution of the line that writes 65 bytes (buff_65) will crash.

/**
 * Demonstrate the bug on Nano BLE board when attempting to write more than 64 bytes
 * in one shot to the serial port.
 */
 
void setup() {
  // put your setup code here, to run once:

  Serial.begin(115200);
  delay(3000);
  
  const char *buff_64 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890a";
  Serial.println(strlen(buff_64));
  Serial.println(buff_64);

  const char *buff_65 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890ab";
  Serial.println(strlen(buff_65));
  
  // This statement will cause the board to go into SOS mode.
  Serial.println(buff_65);

  Serial.println("If this line prints then the limit of 64 in a single shot is fixxed!");
  
}

void loop() {
  // put your main code here, to run repeatedly:

}
@sebromero
Copy link
Collaborator

I can confirm this with the BLE Sense. The Portenta doesn't that this issue.

@facchinm
Copy link
Member

Confirmed here too, working on a fix

facchinm added a commit to facchinm/ArduinoCore-mbed that referenced this issue Nov 16, 2020
@andbe-gh
Copy link

I've encountered the same problem. (see https://forum.arduino.cc/index.php?topic=713771.msg4796293#msg4796293)
The problem seems to happen only with the new 1.3 boardfiles. The old ones (1.1.6) are working.

@facchinm
Copy link
Member

It is indeed a problem with mbed 6.x ; this is the proposed fix facchinm@a885c58 , it would be nice if you could test it

@facchinm facchinm added bug Something isn't working nano33ble USBDevice labels Nov 16, 2020
@sebromero
Copy link
Collaborator

@facchinm LGTM. 👌

@andbe-gh
Copy link

@facchinm works for me, too.

@PaulZC
Copy link

PaulZC commented Nov 20, 2020

It works for me too - thank you @facchinm

@tjpetz
Copy link
Author

tjpetz commented Nov 20, 2020

It works for me too. Thanks @facchinm

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

No branches or pull requests

5 participants