Topic: Using TI RTOS... It either fails, or crashes
Hello.
I am trying to get a client connection to an IIS server. It all works fine in Windows, using a typical TCP connection, linked to a WolfSSL library built with the VS solution file as is from release 4.7.0.
It refuses to work in TI RTOS ARM. I am coding for the am335x, TI Compiler 17.3, SYSBIOS 6.46
I've been dealing with this for a week, and not getting anywhere. I've even had to step down into the WolfSSL code trying to debug it.
After MANY REPEATED rebuilds and attempts, I have narrowed it down to enabling:
#define WOLFSSL_SHA384
#define WOLFSSL_SHA512
Simply put: with those defined, it CRASHES in ecc.c, line 2374 in the function
err = mp_invmod_mont_ct(z, modulus, t1, mp);
I have not dug any deeper than that into the WOLFSSL code.
Alternately, if I do NOT define those directives, it simply returns from the call to
result = SSL_connect(m_ssl);
with a code -308 (socket in error condition) which is the result of the server disconnecting on the first Client Hello message.
I keep dragging settings from the Windows build to the TI ARM build to see when it will start working. All it does is crash with those settings defined.
I've tried to read the doc in order to figure out what #defines need to be defined, with no avail. There is nothing that tells me "You must enable X if you enable "Y" or it'll crash hard.
The current setting I have defined in "user_settings.h" are:
#define OPENSSL_EXTRA /* */
// From the "settings.h"
#define FP_MAX_BITS 8192 /* Increase for 4096 bit key */
#define USE_CERT_BUFFERS_2048
#define HAVE_ECC
#define HAVE_ALPN
#define USE_WOLF_STRTOK /* use with HAVE_ALPN */
#define HAVE_TLS_EXTENSIONS
#define HAVE_AESGCM
// New settings, trying to get client to connect
#define WOLFSSL_AES_256
//#define WOLFSSL_SHA384
//#define WOLFSSL_SHA512
#define NO_PSK
#define HAVE_AESGCM
#define ECC_USER_CURVES
#define ECC_SHAMIR
#define WOLFSSL_RIPEMD
#define HAVE_EXTENDED_MASTER
This is the crash from the ARM. The DFSR shows an access issue, and the DFAR shows address 0
[CortxA8] 0x805dd620 R8 = 0x805d6458
R1 = 0x00000000 R9 = 0x805d6614
R2 = 0x805d661e R10 = 0x00000e3a
R3 = 0x00000000 R11 = 0x00000000
R4 = 0x00000000 R12 = 0x00000000
R5 = 0x00000000 SP(R13) = 0x805b26e0
R6 = 0x00000001 LR(R14) = 0x804bf1ac
R7 = 0x805dd644 PC(R15) = 0x805b26e0
PSR = 0x00000001
DFSR = 0x00000005 IFSR = 0x00000000
DFAR = 0x00000000 IFAR = 0x00000000
ti.sysbios.family.arm.exc.Exception: line 205: E_dataAbort: pc = 0x805b26e0, lr = 0x804bf1ac.
xdc.runtime.Error.raise: terminating execution
Can anyone clue me in to which of these settings are required to make it simply connect to a IIS server?
-Scott
<Code shown is not to scale>