1 (edited by eques 2017-06-26 06:06:22)

Topic: [SOLVED] Esp-idf + wolfssl

I want to use wolfSSL on an ESP32 thing. But I cannot get it to work. I downloaded the full source code from the website and I already tried to place it on different places inside the folder structure of the esp-idf, but I always get errors that there are missing files. The last thing I tries was to copy the wolfssl folder into the freertos folder from esp-idf because wolfssl should work with freertos. However, when I do this, I get the following error:

/home/user/esp/esp-idf/components/freertos/include/freertos/wolfssl/ssl.h:30:40: fatal error: wolfssl/wolfcrypt/settings.h: No such file or directory

However, in the wolfcrypt folder there is a file named settings.h so I don't know why this error pops up. I have tried several solutions for the past two days, but I never managed to get it to work. If someone knows how to use wolfssl and esp-idf, I will be very happy. Also, eso-idf uses freertos, and I know that wolfssl should be available in esp-idf, however, it looks like the full version of freertos is not available on the esp-idf, so wolfssl is not provided.

I have also tried to include the wolfssl source code (c + h files) that was available in the full freertos download. I placed the wolfssl folder with the h files in esp-idf/components/freertos/include/freertos. The c files, I included in esp-idf/components/freertos. Now I get the following error:

error: unknown type name 'pthread_mutex_t' typedef pthread_mutex_t wolfSSL_Mutex
In file included from /home/user/esp/esp-idf/components/freertos/include/freertos/wolfssl/internal.h:28:0, from /home/user/esp/esp-idf/components/freertos/./keys.c:30:/home/user/esp/esp-idf/components/freertos/include/freertos/wolfssl/ssl.h:931:33: fatal error: sys/uio.h: No such file or directory

I have no clue what to do next.

Share

Re: [SOLVED] Esp-idf + wolfssl

Hi eques,

I personally have not built wolfSSL for Esp-idf but this looks like the include path needs updated. If it is an IDE based off of Eclipse then you should be able to do something like "right click on the project -> Properties -> C/C++ General -> Paths and Symbols" for adding include paths.

With the second issue the unknown type pthread_mutex_t looks like the macro FREERTOS from settings.h may not be getting included. This could be a side effect of the include paths needing to be updated.

For the last error listed, sys/uio.h dependency can be removed by defining the macro NO_WRITEV. This can be defined in wolfssl/wolfcrypt/settings.h or better yet in a user_settings.h file.

Can you tell us some about the project and use case with wolfSSL?

Regards,
Jacob

Share

3 (edited by eques 2017-06-30 01:42:28)

Re: [SOLVED] Esp-idf + wolfssl

Thanks for your reply, I already managed to make it work by adapting some includes and changing the settings.

Share