Hi! I’m trying to getC/C++ code working on the Pimoroni Explorer board, but I haven’t had any success so far.
MicroPython works perfectly, so the hardware seems fine. But for my project I need C/C++. I’ve tried multiple setups: using pico-sdk, pimoroni-pico, pico-examples, Arduino IDE, a Debug Probe, and going through available documentation, but none of it worked.
It seems that most tutorials and projects are targeted specifically at Pico boards, and Explorer (with RP2350 chip) isn’t officially listed. In some cases CMake asks to specify PICO_BOARD, but “explorer” is not among the available options. I tried building with all RP2350-based configurations I could find, but nothing succeeded.
Has anyone managed to get a working C/C++ setup for Pimoroni Explorer? Any pointers, minimal example, or configuration help would be greatly appreciated!
I was having trouble getting a basic c++ project to display on the included display of the explorer. I was finally able to get it to work by adding the compile definition PICO_PIO_USE_GPIO_BASE=1 to my CMakeLists file.
I think this is because the built in display uses GPIO 32-39 for the data bus but to access those pins with the generated PIO header could not access these pins. Setting PICO_PIO_USE_GPIO_BASE=1 allows it to access those pins. The full change to the CMakeLists.txt file was adding
Thanks for reply @matt1!
Unfortunately this also does not work for me. Maybe I am trying wrongly.
Have you used this device? https://shop.pimoroni.com/products/explorer
And which repositary do you run? Pico-sdk, pimoroni-pico or something else?
Also which board definition do you use? I have suspicion that none of them is for my board and that is reason why it goes bad.
It would be huge help if you send me some minimal functional example, if you have one. Thanks!
# Generated Cmake Pico project file
cmake_minimum_required(VERSION 3.13)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Initialise pico_sdk from installed location
# (note this can come from environment, CMake cache etc)
# == DO NOT EDIT THE FOLLOWING LINES for the Raspberry Pi Pico VS Code Extension to work ==
if(WIN32)
set(USERHOME $ENV{USERPROFILE})
else()
set(USERHOME $ENV{HOME})
endif()
set(sdkVersion 2.2.0)
set(toolchainVersion 14_2_Rel1)
set(picotoolVersion 2.2.0-a4)
set(picoVscode ${USERHOME}/.pico-sdk/cmake/pico-vscode.cmake)
if (EXISTS ${picoVscode})
include(${picoVscode})
endif()
# ====================================================================================
set(PICO_BOARD pico2 CACHE STRING "Board type")
# Pull in Raspberry Pi Pico SDK (must be before project)
include(pico_sdk_import.cmake)
project(example C CXX ASM)
# Initialise the Raspberry Pi Pico SDK
pico_sdk_init()
# Enable PIO support for the 5th bit of GPIO pins
add_compile_definitions(PICO_PIO_USE_GPIO_BASE=1)
add_executable(example main.cpp )
pico_set_program_name(example "example")
pico_set_program_version(example "0.1")
# Modify the below lines to enable/disable output over UART/USB
pico_enable_stdio_uart(example 0)
pico_enable_stdio_usb(example 1)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/libs/pimoroni-pico)
target_link_directories(
example
PRIVATE
${CMAKE_CURRENT_LIST_DIR}/libs/pimoroni-pico
)
# Add the standard library to the build
target_link_libraries(
example
pico_stdlib
pimoroni_bus
pico_graphics
st7789
)
target_include_directories(
example
PRIVATE
${CMAKE_CURRENT_LIST_DIR}/libs/pimoroni-pico
)
# Add the standard include files to the build
target_include_directories(example PRIVATE
${CMAKE_CURRENT_LIST_DIR}
)
pico_add_extra_outputs(example)