-
Notifications
You must be signed in to change notification settings - Fork 834
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
Support for Espressif ESP-IDF v5 #5909
Comments
Hello @AchimPieters Thanks for sharing this issue. I have requested a review by the team. Kind regards, |
Hi @AchimPieters and thank you for your interest in using wolfSSL on the Espressif ESP32. I've tried your steps to reproduce this error and confirmed there's a problem. Thank you for reporting this. I noticed from the error message that you are trying to use ESP-IDF v5.0. At this time the wolfSSL Espressif examples are only for ESP-IDF v4.x. We have an open PR #5902 that may fix some of the breaking changes of the recent Espressif upgrade to v5. Do you have the option to use ESP-IDF 4.x? More work is needed to have full support for wolfSSL on the Espressif ESP-IDF v5. I've renamed this issue to reflect that objective. There's also a reference in the error message regarding x86 assembly. This is typically used for code performance optimization, but is not available on the Espressif Xtensa architecture at this time. The x86 asm should be disabled automatically when using It looks like you may have cloned (a rather old) wolfSSL into your project Let me know if these suggestions are helpful and what else we can do to help you get wolfSSL working in your project. |
@gojimmypi thank you for your reply! Tried to use ESP-IDF 4.x, unfortunately this gives a whole new scale of problems. Looking into the future, and the development of Home and Matter, the IDF 5 and up will become mainstream. Hope that you will support it soon. Al your provided information is really helpful, thank you for that! |
@AchimPieters let's see what we can do with the ESP-IDF v5 using a wolfSSL component install via the script and a known-good Please give that a try and we'll address any incompatibilities that may be encountered. |
@gojimmypi that would really be appreciated! I updated my repository with all your instructions and got this result: /project/components/common/wolfssl/wolfssl-5.5.3/wolfcrypt/src/aes_gcm_x86_asm.S: Assembler messages:
The strange thing is that you said: Reproduction stepsInstall docker |
It looks like your project is still trying to use wolfSSL in Upon install with the setup script, wolfSSL should end up in a directory called Also, I noticed that you included the same reproduction text steps that actually didn't work for me as-is, but might be problematic. Your |
I changed the file structure as you recommended. Reproduction stepsInstall docker |
I have an interim update for you. There's an open PR by @bandi13 that fixes some of the ESP-IDF v5 problems, but may need just a bit of fine tuning for the default ESP32 First: remove the existing wolfSSL: Remove (edit: I removed the above Fetch the @bandi13
from within docker, run the wolfSSL setup:
This gets us close to compiling. I saw a bunch of warnings about things being redefined (ok to ignore for now):
but then encountered some more serious errors in
Let's see if we can get your build to this state and address the errors and I'll look more at the warnings. |
@PaulMartinsen that's great news! I saw over on the VisualGDB forum that you also had some challenges with their update in VisualGDB. Glad to see you got everything working! There are more wolfSSL examples for the ESP32 that I want to test with ESP-IDF v5 before claiming this issue is fully resolved, so I will go ahead and leave it open for now. Let me know how things go with wolfSSL and if I can help in any way. |
@AchimPieters just checking in to see if you've been able to get wolfSSL working with your project? That's cool @PaulMartinsen was able to get it working, but I want to make your project is working as well. |
@gojimmypi will come back to that, too busy at the moment. |
@gojimmypi So that works! There are only a lot of Reproduction steps
|
@AchimPieters woohoo!! that's great news! Regarding the Is this proof-of-concept for a larger project? I'm interested in learning more. |
@gojimmypi Thank you for your swift reply! Regarding your question: We also have a Life Cycle Manager for the ESP modules developed by @HomeACcessoryKid there is the HomeACcessoryKid life-cycle-manager and the newest one for the ESP32 modules HomeACcessoryKid LCM4ESP32 We are a small group that develop this Repro, you are welcome to join or to collaborate! Btw. I added the wolfSSL master branch to my repro in the component's directory. Is there a way to run the |
@gojimmypi just checking in to see if you've been able to get the warnings out of the compiling part? |
Hello @AchimPieters - yes, I've recently been able to get my Espressif toolchain issues worked out. I finally have a fully functional ESP-IDF v4x and v5 working in both WSL and VisualGDB. I've not yet had a chance to test with your project but I did update a couple of wolfSSL examples: wolfSSL/wolfssl-examples#360 The examples build without warnings. I'm planning to take a look at your project this week. Let me know what you see with the latest version of wolfSSL. Regarding your question on not having to run the install for the Docker build: you could try moving the wolfSSL component from the shared directory in the ESP-IDF toolchain directory to instead the components directory in your project. (not both) |
@gojimmypi Update: Everything compiles as it should, except wolfssl the warnings. |
Hi @AchimPieters I'm still working on getting full support for ESP-IDF v5. Glad to hear that all is working, even with the warnings. I'll need to take a closer look as I don't see those warnings, but I'm also not using Docker. In the meantime, you may be interested in #6018. The CMakelists.txt probably just needs a little bit of modification to work with a project not in the wolfSSL repo. Specifically the |
@gojimmypi thank you for your reply! I would like to invite you to fork my repro and apply your sugestion and them make a pull request, this way you recieve the credits you deserve!! |
Hi @AchimPieters thank you! yes, I received an invitation but it didn't work when I clicked on it. At some point I could just fork the repo. I noticed your repo seems to be a copy and not a fork? I do plan to revisit this soon. I've been focusing on other pressing matters, in particular a failing wolfSSL test during certain configuration settings. In the meantime, how are things coming along? Given the size of audience using the @maximkulkin esp-homekit-demo have you all considered a commercial-grade license for support, etc? |
@gojimmypi Update: made some steps (with the help of @maximkulkin) but now I've got this message:
Now trying to find out ow to solve the code -1 for wolfssl comes from? PS. a commercial-grade licence is not a as its all non-profit |
Hello @AchimPieters - I've not forgotten this issue. Apologies for my delay in following up. The merge of #6287 does add full support for the ESP-IDF v5. At this time, I have only updated the wolfssl_benchmark and wolfssl_test apps. The other apps need attention for the version-specific WiFi networking. Note those examples have the "no install" components/wolfssl/CMakeLists.txt. This release shares the |
@gojimmypi so that has been a long, time, had to do some other things first. But I have made progress! |
Hi @AchimPieters - good to hear from your & thanks for your timely comment! I've been recently tidying up examples. I've been using the ESP-IDF 5.1 for quite some time. It's been working relatively well. I'd like to take your demo for a test drive. My development environment is not very conducive to docker containers. Would you happen to have the steps for the standard Note there's a new cmake for components. See the wolfssl_benchmark and the new template examples. Additionally, since we were last in touch, I have wolfSSL as an Espressif ESP Registry Managed Component that you may be interested in. See wolfSSL blog and preview blog for wolfSSH and wolfMQTT. I noticed your Edit: I tried building your LED Example and saw these errors that appear unrelated to wolfSSL, but are perhaps resolved in your docker container?
I created the template example just for occasions like this. I hope it helps. Let's first get your examples working from a standard command-line build, then work on containerizing it. |
|
Interesting. Do you have any additional details?
Ah yes, cool Regarding the LED example, other than the skipped docker steps, (which if the only thing is ESP-IDF, should not matter, eh?), the
|
I have to go to work, but will be back later and try to answer your questions, here is my compiling log maybe that clarifies some things? |
Maybe @maximkulkin can explain this problem better, will ask him. He has pushed an update to wolfssl to fix it. |
Would you please point me to the update? I don't see any issues or pull requests by @maximkulkin here nor on your esp32-homekit-demo. As for the log file, that was very helpful. It appears some of the settings are being assigned twice. This is likely in the I tried the example, and it compiles successfully:
Clearly there's some difference in your environment that I'd like to identify and resolve. It would be helpful to me to have the steps to reproduce this without using docker. |
Update: I am now able to reproduce this problem & currently investigating. |
Hi @AchimPieters I have determined the cause of the duplicate wolfssl definitions that start like this at build time:
The resolve this problem, the compiler needs to have Suggested changeFor your led example, please add this line to the beginning of your examples/led/main/CMakeLists.txt file:
Result of changeWith that change, I still see a few warnings, but they appear to be specific to your project and unrelated to wolfSSL.:
Please give that a try and let me know how it goes. Related problemPlease let me know if the
Thank you for your cooperation. Your example is very helpful and will provide guidance for future enhancements to make this process easier and more intuitive. |
Hi @gojimmypi I have incorporated your change and here is the result: log.txt It doesn't seem to work in my setup? Will do some further investigation. |
Hi @AchimPieters - Ah yes, I believe I see what's going on here. Commenting out the wolfSSL I probably missed that when recompiling the LED example and the esp_homekit submodule was already built. It is best to use only the wolfSSL Otherwise, your app appears to be compiling properly. The warnings are as desired as they are definitions in two places: the cmake definitions and the user settings. You can see the dangers here of having conflicting configuration settings in the The other thing that I will likely change in the next release is the removal of the If you want to remove |
@gojimmypi uncommenting the wolfSSL Debugging is quite challenging. But I will keep looking for the solution! |
The new errors you see are because the settings for wolfSSL (usually in the
The settings in the The It would be best to put the wolfSSL component with the code that uses it (the homekit library). You could, in theory, remedy the duplicate definitions by prefixing each one with an
This is not at all a solution I recommend, as the warnings have a legitimate and valuable purpose. When the settings in the The code in Each source file that uses wolfSSL needs first have an include for the Once #6844 is merged, I will be closing this issue as it relates to the original subject: Support for the Espressif ESP-IDF v5. You are welcome to open a new issue regarding the use wolfSSL components in shared libraries. This is an interesting situation and I appreciate you bringing it up. I realize the code changes to remedy your compiler warnings are a bit complex. I won't have time to help you with that in the immediate future. But I hope my suggestions at least point you in the right direction. As you make progress, I'm happy to help along the way. A new issue is probably best for that. Best Regards |
Hi @AchimPieters - I have a esp32-homekit-demo fork with some changes that demonstrates wolfSSL working with only I had quite a difficult time with this repo in Visual Studio, as the Icon%0D was not happy on a Windows/DOS file system, so I removed it. Oddly this one problem manifested itself as Visual Studio not being able to see any git changes for the entire repo. Note I moved wolfSSL from the local led example project as a managed component to the shared In particular, note there's this WOLFSSL_ROOT setting added:
I also added these lines to your
and the respective
Please review these suggested changes and let me know what you think. |
@gojimmypi that looks promising, made the changes you provided, and the errors are gone...... as far as the previous ones ;) See the log. log.txt, But nevertheless it is worth of further investigation! |
Hi @AchimPieters great to hear you are making progress!
yay! (although technically they were warnings, and the code was still compiling) Those new errors appear to indicate some features were not enabled from the Can you please confirm you've updated the |
@gojimmypi updated! I would really encourage you to collaborate on the project, as you are so enthusiastic. I already send you an invitation. |
excellent! and the result?
yes, thank you! I already accepted when I created my fork, but I think that only grants me permissions to push changes directly to your branch, eh? I can certainly create some PRs if you'd like. I'd prefer you to be the one driving applied updates so that you fully understand and control the changes being made. |
I'm away from my computer at the moment, but the Please check that all the prior wolfSSL settings that were in the CMakeLists.txt are in the If everything is checked into GitHub, I'll take a look later. My fork should have all applicable changes with the exception of the submodule updates noted above. |
Hi @gojimmypi, I tried to look into the encodign errors like:
here: https://www.wolfssl.com/documentation/manuals/wolfssl/coding_8h.html#function-base64_encode_nonl and
for these here: https://www.wolfssl.com/documentation/manuals/wolfssl/srp_8h.html but they dont give me the answere why these erros show up? would like to ask you if you could have a look. Ps. Mabe get my latest git changes, first? https://github.com/AchimPieters/esp32-homekit-demo |
@gojimmypi my last post is actually off-topic, and since the original issue "support for idf v5" has been resolved, I'm going to close this topic. |
Contact Details
[email protected]
Version
5.5.3
Description
Got the message: Please report this bug, all information can be found here: https://github.com/AchimPieters/esp32-homekit-demo.git
Reproduction steps
Relevant log output
No response
The text was updated successfully, but these errors were encountered: