Hi folks, first time poster to these forums.
I recently purchased a Pimoroni Display Pack and a Pico RP2040 from the store and successfully compiled the demo code that Pimoroni have supplied. Thank you to whomever packaged that all up, the instructions were nice and clear.
I’ve been editing the Pico Display demo code just to learn the ecosystem and wanted to add a way to press the BOOTSEL button to trigger a reboot back into programming (USB Mass Storage) mode, so I can avoid repeated USB cable inserts and risk damaging the Micro-USB connector.
From the official Pico-SDK, there are two examples of how to separately read the BOOTSEL button and how to restart back into USB Mass Storage mode;
The BOOTSEL button reading code works fine, however when I try and
#include "hardware/flash.h" to access the
reset_usb_boot(..., ...); function I get an error saying this header file could not be found… yet I can see it sitting inside the Pico-SDK include folder (which the cmake process appears to be trying to pull in).
Any ideas how I can fix this please? Or is there a better known way to restart the Pico from within software?
Thanks in advance :)
I managed to get past that error by reading a little more closely into the source, in the same folder as
demo.cpp above there’s also
CMakeLists.txt, I spotted these lines…
# Pull in pico libraries that we need target_link_libraries(display pico_stdlib hardware_spi hardware_pwm hardware_dma pico_display)
hardware_flash to that list, now I get the following error…
demo.cpp:(.text.startup.main+0x76e): undefined reference to `rom_func_lookup(unsigned long)'