Skip to content

Commit 3f00c4a

Browse files
galexitexiaoxiang781216
authored andcommitted
rp2040: support pico-sdk 2.0.0
Since the introduction of the rp2350, the pico-sdk project has been re-arranged and elf2uf2 has been merged in to a new 'picotool' binary which is supplied and installed separately.
1 parent 5f0230d commit 3f00c4a

File tree

3 files changed

+11
-44
lines changed

3 files changed

+11
-44
lines changed

arch/arm/src/rp2040/boot2/Make.defs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ BOOT_STAGE2 = rp2040_boot_stage2
2424

2525
CONFIG_RP2040_FLASH_CHIP := $(patsubst "%",%,$(strip $(CONFIG_RP2040_FLASH_CHIP)))
2626

27-
BOOT2DIR = $(PICO_SDK_PATH)/src/rp2_common/boot_stage2
27+
BOOT2DIR = $(PICO_SDK_PATH)/src/rp2040/boot_stage2
2828
BOOT2SRC = $(BOOT2DIR)/boot2_$(CONFIG_RP2040_FLASH_CHIP).S
2929

3030
BOOT2CFLAGS += -DPICO_BOARD=\"pico\"
@@ -35,9 +35,12 @@ BOOT2CFLAGS += -Ichip/boot2
3535
BOOT2CFLAGS += -I$(BOOT2DIR)/asminclude
3636
BOOT2CFLAGS += -I$(PICO_SDK_PATH)/src/rp2040/hardware_regs/include
3737
BOOT2CFLAGS += -I$(PICO_SDK_PATH)/src/rp2_common/hardware_base/include
38-
BOOT2CFLAGS += -I$(PICO_SDK_PATH)/src/common/pico_base/include
38+
BOOT2CFLAGS += -I$(PICO_SDK_PATH)/src/common/pico_base_headers/include
3939
BOOT2CFLAGS += -I$(PICO_SDK_PATH)/src/boards/include
40-
BOOT2CFLAGS += -I$(PICO_SDK_PATH)/src/rp2_common/pico_platform/include
40+
BOOT2CFLAGS += -I$(PICO_SDK_PATH)/src/rp2040/pico_platform/include
41+
BOOT2CFLAGS += -I$(PICO_SDK_PATH)/src/rp2_common/pico_platform_compiler/include
42+
BOOT2CFLAGS += -I$(PICO_SDK_PATH)/src/rp2_common/pico_platform_sections/include
43+
BOOT2CFLAGS += -I$(PICO_SDK_PATH)/src/rp2_common/pico_platform_panic/include
4144

4245
$(BOOT_STAGE2).S: %.S: %.bin
4346
python3 $(BOOT2DIR)/pad_checksum -s 0xffffffff $< $@
@@ -46,10 +49,10 @@ $(BOOT_STAGE2).bin: %.bin: %.elf
4649
$(OBJCOPY) -Obinary $< $@
4750

4851
$(BOOT_STAGE2).elf: $(BOOT2SRC)
49-
$(Q) touch $(PICO_SDK_PATH)/src/common/pico_base/include/pico/version.h
50-
$(Q) touch $(PICO_SDK_PATH)/src/common/pico_base/include/pico/config_autogen.h
52+
$(Q) touch $(PICO_SDK_PATH)/src/common/pico_base_headers/include/pico/version.h
53+
$(Q) touch $(PICO_SDK_PATH)/src/common/pico_base_headers/include/pico/config_autogen.h
5154
$(CC) -nostdlib -T$(ARCHSCRIPT) $(BOOT2CFLAGS) -o $@ $<
52-
$(DELFILE) $(PICO_SDK_PATH)/src/common/pico_base/include/pico/version.h
53-
$(DELFILE) $(PICO_SDK_PATH)/src/common/pico_base/include/pico/config_autogen.h
55+
$(DELFILE) $(PICO_SDK_PATH)/src/common/pico_base_headers/include/pico/version.h
56+
$(DELFILE) $(PICO_SDK_PATH)/src/common/pico_base_headers/include/pico/config_autogen.h
5457

5558
EXTRADELFILE = $(BOOT_STAGE2).*

tools/rp2040/Config.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ ifdef PICO_SDK_PATH
2929
define POSTBUILD
3030
$(Q)echo "Generating: nuttx.uf2"; \
3131

32-
+$(Q) $(MAKE) -C $(TOPDIR)$(DELIM)tools$(DELIM)rp2040 -f Makefile.host
33-
tools$(DELIM)rp2040$(DELIM)elf2uf2$(HOSTEXEEXT) nuttx nuttx.uf2;
32+
picotool$(HOSTEXEEXT) uf2 convert --quiet -t elf nuttx nuttx.uf2;
3433
$(Q)([ $$? -eq 0 ] && echo nuttx.uf2 >> nuttx.manifest && echo "Done.")
3534
endef
3635
else

tools/rp2040/Makefile.host

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)