aboutsummaryrefslogtreecommitdiff
path: root/octedit/Makefile
diff options
context:
space:
mode:
authorJacques Comeaux <jacquesrcomeaux@protonmail.com>2024-07-01 12:16:02 -0500
committerJacques Comeaux <jacquesrcomeaux@protonmail.com>2024-07-01 12:16:02 -0500
commit83aef192e447c800cba6f4dbde8a450a4f8581a5 (patch)
treec5b21bb6238d9117057f3433d4122d66f4add9f8 /octedit/Makefile
parent4e018fc5bdd4ff9ee6065a5167fa291404e20576 (diff)
Use in-house CRC32 computation for boot sector
Diffstat (limited to 'octedit/Makefile')
-rw-r--r--octedit/Makefile13
1 files changed, 8 insertions, 5 deletions
diff --git a/octedit/Makefile b/octedit/Makefile
index 74ce9d4..cc3773d 100644
--- a/octedit/Makefile
+++ b/octedit/Makefile
@@ -15,20 +15,23 @@ octedit.uf2: octedit.bin
printf %220s | tr " " "\0" >> octedit.uf2 # 0 padding
echo -ne "\x30\x6F\xB1\x0A" >> octedit.uf2 # Magic end
-octedit.bin: octedit.elf
+octedit.bin: octedit.elf crc32
arm-none-eabi-objcopy -O binary octedit.elf octedit.bin
+ ./crc32 < octedit.bin >> octedit.bin
-objects = setup.o octedit.o uart.o crc.o
+crc32: crc32.c
+ gcc crc32.c -o crc32
-octedit.elf: $(objects)
+objects = setup.o octedit.o uart.o
+
+octedit.elf: $(objects) pico_persist.ld
arm-none-eabi-ld -T pico_persist.ld -o octedit.elf $(objects)
- ./checksum_pico_elf.py octedit.elf
$(objects): %.o: %.s
arm-none-eabi-as -o $@ $<
clean:
- rm octedit.elf octedit.bin octedit.uf2 *.o
+ rm octedit.elf octedit.bin octedit.uf2 *.o crc32
flash: octedit.uf2
[ -h /dev/disk/by-label/RPI-RP2 ] || sleep 3s