diff --git a/Kconfig.zephyr b/Kconfig.zephyr index ee3281513a9054..3d41b8dce96fc1 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -462,6 +462,7 @@ config BUILD_OUTPUT_UF2_FAMILY_ID default "0xada52840" if SOC_NRF52840_QIAA default "0x4fb2d5bd" if SOC_SERIES_IMX_RT default "0x2abc77ec" if SOC_SERIES_LPC55XXX + default "0xe48bff56" if SOC_SERIES_RP2XXX default "0x68ed2b88" if SOC_SERIES_SAMD21 default "0x55114460" if SOC_SERIES_SAMD51 default "0x647824b6" if SOC_SERIES_STM32F0X diff --git a/boards/arm/rpi_pico/doc/index.rst b/boards/arm/rpi_pico/doc/index.rst index 6b3e8b64fe17cf..75f525275cd138 100644 --- a/boards/arm/rpi_pico/doc/index.rst +++ b/boards/arm/rpi_pico/doc/index.rst @@ -83,6 +83,15 @@ command (assuming JLink is used): $ openocd -f interface/jlink.cfg -c 'transport select swd' -f target/rp2040.cfg -c "adapter speed 2000" -c 'targets rp2040.core0' -c 'program path/to/zephyr.elf verify reset exit' +Using UF2 +--------- + +If you don't have an SWD adapter, you can flash the Raspberry Pi Pico with +a UF2 file. By default, building an app for this board will generate a +`build/zephyr/zephyr.uf2` file. If the Pico is powered on with the `BOOTSEL` +button pressed, it will appear on the host as a mass storage device. The +UF2 file should be drag-and-dropped to the device, which will flash the Pico. + Debugging ========= diff --git a/boards/arm/rpi_pico/rpi_pico_defconfig b/boards/arm/rpi_pico/rpi_pico_defconfig index f6f18d98214189..11cb1780ee8fc7 100644 --- a/boards/arm/rpi_pico/rpi_pico_defconfig +++ b/boards/arm/rpi_pico/rpi_pico_defconfig @@ -6,3 +6,4 @@ CONFIG_CONSOLE=y CONFIG_UART_CONSOLE=y CONFIG_GPIO=y CONFIG_USE_DT_CODE_PARTITION=y +CONFIG_BUILD_OUTPUT_UF2=y diff --git a/soc/arm/rpi_pico/rp2/Kconfig.defconfig.rp2040 b/soc/arm/rpi_pico/rp2/Kconfig.defconfig.rp2040 index a410181900c624..0470f2aaa69c13 100644 --- a/soc/arm/rpi_pico/rp2/Kconfig.defconfig.rp2040 +++ b/soc/arm/rpi_pico/rp2/Kconfig.defconfig.rp2040 @@ -6,3 +6,9 @@ config SOC default "rp2040" depends on SOC_RP2040 + +config BUILD_OUTPUT_UF2_USE_FLASH_BASE + default y if RP2_REQUIRES_SECOND_STAGE_BOOT + +config BUILD_OUTPUT_UF2_USE_FLASH_OFFSET + default y if !RP2_REQUIRES_SECOND_STAGE_BOOT