@@ -231,8 +231,9 @@ SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE))
231
231
SRC_COMMON_HAL_SHARED_MODULE_EXPANDED = $(sort $(SRC_COMMON_HAL_EXPANDED ) $(SRC_SHARED_MODULE_EXPANDED ) )
232
232
233
233
SRC_S = supervisor/$(CHIP_FAMILY ) _cpu.s
234
- SRC_S_UPPER = bs2_default_padded_checksummed.S \
235
- sdk/src/rp2_common/hardware_divider/divider.S \
234
+ BOOT2_S_UPPER ?= sdk/src/rp2_common/boot_stage2/boot2_generic_03h.S
235
+ BOOT2_S_CFLAGS ?= -DPICO_FLASH_SPI_CLKDIV=2
236
+ SRC_S_UPPER = sdk/src/rp2_common/hardware_divider/divider.S \
236
237
sdk/src/rp2_common/hardware_irq/irq_handler_chain.S \
237
238
sdk/src/rp2_common/pico_bit_ops/bit_ops_aeabi.S \
238
239
sdk/src/rp2_common/pico_double/double_aeabi.S \
@@ -253,7 +254,23 @@ endif
253
254
OBJ += $(addprefix $(BUILD ) /, $(SRC_S:.s=.o ) )
254
255
OBJ += $(addprefix $(BUILD ) /, $(SRC_S_UPPER:.S=.o ) )
255
256
OBJ += $(addprefix $(BUILD ) /, $(SRC_MOD:.c=.o ) )
257
+ OBJ += $(BUILD ) /boot2_padded_checksummed.o
256
258
259
+ $(BUILD ) /boot2_padded_checksummed.o : $(BUILD ) /boot2_padded_checksummed.S
260
+ $(STEPECHO ) " CC $<"
261
+ $(Q )$(CC ) $(CFLAGS ) -c -o $@ $<
262
+
263
+ $(BUILD ) /boot2_padded_checksummed.S : $(BUILD ) /boot2.bin
264
+ $(STEPECHO ) " PAD_CHECKSUM $<"
265
+ $(Q )$(PYTHON3 ) sdk/src/rp2_common/boot_stage2/pad_checksum -s 0xffffffff $< $@
266
+
267
+ $(BUILD ) /boot2.bin : $(BUILD ) /boot2.elf
268
+ $(STEPECHO ) " OBJCOPY $<"
269
+ $(Q )$(OBJCOPY ) -O binary $< $@
270
+
271
+ $(BUILD ) /boot2.elf : $(BOOT2_S_UPPER ) | $(BUILD ) /
272
+ $(STEPECHO ) " BOOT $<"
273
+ $(Q )$(CC ) $(CFLAGS ) $(BOOT2_S_CFLAGS ) -Isdk/src/rp2_common/boot_stage2/asminclude --specs=nosys.specs -nostartfiles -Wl,-T,sdk/src/rp2_common/boot_stage2/boot_stage2.ld -o $@ $<
257
274
258
275
SRC_QSTR += $(SRC_C ) $(SRC_SUPERVISOR ) $(SRC_COMMON_HAL_EXPANDED ) $(SRC_SHARED_MODULE_EXPANDED )
259
276
0 commit comments