mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-09 01:21:35 +08:00
scripts: Hotfix px_uploader.py to avoid PX4BL bug
Signed-off-by: Alex Mikhalev <alex@corvus-robotics.com>
This commit is contained in:
committed by
Silvan Fuhrer
parent
12a81979a8
commit
8267f4fd1e
@@ -136,8 +136,11 @@ class firmware(object):
|
||||
|
||||
self.image = bytearray(zlib.decompress(base64.b64decode(self.desc['image'])))
|
||||
|
||||
# pad image to 4-byte length
|
||||
while ((len(self.image) % 4) != 0):
|
||||
# PX4 bootloader in theory requires only 4-byte padding,
|
||||
# but a bug exists with the flash block caching where if the data
|
||||
# does not fill up the block, it will not be written (left as all 1s).
|
||||
# So pad up to the flash block size (8 words).
|
||||
while ((len(self.image) % (4 * 8)) != 0):
|
||||
self.image.extend(b'\xff')
|
||||
|
||||
def property(self, propname):
|
||||
|
||||
Reference in New Issue
Block a user