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

setup_default_uart() error #1251

Closed
Dj-EKI opened this issue Mar 3, 2023 · 2 comments
Closed

setup_default_uart() error #1251

Dj-EKI opened this issue Mar 3, 2023 · 2 comments

Comments

@Dj-EKI
Copy link

Dj-EKI commented Mar 3, 2023

In both versions. 2.7.3 and 3.0.0
setup_default_uart();
Generates this error.

c:/users/reder/appdata/local/arduino15/packages/rp2040/tools/pqt-gcc/1.5.0-b-c7bab52/bin/../lib/gcc/arm-none-eabi/10.3.0/../../../../arm-none-eabi/bin/ld.exe: C:\Users\reder\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.0.0/lib/libpico.a(stdlib.c.obj): in function `setup_default_uart':
/home/earle/Arduino/hardware/pico/rp2040/pico-sdk/src/rp2_common/pico_stdlib/stdlib.c:94: undefined reference to `stdio_uart_init'
collect2.exe: error: ld returned 1 exit status

Maybe I'm using the function incorrectly. The sleep_run_from_xosc(); uses this function and produces the same error. sleep_run_from_xosc(); is from Pico-extras.

@earlephilhower
Copy link
Owner

You cannot call stdio_uart_init in this core. The Arduino Serial/Serial1/Serial2 ports already take control of the UART and USB.

Use Serial1 for UART0 and Serial2 for UART1. Serial is USB. Then Serial.printf("dddd"); will just work, no SDK stuff needed.

@earlephilhower
Copy link
Owner

One more thing, if you set the Tools->Debug Port->Serial/1/2, then plain printf() will go to that specific port (i.e. printf is not Arduino-like and normally only a debug thing).

earlephilhower added a commit that referenced this issue May 23, 2023
Warn the user that the Pico SDK STDIO calls (stdio_init_all, stdio_usb_init,
stdio_uart_init) are not supported or needed at compile time.  See multiple
issues #1433 #1347 #1273 #1251 and others.
earlephilhower added a commit that referenced this issue May 23, 2023
Warn the user that the Pico SDK STDIO calls (stdio_init_all, stdio_usb_init,
stdio_uart_init) are not supported or needed at compile time.  See multiple
issues #1433 #1347 #1273 #1251 and others.
earlephilhower added a commit that referenced this issue May 24, 2023
Warn the user that the Pico SDK STDIO calls (stdio_init_all, stdio_usb_init,
stdio_uart_init) are not supported or needed at compile time.  See multiple
issues #1433 #1347 #1273 #1251 and others.
earlephilhower added a commit that referenced this issue May 24, 2023
Warn the user that the Pico SDK STDIO calls (stdio_init_all, stdio_usb_init,
stdio_uart_init) are not supported or needed at compile time.  See multiple
issues #1433 #1347 #1273 #1251 and others.
earlephilhower added a commit that referenced this issue May 24, 2023
Warn the user that the Pico SDK STDIO calls (stdio_init_all, stdio_usb_init,
stdio_uart_init) are not supported or needed at compile time.  See multiple
issues #1433 #1347 #1273 #1251 and others.
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

2 participants