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

Confusion re building examples in pico-playground #50

Open
seamusdemora opened this issue Sep 20, 2024 · 5 comments
Open

Confusion re building examples in pico-playground #50

seamusdemora opened this issue Sep 20, 2024 · 5 comments

Comments

@seamusdemora
Copy link

seamusdemora commented Sep 20, 2024

Sorry to have to ask, but I've got some doubts about my approach:

I need to use the sleep and/or dormant mode for an off-grid Pico project. I plan to use a RV-3028 as the RTC/interrupt source due to its accuracy and low power consumption.

I planned on using the examples in pico-playground to get me started, but I may have "missed a beat" somewhere along the line:

$ cd ~/pico/pico-playground
$  mkdir build 
$ cd build
$ export PICO_SDK_PATH=../../pico-sdk              # don't know if this was needed or not 
$ cmake .. 
$ cd sleep/hello_sleep
$ make -j2 
 . . .
[100%] Built target hello_sleep 
$ 

So here's where I'm confused. I had to descend two levels below ./build - into sleep/hello_sleep to get things to work. This doesn't feel right...

Should I be copying hello_sleep into /home/pi/pico/examples/build?? - instead of trying to set up pico-playground as a stand-alone set of examples??

TIA!

@lurch
Copy link
Contributor

lurch commented Sep 20, 2024

So here's where I'm confused. I had to descend two levels below ./build - into sleep/hello_sleep to get things to work. This doesn't feel right...

IIRC this is exactly the same way that pico-examples works. Note that the examples in pico-examples need pico-sdk to be present (specified with PICO_SDK_PATH=...), but the examples in pico-playground may also need pico-extras to be present (specified with PICO_EXTRAS_PATH=...)

Should I be copying hello_sleep into /home/pi/pico/examples/build?? - instead of trying to set up pico-playground as a stand-alone set of examples??

You shouldn't be using the CMakeLists.txt from a pico-examples or pico-playground example for your own projects, as these are all tightly integrated with the top-level CMakeLists.txt in those repos.

To create your own project (independent from the pico-playground repo), see the "Manually Create your own Project" section in https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf

$ export PICO_SDK_PATH=../../pico-sdk # don't know if this was needed or not

If you're jumping around between different build directories, it's probably safer to set this to an absolute path, rather than a relative path.

@kilograham
Copy link
Contributor

So here's where I'm confused. I had to descend two levels below ./build - into sleep/hello_sleep to get things to work. This doesn't feel right...
$ make -j2

Make from the top-level builds everything in pico-playground by default

you could do

make -j2 hello_sleep

instead.

@seamusdemora

This comment was marked as abuse.

@lurch
Copy link
Contributor

lurch commented Sep 23, 2024

Looks like @kilograham has given you the fix for this in your other issue? raspberrypi/pico-feedback#415

@nathan-contino Do you think it's worth documenting how to use pico-extras in your own project in the getting-stared documentation? 🤔

EDIT: Ahhh, I've just seen that this is actually documented towards the bottom of https://github.com/raspberrypi/pico-extras/blob/master/README.md !

@seamusdemora

This comment was marked as abuse.

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