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

Add pico-sdk support #625

Merged
merged 3 commits into from
Oct 4, 2024
Merged

Add pico-sdk support #625

merged 3 commits into from
Oct 4, 2024

Conversation

Prime9999
Copy link
Contributor

Enable pico-sdk (not arduino-pico) to use LovyanGFX with CMake.
See also: examples_for_picosdk/* .

@tobozo
Copy link
Collaborator

tobozo commented Oct 4, 2024

hi, thanks for your contribution 👍

fix esp-idf build

⚠️ apparent reason for esp-idf build failing: esp-idf doesn't find esp-idf.cmake file

CMake Error at /home/runner/work/LovyanGFX/LovyanGFX/CMakeLists.txt:3
  (include):
    include could not find requested file:
      boards.cmake/esp-idf.cmake

solution 1: bring back the esp-idf cmake block into the CMakeLists.txt file
solution 2: (although I'm not sure it'll work) prepend ${COMPONENT_DIR} to the include directive:

    include(${COMPONENT_DIR}/boards.cmake/esp-idf.cmake)

github CI test suite

an extra CI build profile (pico-baremetal?) should be created for this situation, so any incidence (such as esp-idf choking on CMakeLists.txt) can be detected early.

I'll take care of adding this new profile to the github workflows but I'll need additional info.

  • if using platformio then I'll need you to share your platformio.ini file so I can later add an extra entry to this file.
  • if not using platformio I'll need a description of the required steps (pico-sdk version, url, save path, compile command) to reproduce when building both i2c and spi examples.

code density

This PR creates two additional copies of party parrot data, which isn't optimal as it impacts the overall size of the library archive

using a lighter example and/or creating a shared main.cpp file is recommended.

@tobozo tobozo self-requested a review October 4, 2024 17:33
@tobozo
Copy link
Collaborator

tobozo commented Oct 4, 2024

all compilation tests succeeded, thanks again for your contribution ! 👍

leaving this here for posterity, this is the script I've used to test this PR locally:

export WORKSPACE=LovyanGFX/examples_for_picosdk
export PROJECTDIR=$WORKSPACE/i2c

export PICO_SDK_PATH="$(pwd)/pico-sdk"
export PICO_SDK_EXTRAS_PATH="$(pwd)/pico-extras"
export PICO_PLATFORM="rp2350"

git clone -b develop https://github.com/Prime9999/LovyanGFX
git clone -b master --depth 1 https://github.com/raspberrypi/pico-sdk
git clone -b master --depth 1 https://github.com/raspberrypi/pico-extras

cd pico-sdk
git submodule update --init
cd ..

cp $PICO_SDK_PATH/external/pico_sdk_import.cmake $WORKSPACE/pico_sdk_import.cmake
cp $PICO_SDK_EXTRAS_PATH/external/pico_extras_import.cmake $WORKSPACE/pico_extras_import_optional.cmake

cd $PROJECTDIR
ln -sv ../../../LovyanGFX LovyanGFX

mkdir -p build
cd build
cmake ..
make -j $(nproc)

@tobozo tobozo merged commit 2674b82 into lovyan03:develop Oct 4, 2024
98 checks passed
@tobozo tobozo removed their request for review October 4, 2024 19:59
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.

2 participants