I recently got a PicoSystem and worked through the tutorial Getting started with PicoSystem and C++. I ran into a couple challenges along the way and thought I’d share how I resolved them in case others also encounter them.
Installed build-essential along with the listed libraries.
When running cmake on the PicoSystem SDK, added the following option (currently issue 4 on the PicoSystem SDK project):
cmake -DPICOSYSTEM_DIR:PATH=~/picosystem ..
Copied pico-sdk/external/pico_sdk_import.cmake to the project directory.
Added the following to the example project’s CMakeLists.txt:
# Pull in PICO SDK (must be before project)
include(pico_sdk_import.cmake)
find_package(PICOSYSTEM REQUIRED)
Used the above mentioned options when running cmake on the example project:
cmake -DPICOSYSTEM_DIR:PATH=~/picosystem ..
Added the following to the .cpp file:
using namespace picosystem;
Changed the function signature on the update method to:
void update(uint32_t tick) {
}
The above got me up and running the Hello World example, hope this helps others. Or, if other folks have figured out better approaches, interested in learning them.
I created a bit of a quick and dirty boilerplate to get people going here. Probably should only be used in the meantime until someone can come up with a better solution
With recent changes to the SDK, I was getting this error:
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld: CMakeFiles/ourproject.dir/home/vagrant/picosystem/libraries/picosystem.cpp.obj: in function `main':
picosystem.cpp:(.text.startup.main+0xd0): undefined reference to `draw(unsigned long)'
collect2: error: ld returned 1 exit status
And had to update the signature of the draw method to add a tick parameter like so: