diff --git a/.vscode/tasks.json b/.vscode/tasks.json index fda87757b21a9c..8a2172f151b2b0 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -170,6 +170,30 @@ "${workspaceFolder}/src/test_driver/mbed/unit_tests/build" ] } + }, + { + "label": "Build specific EFR32 example", + "type": "shell", + "command": "scripts/run_in_build_env.sh", + "args": [ + "./scripts/build/build_examples.py --target efr32-${input:efr32Board}-${input:efr32App} build" + ], + "group": "build", + "problemMatcher": { + "base": "$gcc" + } + }, + { + "label": "Flash EFR32 board", + "type": "shell", + "command": "python3", + "args": [ + "${workspaceFolder}/out/efr32-${input:efr32Board}-${input:efr32App}/chip-efr32-*.flash.py" + ], + "group": "build", + "problemMatcher": { + "base": "$gcc" + } } ], "inputs": [ @@ -292,6 +316,35 @@ "telink-tlsr9518adk80d-light", "tizen-arm-light" ] + }, + { + "type": "pickString", + "id": "efr32App", + "description": "What mbed application do you want to use?", + "options": [ + "light", + "light-rpc", + "lock", + "unit-test", + "window-covering" + ], + "default": "light" + }, + { + "type": "pickString", + "id": "efr32Board", + "description": "What EFR32 board are you building for?", + "options": [ + "brd4161a", + "brd4163a", + "brd4164a", + "brd4166a", + "brd4170a", + "brd4186a", + "brd4187a", + "brd4304a" + ], + "default": "brd4161a" } ] } diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 7d5adf9c0f593f..0e28c3d61c113f 100644 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -146,20 +146,38 @@ def Esp32Targets(): def Efr32Targets(): - efr_target = Target('efr32-brd4161a', Efr32Builder, - board=Efr32Board.BRD4161A) + efr_target = Target('efr32', Efr32Builder) + + board_targets = [ + efr_target.Extend('brd4161a', board=Efr32Board.BRD4161A), + efr_target.Extend('brd4163a', board=Efr32Board.BRD4163A).GlobBlacklist( + 'only user requested'), + efr_target.Extend('brd4164a', board=Efr32Board.BRD4164A).GlobBlacklist( + 'only user requested'), + efr_target.Extend('brd4166a', board=Efr32Board.BRD4166A).GlobBlacklist( + 'only user requested'), + efr_target.Extend('brd4170a', board=Efr32Board.BRD4170A).GlobBlacklist( + 'only user requested'), + efr_target.Extend('brd4186a', board=Efr32Board.BRD4186A).GlobBlacklist( + 'only user requested'), + efr_target.Extend('brd4187a', board=Efr32Board.BRD4187A).GlobBlacklist( + 'only user requested'), + efr_target.Extend('brd4304a', board=Efr32Board.BRD4304A).GlobBlacklist( + 'only user requested') + ] - yield efr_target.Extend('window-covering', app=Efr32App.WINDOW_COVERING) - yield efr_target.Extend('unit-test', app=Efr32App.UNIT_TEST) + for board_target in board_targets: + yield board_target.Extend('window-covering', app=Efr32App.WINDOW_COVERING) + yield board_target.Extend('unit-test', app=Efr32App.UNIT_TEST) - rpc_aware_targets = [ - efr_target.Extend('light', app=Efr32App.LIGHT), - efr_target.Extend('lock', app=Efr32App.LOCK) - ] + rpc_aware_targets = [ + board_target.Extend('light', app=Efr32App.LIGHT), + board_target.Extend('lock', app=Efr32App.LOCK) + ] - for target in rpc_aware_targets: - yield target - yield target.Extend('rpc', enable_rpcs=True) + for target in rpc_aware_targets: + yield target + yield target.Extend('rpc', enable_rpcs=True) def NrfTargets(): diff --git a/scripts/build/builders/efr32.py b/scripts/build/builders/efr32.py index 4f90419291bb6c..437138f4d6b3de 100644 --- a/scripts/build/builders/efr32.py +++ b/scripts/build/builders/efr32.py @@ -67,10 +67,33 @@ def BuildRoot(self, root): class Efr32Board(Enum): BRD4161A = 1 + BRD4163A = 2 + BRD4164A = 3 + BRD4166A = 4 + BRD4170A = 5 + BRD4186A = 6 + BRD4187A = 7 + BRD4304A = 8 def GnArgName(self): if self == Efr32Board.BRD4161A: return 'BRD4161A' + elif self == Efr32Board.BRD4163A: + return 'BRD4163A' + elif self == Efr32Board.BRD4164A: + return 'BRD4164A' + elif self == Efr32Board.BRD4166A: + return 'BRD4166A' + elif self == Efr32Board.BRD4170A: + return 'BRD4170A' + elif self == Efr32Board.BRD4186A: + return 'BRD4186A' + elif self == Efr32Board.BRD4187A: + return 'BRD4187A' + elif self == Efr32Board.BRD4304A: + return 'BRD4304A' + else: + raise Exception('Unknown board #: %r' % self) class Efr32Builder(GnBuilder):