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

Raspberry Pi Pico W #1

Closed
jorgechacblogspot opened this issue Aug 22, 2023 · 2 comments
Closed

Raspberry Pi Pico W #1

jorgechacblogspot opened this issue Aug 22, 2023 · 2 comments

Comments

@jorgechacblogspot
Copy link

earlephilhower/arduino-pico#1433 (comment)

"I hack/fixed the issue for myself by including these missing? files from Pico SDK 1.5 in my src folder... Im not sure if there is other code or libs missing - but this allows the above to compile and run and print to Terminal from the pico.

files: stdio_uart.h, stdio_usb.h, stdio.c, stdio_uart.c, stdio_usb.c, stdlib.c"

Hello OzmoOzmo, (sorry for asking here but there is no contact email in your github profile), to which specific paths should these files be copied?

@OzmoOzmo
Copy link
Owner

OzmoOzmo commented Sep 7, 2023

I put the c files (stdio.c, stdio_uart.c, stdio_usb.c, stdlib.c) into the lib folder for each project I was working on eg.

\Blink\lib\uartcomms\src\

and the header files (stdio_uart.h, stdio_usb.h ) here:
\Blink\lib\uartcomms\src\pico

Works well then - I can use the official Pico sdk - which was needed for my projects.

My Platformio looks like this:

[env:pico]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
framework = arduino
board_build.core = earlephilhower
board_build.filesystem_size = 0.5m
board = pico
upload_protocol = cmsis-dap
debug_tool = cmsis-dap
monitor_speed = 115200
build_flags =
-D PICO_STDIO_USB ; not needed unless running without debugger
-D PICO_STDIO_UART ; want real uart working as this is connected to picodebug
;-D DEBUG_RP2040_PORT=Serial

lib_deps = uartcomms ;important Ambroses library to fix print/uart issues
debug_speed = 5000

------sample c code:
#include <stdio.h>
#include "pico/stdlib.h"

#define LED_PIN 25
int main() {
stdio_init_all();
printf("Hello World...\n");
gpio_init(LED_PIN);
gpio_set_dir(LED_PIN, GPIO_OUT);
while (true) {
gpio_put(LED_PIN, 1);
sleep_ms(25);
gpio_put(LED_PIN, 0);
sleep_ms(25);
}
}

@jorgechacblogspot
Copy link
Author

OK thank you for answering.

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