From 648f97e0901ec0af7a3ae837ca14765a03415191 Mon Sep 17 00:00:00 2001 From: Andrea Gilardoni Date: Tue, 28 Jul 2026 12:52:26 +0200 Subject: [PATCH] tools: ota: produce loader + sketch only bundle Add the possibility to produce an artifact that is compatible with arduino-cloud-cli for ota, which is made of loader + ff padding + sketch, without the ota header and not compressed --- tools/zephyr-sketch-tool/ota.go | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tools/zephyr-sketch-tool/ota.go b/tools/zephyr-sketch-tool/ota.go index 860a92de7..f1a331bd7 100644 --- a/tools/zephyr-sketch-tool/ota.go +++ b/tools/zephyr-sketch-tool/ota.go @@ -78,17 +78,24 @@ func runOTA(loaderPath, sketchPath, offsetStr, magicStr, outputBase string) erro suffix string payload []byte compress bool + header bool label string }{ - {".ota", sketch, false, "sketch"}, - {".lzss.ota", sketch, true, "sketch (LZSS)"}, - {"-bundle.ota", merged, false, "loader+sketch"}, - {"-bundle.lzss.ota", merged, true, "loader+sketch (LZSS)"}, + {".ota", sketch, false, true, "sketch"}, + {".lzss.ota", sketch, true, true, "sketch (LZSS)"}, + {"-bundle.bin", merged, false, false, "loader+sketch"}, + {"-bundle.ota", merged, false, true, "loader+sketch"}, + {"-bundle.lzss.ota", merged, true, true, "loader+sketch (LZSS)"}, } for _, v := range variants { path := base + v.suffix - out := buildOTA(uint32(magic), v.payload, v.compress) + + out := v.payload + if v.header { + out = buildOTA(uint32(magic), v.payload, v.compress) + } + if err := os.WriteFile(path, out, 0644); err != nil { return fmt.Errorf("write %s: %w", path, err) }