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

stdio_init_all() very slow in sdk 2.0 #1902

Open
liubinbj opened this issue Sep 4, 2024 · 6 comments
Open

stdio_init_all() very slow in sdk 2.0 #1902

liubinbj opened this issue Sep 4, 2024 · 6 comments

Comments

@liubinbj
Copy link

liubinbj commented Sep 4, 2024

in the old sdk 1.x , that function runs very fast, but in sdk 2.0 , it takes about 3s, it's funny. I guess it is a problem!

@peterharperuk
Copy link
Contributor

Is this to connect to usb or uart? Are you running one of the pico-examples?

@liubinbj
Copy link
Author

liubinbj commented Sep 4, 2024

Is this to connect to usb or uart? Are you running one of the pico-examples?

it connect to usb. not examples, but one of my projects.

pico_enable_stdio_usb(skydogge 1)
pico_enable_stdio_uart(skydogge 0)

the stdio_init_all() is first line in the main(), but it takes 3 seconds, if use sdk 1.x , it's very fast.

@peterharperuk
Copy link
Contributor

Have you set PICO_STDIO_USB_CONNECT_WAIT_TIMEOUT_MS to 3000? The pico-examples do this. If you have this set and you haven't connected USB it will wait 3s.

@liubinbj
Copy link
Author

liubinbj commented Sep 4, 2024

PICO_STDIO_USB_CONNECT_WAIT_TIMEOUT_MS

don't know that and not set that value, and then I set PICO_STDIO_USB_CONNECT_WAIT_TIMEOUT_MS=0 to test. still have 3s delay, with or without usb connection.

@arturo182
Copy link
Contributor

Probably best way to analyze would be to connect a debugger and stop execution during those 3s to see what the MCU doin.

@peterharperuk
Copy link
Contributor

Cannot reproduce. for me it takes about 0.5 ms. You'll have to attach an example that demonstrates the issue. The only reason it would take seconds is if it's waiting for usb to connect.

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