mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-01-07 23:27:39 +00:00
Remove application kludge to strip DFU of header.
Strip the header in in the Python SPI image generator, instead.
This commit is contained in:
parent
f7ced7a823
commit
4fe145b61d
@ -45,7 +45,7 @@ constexpr region_t bootstrap {
|
|||||||
};
|
};
|
||||||
|
|
||||||
constexpr region_t hackrf {
|
constexpr region_t hackrf {
|
||||||
.offset = 0x10010, // Image starts at 0x10 into .dfu file.
|
.offset = 0x10000,
|
||||||
.size = 0x8000,
|
.size = 0x8000,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -36,6 +36,11 @@ def read_image(path):
|
|||||||
f.close()
|
f.close()
|
||||||
return data
|
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):
|
def write_image(data, path):
|
||||||
f = open(path, 'wb')
|
f = open(path, 'wb')
|
||||||
f.write(data)
|
f.write(data)
|
||||||
@ -45,9 +50,12 @@ if len(sys.argv) != 6:
|
|||||||
print(usage_message)
|
print(usage_message)
|
||||||
sys.exit(-1)
|
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]
|
output_path = sys.argv[5]
|
||||||
bootstrap_image, hackrf_image, baseband_image, application_image = map(read_image, input_paths)
|
|
||||||
spi_size = 1048576
|
spi_size = 1048576
|
||||||
|
|
||||||
images = (
|
images = (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user