From 139c2061a8707d7e042134afb8b2fd6f5130b709 Mon Sep 17 00:00:00 2001 From: Deomid Ryabkov Date: Wed, 28 Nov 2018 19:44:11 +0000 Subject: [PATCH] Add create-fw-bundle command Replacement for fw_meta.py commands and also supports unbundling .hex files. General syntax is: ``` $ mos create-fw-bundle -o fw.zip part1:prop1=val1,prop2=val2,... part2:... ``` Example of building a mos fw bundle for ESP8266: ``` $ mos create-fw-bundle -o fw.zip --platform esp8266 --build-info=build_info.json \ boot:addr=0x0,src=rboot.bin,update=false \ boot_cfg:addr=0x7000,size=0x1000,fill=0xff \ fw:addr=0x100000,src=demo-c.bin \ fs:src=fs.bin,type=fs,addr=0x8000,fs_size=262144,fs_block_size=4096,fs_page_size=256,fs_erase_size=4096 ``` Example of converting a HEX file to a bundle: ``` $ mos create-fw-bundle -o fw.zip host:type=host,src=hostfw.hex ``` CL: mos: Add create-fw-bundle command PUBLISHED_FROM=35f52ea53e4b5900463415257323a4c08cf45deb --- src/common/platforms/stm32/flasher.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/platforms/stm32/flasher.go b/src/common/platforms/stm32/flasher.go index 8ddde035..36cbad11 100644 --- a/src/common/platforms/stm32/flasher.go +++ b/src/common/platforms/stm32/flasher.go @@ -11,7 +11,7 @@ import ( "time" "unsafe" - "cesanta.com/mos/flash/common" + "cesanta.com/common/go/fwbundle" "github.com/cesanta/errors" ) @@ -20,7 +20,7 @@ type FlashOpts struct { Timeout time.Duration } -func Flash(fw *common.FirmwareBundle, opts *FlashOpts) error { +func Flash(fw *fwbundle.FirmwareBundle, opts *FlashOpts) error { data, err := fw.GetPartData("boot") if err != nil { return errors.Annotatef(err, "invalid manifest")