Topic: [SOLVED] Building wolfssl for cc3100

Hi All,

I am trying to rebuild the wolfssl library for simplelink but getting errors. After going through the online documentation and checking the ethernet version of wolfssl, I tried to do this-

1. Changing the directory from NDK to Simplelink in the wolfssl>tirtos>products.mak

NDK_INSTALL_DIR= C:\ti\tirtos_tivac_2_16_01_14\products\tidrivers_tivac_2_16_01_13\packages\ti\mw\wifi

and setting the #include<include/socket.h> into wolfio.h but I am getting this error-

clem4f C:/Users/Akhilesh/Downloads/wolfssl-4.3.0/tirtos/../src/wolfio.c ...
"C:/Users/Akhilesh/Downloads/wolfssl-4.3.0/tirtos/../src/wolfio.c", line 98: error: identifier "errno" is undefined
"C:/Users/Akhilesh/Downloads/wolfssl-4.3.0/tirtos/../src/wolfio.c", line 229: error: identifier "ECONNRESET" is undefined
"C:/Users/Akhilesh/Downloads/wolfssl-4.3.0/tirtos/../src/wolfio.c", line 233: error: identifier "EINTR" is undefined
"C:/Users/Akhilesh/Downloads/wolfssl-4.3.0/tirtos/../src/wolfio.c", line 237: error: identifier "ECONNABORTED" is undefined
"C:/Users/Akhilesh/Downloads/wolfssl-4.3.0/tirtos/../src/wolfio.c", line 276: error: identifier "ECONNRESET" is undefined
"C:/Users/Akhilesh/Downloads/wolfssl-4.3.0/tirtos/../src/wolfio.c", line 280: error: identifier "EINTR" is undefined
"C:/Users/Akhilesh/Downloads/wolfssl-4.3.0/tirtos/../src/wolfio.c", line 284: error: identifier "EPIPE" is undefined
7 errors detected in the compilation of "C:/Users/Akhilesh/Downloads/wolfssl-4.3.0/tirtos/../src/wolfio.c".

I am not able to figure it out.

Share

Re: [SOLVED] Building wolfssl for cc3100

Hi @akhi_gangwar,

Is it possible you have the setting #define WOLFSSL_USER_IO set? These errors would pop up if you had defined WOLFSSL_USER_IO and continued trying to compile wolfio.c and including wolfio.h. If you are using that setting you will need to register your own I/O callbacks and remove wolfio.c and wolfio.h from the build.

Warm Regards,

K

Re: [SOLVED] Building wolfssl for cc3100

Hi Kaleb,
I resolved this issue. I changed the socket library from ethernet to wifi and these error codes manually I ad to set as these were not in wifi.
Thanks

Share

Re: [SOLVED] Building wolfssl for cc3100

Hi Kaleb,
I am getting this error while using wolfSSL_write api-
int sent = wolfSSL_write(ssl_cmd, ftpCmd, strlen(ftpCmd));
// ssl_cmd is the global variable used in other function to initiallize the TLS. In that function, wolfSSL_write function is working fine.
// ftpCmd is the local variable.
I am getting -173 error value. Any reason??
Thanks

Share

Re: [SOLVED] Building wolfssl for cc3100

@akhi_gangwar,

BAD_FUNC_ARG       = -173,  /* Bad function argument provided */

A bad function argument means you passed in something that is invalid. For the above API call try this check just before the call:

if (ssl_cmd == NULL) {
    printf("ssl_cmd is NULL\n");
    // error out
}
if (ftpCmd == NULL) {
    printf("ftpCmd is NULL\n");
    // error out
}
printf("length of fptCmd is %d\n", (int) strlen(ftpCmd));
// is the length the right value?

Re: [SOLVED] Building wolfssl for cc3100

Hi Kaleb,
I am able to resolve this issue. The variable issue was there.
I am getting one more issue which is a bit weird. As I am doing explicit ftps, I am able to open command channel and procedure is as follows-
1. Create a plain socket with ftp server using socket APIs.
2. Upon sending the AUTH TLS command, create the tls using wolfssl to perform the handshake.
3. Things are working and I am able to log in and send commands to ftp server.
But when I am trying to open the data connection, which is 1 more socket to the server but at a different port, using
socket api (sl_connect), I am not able to create it. Even the socket API is not working anymore. Nothing is going to the server.
What can be the issue? Can't I create plain socket anymore if I have used wolfssl?

Share

Re: [SOLVED] Building wolfssl for cc3100

akhi_gangwar,

wolfSSL does not control the TCP/IP stack if that is what you are asking, wolfSSL would not block, prevent or limit calls to socket creation. In fact wolfSSL does not even depend on sockets, our library is abstracted with custom I/O callbacks so if a user wanted they could do a handshake over USB serial through UART, over bluetooth, in memory using buffers, or using any other forms of I/O that is available.

I am not sure why you are seeing this behavior but I can, with confidence, state that wolfSSL is not causing it directly. Is there a fixed memory requirement to open the socket? Are you at the limits of your run time resources when creating the socket? What does the socket libraries documentation say about it?

Warm Regards,

K

Re: [SOLVED] Building wolfssl for cc3100

Hi Kaleb,
I resolved the issue. It was the sequencing problem. Nothing else.
Thanks

Share

Re: [SOLVED] Building wolfssl for cc3100

akhi_gangwar,

Glad to hear it was resolved! Let us know if anything else comes up.

Cheers,

K