I am trying to add WolfSSL to my project. I’m currently running FreeRTOS V9 on a SAME70, in addition to Plus-TCP. I am able to connect to a socket (port 80) via ethernet and able to download data from http servers. I’m building my project in Atmel Studio 7.
I have added a user_settings.h file to my project by copying one of the examples and uncommented #define FREERTOS and #define FREERTOS_TCP
I seem to be having 2 problems while trying to compile:
Even with #define FREERTOS and #define FREERTOS_TCP uncommented, the compiler is jumping past the #elif FREERTOS and giving compiler errors, because it seems to be ignoring the fact that I’m trying to compile for FREERTOS. I thought that perhaps the user_settings.h was not getting pulled in early enough, so I even tried to move these two flags to the top of my main.c file, which didn’t help. Is there any reason that perhaps #define FREERTOS needs to be a compiler flag or option, rather than just being uncommented in Atmel Studio?
Perhaps more important than question 1: Exactly what files need to be included to use SSL/TLS server connections from within FreeRTOS? The WolfSSL package seems to be available for many different systems and it’s unclear to me exactly what I need to include. There is a src directory at the same hierarchy level as WolfSSL and WolfCrypt. Also, files inside WolfSSL seem to reference WolfCrypt. There are further src directories within WolfSSL and WolfCrypt. I tried just including all files, but then I get compiler errors for files like aes_asm.s inside wolfcrypt, because it contains assembly instructions that are being flagged as “bad instruction” by the compiler. Even though this github project is targeted at FreeRTOS, there are still references to Windows and other OSs. Can someone clarify exactly what is needed?
Additional Info for part 1 of my question: I get an error on line 121 of wolfio.h, saying
sys/socket.h: No such file or directory. However, the compiler should not get here, because the #elif on line 76 should recognize “#elif defined(FREERTOS_TCP)” and only execute that branch of the #elif. It shouldn’t drop through to line 121
If you’re using the settings.h file in wolfcrypt, please kindly ensure that the WOLFSSL_USER_SETTINGS macro is defined to include user_settings.h . IMHO, this should be defined by your project configuration. Without this definition, the user_settings.h file may not be included by the WolfSSL library, which could potentially lead to issues.
It seems to be more directly associated with the WolfSSL library itself. However, I would be delighted to provide you with some sample references. Please kindly refer to the following projects to obtain the relevant file lists.
Thank you for the suggestion to add WOLFSSL_USER_SETTINGS
However, I’m still unclear in terms of what files need to included in my project.
If I include the .c and .h files in the WolfSSL/wolfssl directory and WolfSSL/wolfcrypt, then I get an error when I include wolfSSL_Init(); in my application. This is because, while the prototype for wolfSSL_Init(); is included in WolfSSL/wolfcrypt/ssl.h, the function is actually define in WolfSSL/src. I then also need to include the other files in WolfSSL/src. The trouble is that then I get errors such as 'conflicting types for ‘Aes’ in aes.h and a whole host of other errors.
Obviously other people are able to compile this library, but I’m compiling it in Atmel Studio for a SAME70, so I can’t rely on things like the linux config utilities.
How can I determine what are the right directories to include, and also why I get errors like 'conflicting types for ‘Aes’ etc.
Hi @SlowRiseTime,
Please refer to the samples I have provided. If those are insufficient, I would suggest reaching out to the WolfSSL team for further assistance, as they may be better equipped to answer this.