Remove application kludge to strip DFU of header.

Strip the header in in the Python SPI image generator, instead.
This commit is contained in:
Jared Boone 2015-08-25 15:11:22 -07:00
parent f7ced7a823
commit 4fe145b61d
2 changed files with 11 additions and 3 deletions

View File

@ -45,7 +45,7 @@ constexpr region_t bootstrap {
};
constexpr region_t hackrf {
.offset = 0x10010, // Image starts at 0x10 into .dfu file.
.offset = 0x10000,
.size = 0x8000,
};

View File

@ -36,6 +36,11 @@ def read_image(path):
f.close()
return data
def read_image_from_dfu(path):
data = read_image(path)
# Strip DFU header from file to get binary image.
return data[16:]
def write_image(data, path):
f = open(path, 'wb')
f.write(data)
@ -45,9 +50,12 @@ if len(sys.argv) != 6:
print(usage_message)
sys.exit(-1)
input_paths = sys.argv[1:5]
bootstrap_image = read_image(sys.argv[1])
hackrf_image = read_image_from_dfu(sys.argv[2])
baseband_image = read_image(sys.argv[3])
application_image = read_image(sys.argv[4])
output_path = sys.argv[5]
bootstrap_image, hackrf_image, baseband_image, application_image = map(read_image, input_paths)
spi_size = 1048576
images = (