Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restyle Add VScode tasks to build and flash efr32 apps with selected boards. #12488

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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"
}
]
}
40 changes: 29 additions & 11 deletions scripts/build/build/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
23 changes: 23 additions & 0 deletions scripts/build/builders/efr32.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down