The official platform only supports the Arduino + Pico combination, and the Arduino core is the mbed-based one (GitHub - arduino/ArduinoCore-mbed) with a precompiled version of mbed-os and the variant code (for the Pico) under static settings. Since I don’t see PICO_XOSC_STARTUP_DELAY_MULTIPLIER
there, it will likely had its default value. Since the library is precompiled that means that setting that macro after the fact (with e.g. build_flags = -DPICO_XOSC_STARTUP_DELAY_MULTIPLIER=64
) does not have any effect since the sources that use this are not recompiled.
There exists an alternative Arduino core from Earle Philhower (Arduino-Pico), but it also uses a precompiled libpico.a
where the SDK is precompiled. However, there it looks easier to regenerate that library based with this script.
The easiest way to test your theory is to use PlatformIO with a different platform, namely https://github.com/Wiz-IO/wizio-pico/. It has direct Pico SDK support where it builds everything from source, and so you can easily play around with the flags.
As the wiki says, you should first install the platform, then create a new Pico + Arduino project as before, then overwrite the platformio.ini
to
[env:raspberry-pi-pico]
platform = wizio-pico
board = raspberry-pi-pico
framework = baremetal
; adjust COM port
monitor_port = COM1 ;[macOS] /dev/cu.usbmodem0000000000001 ;[Linux] ?
monitor_speed = 115200
build_flags =
-D LIB_PICO_STDIO_USB
-D PICO_XOSC_STARTUP_DELAY_MULTIPLIER=64
(see config options) and use this as src/main.c
(not main.cpp
)