File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -227,7 +227,7 @@ async def run(self, args: argparse.Namespace):
227227 print ("Creating firmware" )
228228 firmware , metadata = await create_firmware (args .firmware , args .name )
229229
230- if metadata ["device-id" ] == HubKind .TECHNIC_LARGE :
230+ if metadata ["device-id" ] in ( HubKind .TECHNIC_SMALL , HubKind . TECHNIC_LARGE ) :
231231 from ..dfu import flash_dfu
232232
233233 flash_dfu (firmware , metadata )
Original file line number Diff line number Diff line change @@ -49,9 +49,16 @@ async def create_firmware(
4949 """
5050
5151 archive = zipfile .ZipFile (firmware_zip )
52+ metadata = json .load (archive .open ("firmware.metadata.json" ))
53+
54+ # For SPIKE Hubs, we can use the firmware without changes.
55+ if metadata ["device-id" ] in (HubKind .TECHNIC_SMALL , HubKind .TECHNIC_LARGE ):
56+ firmware = bytearray (archive .open ("firmware.bin" ).read ())
57+ return firmware , metadata
58+
59+ # For Powered Up hubs, we append a script and checksum to a base firmware.
5260 base = archive .open ("firmware-base.bin" ).read ()
5361 main_py = io .TextIOWrapper (archive .open ("main.py" ))
54- metadata = json .load (archive .open ("firmware.metadata.json" ))
5562
5663 mpy = await compile_file (
5764 save_script (main_py .read ()),
You can’t perform that action at this time.
0 commit comments