-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
ESP32 gn support #2325
Merged
Merged
ESP32 gn support #2325
Changes from 19 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
a43a0a8
Support external c/cc flags (as-is from rafal's PR)
kedars ba63884
Use external mbedtls (used as-is from Rafal's PR)
kedars 53d6ef3
ESP32: Enable gn support (first cut)
kedars 8b76957
Address tests
kedars 8fe0166
Incorporate review feedback
kedars b6ca383
Fix tests
kedars 0311aac
Oops, missed the output directory creation
kedars c971db5
Use 'mbedtls_target' for external mbedtls with ESP32
kedars f18dbb9
Add external lwip platform
kedars a314a60
Fix tests
kedars 8b2f0da
Fix tests - II
kedars c3b66a4
Fix tests - III
kedars 6464896
Fix tests - IV
kedars 03022d2
Fix tests - V
kedars eef2d25
restyle fixes
kedars f005571
Revert "Fix tests" based commits
kedars 40b537c
Revert "Address tests"
kedars cb14fd0
Both build systems
kedars 9a43217
ESP32 GN build in CI
kedars e36e955
restyle
c578d06
pass no args if is empty
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Copyright (c) 2020 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. | ||
|
||
name: Examples - GN | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
esp32: | ||
name: ESP32 | ||
|
||
env: | ||
BUILD_TYPE: esp32 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
container: | ||
image: connectedhomeip/chip-build-esp32:0.4.1 | ||
volumes: | ||
- "/tmp/bloat_reports:/tmp/bloat_reports" | ||
- "/tmp/output_binaries:/tmp/output_binaries" | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
# Fetch depth 0 to get all history and be able to check mergepoint for bloat report | ||
with: | ||
fetch-depth: 0 | ||
submodules: true | ||
- name: Build example Echo App | ||
run: scripts/examples/esp_echo_app.sh CHIP_BUILD_WITH_GN=y | ||
- name: Copy aside build products | ||
run: | | ||
mkdir -p example_binaries/$BUILD_TYPE-build | ||
cp examples/wifi-echo/server/esp32/build/chip-wifi-echo.elf \ | ||
example_binaries/$BUILD_TYPE-build/chip-wifi-echo.elf | ||
- name: Binary artifact suffix | ||
id: outsuffix | ||
uses: haya14busa/[email protected] | ||
with: | ||
cond: ${{ github.event.pull_request.number == '' }} | ||
if_true: "${{ github.sha }}" | ||
if_false: "pull-${{ github.event.pull_request.number }}" | ||
- name: Copy aside bloat report & binaries | ||
run: | | ||
cp -r example_binaries/$BUILD_TYPE-build /tmp/output_binaries/ | ||
- name: Uploading Binaries | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: | ||
${{ env.BUILD_TYPE }}-example-build-${{ | ||
steps.outsuffix.outputs.value }} | ||
path: /tmp/output_binaries/${{ env.BUILD_TYPE }}-build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright (c) 2020 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. | ||
|
||
# The location of the build configuration file. | ||
buildconfig = "//build/config/BUILDCONFIG.gn" | ||
|
||
# CHIP uses angle bracket includes. | ||
check_system_includes = true | ||
|
||
# Allow loading paths relative to //gn. | ||
secondary_source = "//third_party/connectedhomeip/gn/" | ||
|
||
default_args = { | ||
target_cpu = "esp32" | ||
target_os = "freertos" | ||
|
||
import("//args.gni") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Copyright (c) 2020 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. | ||
|
||
# Options from standalone-chip.mk that differ from configure defaults. These | ||
# options are used from examples/. | ||
|
||
import("//build_overrides/chip.gni") | ||
|
||
config("esp32_config") { | ||
defines = [] | ||
if (is_debug) { | ||
defines = [ "BUILD_RELEASE=0" ] | ||
} else { | ||
defines = [ "BUILD_RELEASE=1" ] | ||
} | ||
} | ||
|
||
group("esp32") { | ||
deps = [ "${chip_root}/src/lib" ] | ||
public_configs = [ ":esp32_config" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright (c) 2020 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. | ||
|
||
# Options from standalone-chip.mk that differ from configure defaults. These | ||
# options are used from examples/. | ||
|
||
#import("//build_overrides/chip.gni") | ||
|
||
chip_device_platform = "esp32" | ||
|
||
chip_project_config_include = "" | ||
chip_system_project_config_include = "" | ||
chip_ble_project_config_include = "" | ||
|
||
mbedtls_target = "//mbedtls:mbedtls" | ||
lwip_platform = "external" | ||
|
||
chip_build_tests = false | ||
chip_inet_config_enable_raw_endpoint = false | ||
chip_inet_config_enable_dns_resolver = false | ||
|
||
#Enabling this causes some error | ||
#chip_inet_config_enable_tun_endpoint = false | ||
chip_inet_config_enable_tcp_endpoint = true | ||
chip_inet_config_enable_udp_endpoint = true | ||
|
||
custom_toolchain = "//third_party/connectedhomeip/config/esp32/toolchain:esp32" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../examples/build_overrides |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright (c) 2020 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. | ||
|
||
# Options from standalone-chip.mk that differ from configure defaults. These | ||
# options are used from examples/. | ||
|
||
import("//build_overrides/chip.gni") | ||
|
||
# ESP32 has its own mbedtls, so nothing to do, just provide a target | ||
group("mbedtls") { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../.. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Copyright (c) 2020 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. | ||
|
||
import("//build_overrides/chip.gni") | ||
|
||
import("//build/toolchain/gcc_toolchain.gni") | ||
|
||
declare_args() { | ||
esp32_ar = "" | ||
esp32_cc = "" | ||
esp32_cxx = "" | ||
esp32_cpu = "" | ||
} | ||
|
||
gcc_toolchain("esp32") { | ||
ar = esp32_ar | ||
cc = esp32_cc | ||
cxx = esp32_cxx | ||
|
||
toolchain_args = { | ||
current_os = "freertos" | ||
current_cpu = esp32_cpu | ||
is_clang = false | ||
import("${chip_root}/src/platform/ESP32/args.gni") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright (c) 2020 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 contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this block intended to be added? It looks like BLE_PLATFORM_CONFIG_INCLUDE is set twice here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, the upper 'if' condition had a typo, fixed.