Skip to content

Commit

Permalink
[Telink] Fix shell build and add shell target build to CI (#26787)
Browse files Browse the repository at this point in the history
* [telink] Fix shell build

* [Telink] Add Shell target build to CI

---------

Co-authored-by: Andrii Bilynskyi <[email protected]>
  • Loading branch information
s07641069 and andriy-bilynskyy authored May 24, 2023
1 parent ee147d2 commit 41b1d61
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 3 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/examples-telink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,18 @@ jobs:
- name: clean out build output
run: rm -rf ./out

- name: Build example Telink Lighting App with Shell
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-shell' build"
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
telink tlsr9518adk80d lighting-app-shell \
out/telink-tlsr9518adk80d-light-shell/zephyr/zephyr.elf \
/tmp/bloat_reports/
- name: clean out build output
run: rm -rf ./out

- name: Build example Telink Lighting App with Factory Data
run: |
./scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux
Expand Down
21 changes: 21 additions & 0 deletions examples/lighting-app/telink/shell.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# Copyright (c) 2023 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# This file should be used as a configuration overlay to enable Shell.

# Enable Shell support.
CONFIG_SHELL=y
CONFIG_CHIP_LIB_SHELL=y
1 change: 1 addition & 0 deletions scripts/build/build/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ def BuildTelinkTarget():
TargetPart('window-covering', app=TelinkApp.WINDOW_COVERING),
])

target.AppendModifier('shell', enable_shell=True)
target.AppendModifier('rpc', enable_rpcs=True)
target.AppendModifier('factory-data', enable_factory_data=True)

Expand Down
5 changes: 5 additions & 0 deletions scripts/build/builders/telink.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@ def __init__(self,
runner,
app: TelinkApp = TelinkApp,
board: TelinkBoard = TelinkBoard.TLSR9518ADK80D,
enable_shell: bool = False,
enable_rpcs: bool = False,
enable_factory_data: bool = False):
super(TelinkBuilder, self).__init__(root, runner)
self.app = app
self.board = board
self.enable_shell = enable_shell
self.enable_rpcs = enable_rpcs
self.enable_factory_data = enable_factory_data

Expand All @@ -140,6 +142,9 @@ def generate(self):
return

flags = []
if self.enable_shell:
flags.append("-DOVERLAY_CONFIG=shell.overlay")

if self.enable_rpcs:
flags.append("-DOVERLAY_CONFIG=rpc.overlay")

Expand Down
2 changes: 1 addition & 1 deletion scripts/build/testdata/all_targets_linux_x64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ nrf-{nrf5340dk,nrf52840dk,nrf52840dongle}-{all-clusters,all-clusters-minimal,loc
nrf-native-posix-64-tests
qpg-qpg6105-{lock,light,shell,persistent-storage}
tizen-arm-{all-clusters,all-clusters-minimal,chip-tool,light,tests}[-no-ble][-no-thread][-no-wifi][-asan][-ubsan]
telink-tlsr9518adk80d-{all-clusters,all-clusters-minimal,bridge,contact-sensor,light,light-switch,lock,ota-requestor,pump,pump-controller,temperature-measurement,thermostat,window-covering}[-rpc][-factory-data]
telink-tlsr9518adk80d-{all-clusters,all-clusters-minimal,bridge,contact-sensor,light,light-switch,lock,ota-requestor,pump,pump-controller,temperature-measurement,thermostat,window-covering}[-shell][-rpc][-factory-data]
openiotsdk-{shell,lock}
4 changes: 2 additions & 2 deletions src/lib/shell/MainLoopZephyr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ static int cmd_matter(const struct shell * shell, size_t argc, char ** argv)
chip::Shell::streamer_set_shell(shell);
return (Engine::Root().ExecCommand(argc - 1, argv + 1) == CHIP_NO_ERROR) ? 0 : -ENOEXEC;
}
#ifdef BOARD_TLSR9518ADK80D
#ifdef CONFIG_BOARD_TLSR9518ADK80D
static int RegisterCommands(void)
#else
static int RegisterCommands(const struct device * dev)
#endif /* BOARD_TLSR9518ADK80D */
#endif /* CONFIG_BOARD_TLSR9518ADK80D */
{
Engine::Root().RegisterDefaultCommands();
return 0;
Expand Down

0 comments on commit 41b1d61

Please sign in to comment.