Skip to content

HardwareSerial freezes on Arduino Pro Micro / Mac OS #8260

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
iafan opened this issue Dec 2, 2018 · 7 comments
Closed

HardwareSerial freezes on Arduino Pro Micro / Mac OS #8260

iafan opened this issue Dec 2, 2018 · 7 comments

Comments

@iafan
Copy link

iafan commented Dec 2, 2018

I have Arduino Pro Micro connected via USB to my Mac (Mac OS Sierra 10.12.6). Arduino IDE is 1.8.7, and the board is identified there as "Board: SparkFun Pro Micro / Processor: ATmega32U4 5V/16 Mhz". Board info gives: "BN: Unknown board / VID: 1B4F / PID: 9206".

If I send to it more than 384 bytes of data at once, only 384 bytes will be displayed, and the board will freeze, freezing Arduino Serial Monitor as well (or screen) until I unplug the board from USB. While frozen, I can't upload new sketch to it either.

Here's the simplest code that I use:

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

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

So it reads the data at the fastest speed possible and just echoes it back. If I don't echo the data back, but just read it to empty the serial buffer, the problem still persists.

Once I upload this sketch to Arduino, I can either open the Serial Monitor, or use screen /dev/cu.usbmodem14121 9600 from the console. As I type on the keyboard in screen, or send entire strings via the Serial Monitor, the input will be echoed back. But If I copy a large block of text (more than 384 symbols) and paste that into the screen session or paste and send via Serial Monitor, only the first 384 symbols will be echoed back, and Arduino will freeze.

Rebooting the Mac doesn't help.

I noticed that if I force the serial speed to 1200bps (for example, by using screen /dev/cu.usbmodem14121 1200), then I will see no freezing. 2400bps and above results in the same freezing issue. I tested this on 3 different Arduino Pro Micro boards from different vendors, and all have the same issue. I used bare boards, with no external components attached to pins.

I understand that these boards connect USB directly to ATmega32U4 chip, so the problem seems to be either in the chip itself (less likely) or the USB drivers / HardwareSerial implementation in Arduino (more likely).

@facchinm
Copy link
Member

facchinm commented Dec 3, 2018

Hi @iafan ,
the Serial object exposed by boards based on 32u4 is USB based, so HardwareSerial is not involved. The code is here. Changing baud rate should not affect the CDC subsystem EXCEPT for 1200bps, which triggers a reboot to bootloader every time the port is opened with that baud.
So the problem is always reproducible. I'd move the issue to https://github.com/arduino/ArduinoCore-avr if it was possible. @per1234 any idea why there's no button to move it 😄 ?

@per1234
Copy link
Collaborator

per1234 commented Dec 3, 2018

I don't know why there's no transfer button. I don't see one either, but I assumed that was because I didn't have the necessary permission level in this repository. I'd assume you would. Maybe it's only available to repository Owners? That seems like an unnecessarily strict restriction.

There's another new feature that was released around the same time: Delete issue. I see that this feature must be enabled at the organization level. I wonder if the same applies to issue transfers but they forgot to document it?

I do have this button in my own repositories. The feature is in beta and I know sometimes GitHub does an opt-in for beta features but I don't remember whether I did that. I don't find any useful information on the help article for this topic or the one about permission levels.

@facchinm
Copy link
Member

facchinm commented Dec 3, 2018

@mastrolinux would you mind taking a look if these ⬆️ options are enabled at organization level?

@iafan
Copy link
Author

iafan commented Dec 3, 2018

@facchinm thanks for looking into this. I don't mind creating a duplicate ticket over at https://github.com/arduino/ArduinoCore-avr and closing this one. Let me know if you want me to do this.

@facchinm
Copy link
Member

facchinm commented Dec 4, 2018

@iafan I'll appreciate if you could move it manually there and close this one, thanks! 🙂

@iafan
Copy link
Author

iafan commented Dec 4, 2018

Done!

@iafan iafan closed this as completed Dec 4, 2018
@per1234
Copy link
Collaborator

per1234 commented May 30, 2019

@mastrolinux would you mind taking a look if these ⬆️ options are enabled at organization level?

It turns out that GitHub's issue transfer feature was previously only available to those who had admin permissions in both repositories (though this restriction was not documented). Happily, GitHub changed it today so that you only need write permissions in the repositories:
https://github.blog/changelog/2019-05-29-improvements-to-issue-transfer-permissions/
So I now have a "Transfer issue" option in this repository's issues.

The restriction of only being able to transfer issues between repositories within an organization still applies (#8245).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants