From ed7892c32247c1c2d96b8b0b0d0e765eec523d9b Mon Sep 17 00:00:00 2001 From: Michal Gorecki Date: Tue, 26 Nov 2024 11:01:46 +0100 Subject: [PATCH] builder: Add conditional flash map overrides in bsp.yml This allows to conditionally override flash maps in bsp.yml and target.yml with bsp.flash_map. Initial priority of bsp.yml and target.yml is preserved - if there is any bsp.flash_map definition in target.yml, all flash maps from bsp.yml are ignored. Default bsp.flash_map definition (without any condition) is still needed. --- newt/builder/targetbuild.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/newt/builder/targetbuild.go b/newt/builder/targetbuild.go index 26cf2ec6fa..b887450369 100644 --- a/newt/builder/targetbuild.go +++ b/newt/builder/targetbuild.go @@ -95,6 +95,14 @@ func NewTargetTester(target *target.Target, injectedSettings: cfgv.NewSettings(nil), } + if err := t.ensureResolved(); err != nil { + return nil, err + } + + if err := t.bspPkg.Reload(t.res.Cfg.SettingValues()); err != nil { + return nil, err + } + return t, nil }