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

pico_stdin: Increase sleeping time for stdin read #575

Closed
wants to merge 1 commit into from

Conversation

pingiun
Copy link

@pingiun pingiun commented Sep 27, 2021

This solve an issue where USB serial seems to hang when using a function like getchar()

@lurch
Copy link
Contributor

lurch commented Sep 27, 2021

Can you rebase against the develop branch please? (we don't accept PRs to master)

This solve an issue where USB serial seems to hang when using a function like getchar()
@pingiun pingiun changed the base branch from master to develop September 28, 2021 12:24
@kilograham
Copy link
Contributor

can you provide an example where this hangs - how did you pick 10 rather than 1?

@pingiun
Copy link
Author

pingiun commented Oct 4, 2021

can you provide an example where this hangs - how did you pick 10 rather than 1?

I was running this code:

#include <stdio.h>
#include "pico/stdlib.h"

int main() {
    stdio_init_all();
    while (true) {
        char c = getchar();
        if (c == 'a') {
            printf("You sent a!\n");
        } else {
            printf("You did not send a!\n");
        }
    }
    return 0;
}

When I run this code on my pico with no other changes, it will not respond to any usb serial input. I changed it to 10, but maybe a lower value will also work, I didn't do much testing on different values

@kilograham kilograham self-assigned this Oct 4, 2021
@kilograham kilograham added this to the 1.2.1 milestone Oct 4, 2021
@kilograham
Copy link
Contributor

moving to 1.2.1 if i can reproduce

@kilograham kilograham marked this pull request as draft October 7, 2021 13:18
@kilograham
Copy link
Contributor

does it make a difference whether you start by physically resetting the Pico, reloading via SWD or dragging a UF2?
does it make a difference if the host side terminal is connected at the time?
what host OS/terminal are you using?

@kilograham kilograham modified the milestones: 1.3.0, 1.4.0 Oct 20, 2021
@kilograham
Copy link
Contributor

moving out of 1.3.0 as this isn't really reproducable (Seems to be the host stack getting into a bad state?)

see however https://forums.raspberrypi.com/viewtopic.php?f=145&t=321326

@kilograham
Copy link
Contributor

closing this in favor of issue #623

@kilograham kilograham closed this Oct 20, 2021
@lurch
Copy link
Contributor

lurch commented Jul 13, 2022

@pingiun see that latest comment in #623 . Would you like to test if #918 fixes things for you?

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

Successfully merging this pull request may close these issues.

3 participants