Skip to content

Commit

Permalink
lib: Move lib/rp2040/elf2uf2 to lib/elf2uf2
Browse files Browse the repository at this point in the history
Recent versions of the rp2040 sdk no longer contain the elf2uf2 tool.
So, move that code to a new dedicated directory.  This is in
preparation for updating the rp2040 sdk version.

Signed-off-by: Kevin O'Connor <[email protected]>
  • Loading branch information
KevinOConnor committed Nov 13, 2024
1 parent c88ee84 commit 9f328ca
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions lib/README
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ version 1.2.0 (bfcbefafc5d2a210551a4d9d80b4303d4ae0adf7). It has been
modified so that it can build outside of the pico sdk. See
rp2040.patch for the modifications.

The elf2uf2 directory contains code from the pico sdk:
https://github.com/raspberrypi/pico-sdk.git
version 1.2.0 (bfcbefafc5d2a210551a4d9d80b4303d4ae0adf7). Contents
taken from the tools/elf2uf2/ directory.

The rp2040_flash directory contains a light-weight bootsel flash tool.
It uses C part of the the `picoboot_connection` directory found in:
https://github.com/raspberrypi/picotool.git
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions src/rp2040/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Setup the toolchain
CROSS_PREFIX=arm-none-eabi-

dirs-y += src/rp2040 src/generic lib/rp2040/elf2uf2 lib/fast-hash lib/can2040
dirs-y += src/rp2040 src/generic lib/elf2uf2 lib/fast-hash lib/can2040

CFLAGS += -mcpu=cortex-m0plus -mthumb -Ilib/cmsis-core
CFLAGS += -Ilib/rp2040 -Ilib/rp2040/cmsis_include -Ilib/fast-hash -Ilib/can2040
Expand Down Expand Up @@ -37,13 +37,13 @@ $(OUT)stage2.o: lib/rp2040/boot_stage2/$(STAGE2_FILE) $(OUT)autoconf.h
$(Q)$(CC) $(CFLAGS) -c $(OUT)stage2.S -o $(OUT)stage2.o

# Binary output file rules when using stage2
$(OUT)lib/rp2040/elf2uf2/elf2uf2: lib/rp2040/elf2uf2/main.cpp
$(OUT)lib/elf2uf2/elf2uf2: lib/elf2uf2/main.cpp
@echo " Building $@"
$(Q)g++ -g -O -Ilib/rp2040 $< -o $@

$(OUT)klipper.uf2: $(OUT)klipper.elf $(OUT)lib/rp2040/elf2uf2/elf2uf2
$(OUT)klipper.uf2: $(OUT)klipper.elf $(OUT)lib/elf2uf2/elf2uf2
@echo " Creating uf2 file $@"
$(Q)$(OUT)lib/rp2040/elf2uf2/elf2uf2 $< $@
$(Q)$(OUT)lib/elf2uf2/elf2uf2 $< $@

rptarget-$(CONFIG_RP2040_HAVE_STAGE2) := $(OUT)klipper.uf2
stage2-$(CONFIG_RP2040_HAVE_STAGE2) := $(OUT)stage2.o
Expand Down

0 comments on commit 9f328ca

Please sign in to comment.