Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

[ESP32] Add ESP-IDF 3.3 support #567

Merged
merged 2 commits into from
Jul 28, 2020
Merged

Conversation

erjiaqing
Copy link
Contributor

@erjiaqing erjiaqing commented Apr 28, 2020

This PR cherry picks f70c83b to master.

After patched ESP-IDF 3.2, these updates is required by ESP-IDF 3.3

  • Update component.mk to build libopenweave.a
    ESP-IDF 3.3 assumed that lib(componentname).a is built
  • dns_getserver now returns const ip_addr_t*

Testing this PR requires openweave/openweave-esp32-demo#14 and its lwip submodule should be checked out to openweave/openweave-esp32-lwip#2

Tested features:

  • Compiling
  • Connect via BLE
  • Network provisioning
    • WiFi
  • Pairing
  • reset-config from WDM
  • more tests pending

-- Removed reference to deprecated ESP AES function.

-- Changed logic around definition of LWIP_DNS_FOUND_CALLBACK_TYPE in DNSResolver code.

Previously, the logic surrounding the definition of LWIP_DNS_FOUND_CALLBACK_TYPE was written
with the presumption that the define existed in later versions of LwIP, and therefore only
needed to be declared in versions < 2.  However LWIP_DNS_FOUND_CALLBACK_TYPE has *never*
been a feature of stock LwIP.  Rather, it appears to be a Nest-ism intruduced in an internal
fork of LwIP. This change corrects the definition logic such that DNSResolver works with
the LwIP version included in ESP-IDF 3.2.

-- Ignore -Wdeprecated-declarations warnings when calling esp_wifi_get/set_auto_connect().

Later versions of ESP-IDF mark esp_wifi_get_auto_connect() and esp_wifi_set_auto_connect()
as depricated, leading to compilation errors.  Unfortunately, no obvious alternative exists,
and the comments and commit message provide no guidence.  A inquiry has been made to the
Expressif team.  Pending their answer, the decision has been made to continue using the
existing APIs.

# Always remove archives after built, the timestamp of the archive might not change
# sometimes if not do so, then the image built will using outdated code.
$(OUTPUT_DIR)/libopenweave.a : $(OPENWEAVE_STATIC_ARCHIVES)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make libopenweave.a depend on the input libraries directly so that it is only updated when one of the inputs changes. As part of this, you can eliminate the use of the .d directories entirely and extract the contents of the input libraries into a temporary directory directly within this rule.

Note that there is a separate bug that causes the timestamps of the input libraries to change on every build, which results in the application being rebuilt every time. This will be fixed later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to rewrite this in the new commit, PTAL.

@erjiaqing erjiaqing force-pushed the esp-3.3 branch 2 times, most recently from 8c1efca to 492d0b5 Compare May 7, 2020 05:04
@erjiaqing erjiaqing requested a review from jaylogue May 12, 2020 03:50
@erjiaqing erjiaqing force-pushed the esp-3.3 branch 2 times, most recently from f5b1cc6 to 4cb37fa Compare May 26, 2020 05:47
@erjiaqing
Copy link
Contributor Author

I have added some compile time checks to let CI with esp-idf 3.0 happy, these can be removed if CI is upgraded to esp-idf 3.3

@erjiaqing erjiaqing changed the title [ESP32] Update to ESP-IDF 3.3 [ESP32] Add ESP-IDF 3.3 support May 26, 2020
@codecov-commenter
Copy link

codecov-commenter commented May 26, 2020

Codecov Report

Merging #567 into master will increase coverage by 15.76%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #567       +/-   ##
===========================================
+ Coverage   54.14%   69.90%   +15.76%     
===========================================
  Files         331      483      +152     
  Lines       57655    86731    +29076     
===========================================
+ Hits        31218    60632    +29414     
+ Misses      26437    26099      -338     
Impacted Files Coverage Δ
src/inet/DNSResolver.cpp 48.95% <ø> (+1.39%) ⬆️
src/test-apps/schema/nest/test/trait/TestETrait.h 55.55% <0.00%> (-44.45%) ⬇️
src/lib/profiles/time/WeaveTime.h 60.00% <0.00%> (-40.00%) ⬇️
...i/security-support/native/WeaveSecuritySupport.cpp 57.89% <0.00%> (-15.44%) ⬇️
src/lib/core/WeaveTLV.h 100.00% <0.00%> (ø)
src/test-apps/ToolCommon.h 100.00% <0.00%> (ø)
src/lib/core/WeaveTLVTypes.h 100.00% <0.00%> (ø)
src/lib/core/WeaveTLVReader.cpp 94.86% <0.00%> (ø)
src/lib/core/WeaveTLVWriter.cpp 92.95% <0.00%> (ø)
src/lib/profiles/common/WeaveMessage.h 100.00% <0.00%> (ø)
... and 259 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 27503bf...6d89d76. Read the comment docs.

After patched ESP-IDF 3.2, these updates is required by ESP-IDF 3.3

- Update component.mk to build libopenweave.a
    ESP-IDF 3.3 assumed that lib(componentname).a is built
- dns_getserver now returns const ip_addr_t*

Change-Id: I74b37cfdb11a306a7a7e1b3a539d0031b112749b
@lanyuwen
Copy link

lanyuwen commented Jun 9, 2020

I have added some compile time checks to let CI with esp-idf 3.0 happy, these can be removed if CI is upgraded to esp-idf 3.3

I would suggest to focus on esp-idf 3.3 so that these compile time checks could be removed.

@erjiaqing
Copy link
Contributor Author

I have added some compile time checks to let CI with esp-idf 3.0 happy, these can be removed if CI is upgraded to esp-idf 3.3

I would suggest to focus on esp-idf 3.3 so that these compile time checks could be removed.

True, I would suggest create 3 prs

  1. Add esp-idf 3.3 support so both 3.0 and 3.3 can build
  2. Upgrade CI to esp-idf 3.3 (or even newer?)
  3. Drop esp-idf 3.0 support

@lanyuwen
Copy link

I have added some compile time checks to let CI with esp-idf 3.0 happy, these can be removed if CI is upgraded to esp-idf 3.3

I would suggest to focus on esp-idf 3.3 so that these compile time checks could be removed.

True, I would suggest create 3 prs

  1. Add esp-idf 3.3 support so both 3.0 and 3.3 can build
  2. Upgrade CI to esp-idf 3.3 (or even newer?)
  3. Drop esp-idf 3.0 support

I think we can simply move on to support esp-idf 3.3 directly. We don't have to make CI happy all the time - especially when we want to upgrade the toolchains.

@robszewczyk thoughts?

@kghost
Copy link
Contributor

kghost commented Jun 10, 2020

@erjiaqing Can you explain the detailed step to direct upgrade to esp-idf 3.3. How many repos and how many PRs are involved, are they all ready or not.

@erjiaqing
Copy link
Contributor Author

erjiaqing commented Jul 8, 2020

@robszewczyk PTAL, this PR won't break the master. and it has been ready for a long time, I'd like to merge this PR as soon as possible.

One concern is whether to use the ESP 3.3 macros, I guess we can submit a PRs to update the CI in esp32-demo and so we can remove these if needed.

@robszewczyk robszewczyk merged commit 262dcab into openweave:master Jul 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants