-
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
ESP32 gn support #2325
Conversation
f421f55
to
53d6ef3
Compare
Shoud this be a draft while WIP or is it ready for review? |
src/platform/BUILD.gn
Outdated
"ESP32/SystemTimeSupport.cpp", | ||
"FreeRTOS/SystemTimeSupport.cpp", | ||
] | ||
# public_configs += [ "${chip_root}/src/crypto:crypto_config" ] |
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.
remove
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.
done
@@ -106,8 +106,10 @@ source_set("system_config_header") { | |||
|
|||
public_deps = [ ":system_buildconfig" ] | |||
|
|||
if (chip_system_config_use_lwip) { | |||
public_deps += [ "${chip_root}/src/lwip" ] | |||
if (target_cpu != "esp32") { |
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.
target_cpu -> current_cpu
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.
Can you move this condition inside src/lwip/BUILD.gn ? See e.g. third_party/mbedtls/BUILD.gn
if (chip_device_platform == "esp32") { | ||
defines += | ||
[ "BLE_PLATFORM_CONFIG_INCLUDE=${chip_ble_platform_config_include}" ] | ||
} |
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.
config/esp32/toolchain/BUILD.gn
Outdated
import("//build/toolchain/gcc_toolchain.gni") | ||
|
||
declare_args() { | ||
ar_ext = "" |
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.
If they're defined here, probably makes sense to name them something like
esp32_ar
esp32_cc
esp32_cxx
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.
fixed
config/esp32/toolchain/BUILD.gn
Outdated
|
||
toolchain_args = { | ||
current_os = "freertos" | ||
current_cpu = cpu_ext |
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.
Can this be "xtensa" ? The cpu variable is typically used to determine the architecture.
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.
I've been going back and forth on that myself. Finally I thought there is nothing 'xtensa' specific here, the toolchain is esp32-specific, the SDK is esp32-specific, so might as well call it 'esp32'. Thoughts? What typically goes into generic 'cpu' specific files?
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.
An important use case is writing assembly code. See e.g.
https://github.com/project-chip/connectedhomeip/blob/master/third_party/jlink/segger_rtt/RTT/BUILD.gn#L40
src/crypto/BUILD.gn
Outdated
|
||
# ESP32 has its own mbedTLS | ||
if (target_cpu != "esp32") { | ||
public_deps += [ "${mbedtls_root}:mbedtls" ] |
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.
Remove this and set the |mbedtls_target| argument.
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.
fixed
8d5525c
to
bc51c1c
Compare
Size increase report for "gn_nrf-example-build"
Full report output
|
Size increase report for "gn_linux-example-build"
Full report output
|
Size increase report for "gn_efr32-example-build"
Full report output
|
Size increase report for "nrfconnect-example-build"
Full report output
|
Size increase report for "esp32-example-build"
Full report output
|
This reverts commit 8b76957.
@woody-apple Everything is done, 2 notes:
|
Ok, so I made both of these builds works
I will flip the build to GN default in a follow-on PR (once I figure out what the documentation changes required to the example's README) For the 'restyler' issue, I am not able to view what it is complaining about, if it is about using |
FYI to whomever merges, there's a known issue that for edits to .workflows, we may need to force merge changes in (like this one). |
This used to work prior to project-chip#2325, which added an unconditional dependency on lwip even if we're using sockets. Make it conditional.
This used to work prior to project-chip#2325, which added an unconditional dependency on lwip even if we're using sockets. Make it conditional.
* Allow building CHIP without lwip checked out This used to work prior to #2325, which added an unconditional dependency on lwip even if we're using sockets. Make it conditional. * Fix typo
Problem
Add gn build for ESP32
Summary of Changes
fixes #1510