Move certificates to separate, mmapped partition
This commit is contained in:
committed by
Sandeep Mistry
parent
a75b35c6f8
commit
a1fbf4b2ce
11
combine.py
11
combine.py
@@ -1,11 +1,12 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
booloaderData = open("build/bootloader/bootloader.bin", "rb").read()
|
||||
partitionData = open("build/partitions_singleapp.bin", "rb").read()
|
||||
partitionData = open("build/partitions.bin", "rb").read()
|
||||
appData = open("build/nina-fw.bin", "rb").read()
|
||||
certsData = open("data/roots.pem", "rb").read()
|
||||
|
||||
# calculate the output binary size, app offset
|
||||
outputSize = 0x10000 + len(appData)
|
||||
outputSize = 0x190000 + len(certsData) + 1
|
||||
if (outputSize % 1024):
|
||||
outputSize += 1024 - (outputSize % 1024)
|
||||
|
||||
@@ -22,6 +23,12 @@ for i in range(0, len(partitionData)):
|
||||
for i in range(0, len(appData)):
|
||||
outputData[0x10000 + i] = appData[i]
|
||||
|
||||
for i in range(0, len(certsData)):
|
||||
outputData[0x190000 + i] = certsData[i]
|
||||
|
||||
# zero terminate the pem file
|
||||
outputData[0x190000 + len(certsData)] = 0
|
||||
|
||||
# write out
|
||||
with open("NINA_W102.bin","w+b") as f:
|
||||
f.seek(0)
|
||||
|
||||
Reference in New Issue
Block a user