From 8af8941687c6441461330873310a592b3e6ef01a Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Thu, 30 Jul 2015 10:01:12 -0700 Subject: [PATCH] Use from-RAM DFU image, proper HackRF firmware padding. --- firmware/Makefile | 11 ++++++----- firmware/common/spi_image.hpp | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/firmware/Makefile b/firmware/Makefile index b65c470a..54705d1c 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -31,7 +31,7 @@ PAD_BASEBAND=0x20000 TARGET=portapack-h1-firmware TARGET_BOOTSTRAP=$(PATH_BOOTSTRAP)/bootstrap -TARGET_HACKRF_FIRMWARE=hackrf_one_usb_rom_to_ram +TARGET_HACKRF_FIRMWARE=hackrf_one_usb_ram TARGET_APPLICATION=$(PATH_APPLICATION)/build/application TARGET_BASEBAND=$(PATH_BASEBAND)/build/baseband @@ -56,15 +56,16 @@ program: $(TARGET).bin sleep 1s hackrf_spiflash -w $(TARGET).bin -$(TARGET).bin: $(TARGET_BOOTSTRAP)_pad.bin $(TARGET_HACKRF_FIRMWARE)_pad.bin $(TARGET_BASEBAND)_pad.bin $(TARGET_APPLICATION).bin - cat $(TARGET_BOOTSTRAP)_pad.bin $(TARGET_HACKRF_FIRMWARE)_pad.bin $(TARGET_BASEBAND)_pad.bin $(TARGET_APPLICATION).bin >$(TARGET).bin +$(TARGET).bin: $(TARGET_BOOTSTRAP)_pad.bin $(TARGET_HACKRF_FIRMWARE)_dfu_pad.bin $(TARGET_BASEBAND)_pad.bin $(TARGET_APPLICATION).bin + cat $(TARGET_BOOTSTRAP)_pad.bin $(TARGET_HACKRF_FIRMWARE)_dfu_pad.bin $(TARGET_BASEBAND)_pad.bin $(TARGET_APPLICATION).bin >$(TARGET).bin $(TARGET_BOOTSTRAP)_pad.bin: $(TARGET_BOOTSTRAP).elf $(CP) -O binary --pad-to $(PAD_BOOTSTRAP) $(TARGET_BOOTSTRAP).elf $(TARGET_BOOTSTRAP)_pad.bin -$(TARGET_HACKRF_FIRMWARE)_pad.bin: $(TARGET_HACKRF_FIRMWARE).bin +$(TARGET_HACKRF_FIRMWARE)_dfu_pad.bin: $(TARGET_HACKRF_FIRMWARE).dfu # TODO: Not confident this is reliable. It certainly won't work on Windows. - dd if=/dev/null of=$(TARGET_HACKRF_FIRMWARE)_pad.bin bs=1 count=1 seek=$(PAD_HACKRF_FIRMWARE) + 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) $(TARGET_BASEBAND)_pad.bin: $(TARGET_BASEBAND).elf $(CP) -O binary --pad-to $(PAD_BASEBAND) $(TARGET_BASEBAND).elf $(TARGET_BASEBAND)_pad.bin diff --git a/firmware/common/spi_image.hpp b/firmware/common/spi_image.hpp index afc5053b..e693d3e9 100644 --- a/firmware/common/spi_image.hpp +++ b/firmware/common/spi_image.hpp @@ -45,7 +45,7 @@ constexpr region_t bootstrap { }; constexpr region_t hackrf { - .offset = 0x10000, + .offset = 0x10010, // Image starts at 0x10 into .dfu file. .size = 0x8000, };