diff --git a/firmware/Makefile b/firmware/Makefile index 54705d1c..5e89d2ab 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -25,7 +25,7 @@ PATH_BASEBAND=baseband # TODO: Pass these (as #defines?) to Makefiles, use values in code. PAD_BOOTSTRAP=0x10000 -PAD_HACKRF_FIRMWARE=0x10000 +PAD_HACKRF_FIRMWARE=65536 PAD_BASEBAND=0x20000 TARGET=portapack-h1-firmware @@ -64,8 +64,8 @@ $(TARGET_BOOTSTRAP)_pad.bin: $(TARGET_BOOTSTRAP).elf $(TARGET_HACKRF_FIRMWARE)_dfu_pad.bin: $(TARGET_HACKRF_FIRMWARE).dfu # TODO: Not confident this is reliable. It certainly won't work on Windows. - cp $(TARGET_HACKRF_FIRMWARE).dfu $(TARGET_HACKRF_FIRMWARE)_dfu_pad.bin - dd if=/dev/null of=$(TARGET_HACKRF_FIRMWARE)_dfu_pad.bin bs=1 count=1 seek=$(PAD_HACKRF_FIRMWARE) + # Pad the .dfu with zeros, then truncate to the desired length. + head -c $(PAD_HACKRF_FIRMWARE) /dev/zero | cat $(TARGET_HACKRF_FIRMWARE).dfu - | head -c $(PAD_HACKRF_FIRMWARE) >$(TARGET_HACKRF_FIRMWARE)_dfu_pad.bin $(TARGET_BASEBAND)_pad.bin: $(TARGET_BASEBAND).elf $(CP) -O binary --pad-to $(PAD_BASEBAND) $(TARGET_BASEBAND).elf $(TARGET_BASEBAND)_pad.bin