<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[wolfSSL - Embedded SSL Library — Using TI RTOS...  It either fails, or crashes]]></title>
		<link>https://www.wolfssl.com/forums/topic1742-using-ti-rtos-it-either-fails-or-crashes.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic1742.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Using TI RTOS...  It either fails, or crashes.]]></description>
		<lastBuildDate>Tue, 11 May 2021 14:10:04 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Using TI RTOS...  It either fails, or crashes]]></title>
			<link>https://www.wolfssl.com/forums/post6017.html#p6017</link>
			<description><![CDATA[<p>The debug log functions are defined out as nothing.&nbsp; But I could add my out UART functions to them, and rebuild.</p><p>That&#039;s what I did and started digging.</p><p>But in the end, you are correct. It was the stack size.&nbsp; <br />TI uses three different places that control different stack sizes.<br />Ultimately I got it working with a stack of 32K.</p><p>(It also helps to actually put an &quot;0x&quot; in front of them.&nbsp; Otherwise it uses the decimal value, which is substantially smaller - Opps)</p><p>Working now.&nbsp; Thanks for the clues.</p>]]></description>
			<author><![CDATA[null@example.com (Scotty2541)]]></author>
			<pubDate>Tue, 11 May 2021 14:10:04 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6017.html#p6017</guid>
		</item>
		<item>
			<title><![CDATA[Re: Using TI RTOS...  It either fails, or crashes]]></title>
			<link>https://www.wolfssl.com/forums/post6016.html#p6016</link>
			<description><![CDATA[<p>I can&#039;t recall if the platform you are using is able to produce debug logs. If so, that could help us determine what is happening when the crash occurs.</p><p>Another tool to help determine the stability of wolfSSL is to run the wolfCrypt test application:<br /><a href="https://github.com/wolfSSL/wolfssl/tree/master/wolfcrypt/test">https://github.com/wolfSSL/wolfssl/tree … crypt/test</a></p>]]></description>
			<author><![CDATA[null@example.com (embhorn)]]></author>
			<pubDate>Tue, 11 May 2021 13:47:11 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6016.html#p6016</guid>
		</item>
		<item>
			<title><![CDATA[Re: Using TI RTOS...  It either fails, or crashes]]></title>
			<link>https://www.wolfssl.com/forums/post6010.html#p6010</link>
			<description><![CDATA[<p>embhorn,</p><p>That didn&#039;t work...</p><p>I tried NOT loading the roots CA&#039;s (only two of them), but it still crashes.&nbsp; (they actually fail anyway, due to the clock not being set...&nbsp; That&#039;s another issue, how does WolfSSL get the date n the TI embedded system??)</p><p>The CA&#039;s are only connecting to a cert that is 2048 bit.</p><p>I set the </p><div class="codebox"><pre><code>#define RSA_LOW_MEM</code></pre></div><p>&nbsp; but it still crashes.</p><p>I increased the stack size from 65536 to 98304&nbsp; (that 1 1/2 times 0x10000 ), but it still crashes.</p><p>It appears something is wandering off the reservation and destroying memory that doesn&#039;t belong to it.&nbsp; Because the TI NDK memory is getting screwed with.</p><p>This all works fine when I client connect to IIS WITHOUT using SSL.</p><p>And our server component (not yet integrated in this test app I&#039;m working on) supports public 4096 keys without setting the #define or increasing the stack from the 65536 we currently use.&nbsp; So I think we have enough memory for these smaller Pub/Priv keys.</p>]]></description>
			<author><![CDATA[null@example.com (Scotty2541)]]></author>
			<pubDate>Mon, 10 May 2021 22:55:01 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6010.html#p6010</guid>
		</item>
		<item>
			<title><![CDATA[Re: Using TI RTOS...  It either fails, or crashes]]></title>
			<link>https://www.wolfssl.com/forums/post6009.html#p6009</link>
			<description><![CDATA[<p>This sounds like insufficient stack space. The 4096 RSA math uses a lot of stack memory! Have you tested using with the RSA_LOW_MEM option configured?</p>]]></description>
			<author><![CDATA[null@example.com (embhorn)]]></author>
			<pubDate>Mon, 10 May 2021 20:50:23 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6009.html#p6009</guid>
		</item>
		<item>
			<title><![CDATA[Using TI RTOS...  It either fails, or crashes]]></title>
			<link>https://www.wolfssl.com/forums/post6006.html#p6006</link>
			<description><![CDATA[<p>Hello.</p><p>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. </p><p>It refuses to work in TI RTOS ARM.&nbsp; I am coding for the am335x, TI Compiler 17.3, SYSBIOS 6.46</p><p>I&#039;ve been dealing with this for a week, and not getting anywhere.&nbsp; I&#039;ve even had to step down into the WolfSSL code trying to debug it.</p><p>After MANY REPEATED rebuilds and attempts, I have narrowed it down to enabling:<br /></p><div class="codebox"><pre><code>#define WOLFSSL_SHA384
#define WOLFSSL_SHA512</code></pre></div><p>Simply put:&nbsp; with those defined, it CRASHES in ecc.c, line 2374 in the function </p><div class="codebox"><pre><code>err = mp_invmod_mont_ct(z, modulus, t1, mp); </code></pre></div><p>I have not dug any deeper than that into the WOLFSSL code.</p><p>Alternately, if I do NOT define those directives, it simply returns from the call to </p><div class="codebox"><pre><code> result = SSL_connect(m_ssl);</code></pre></div><p> with a code -308&nbsp; (socket in error condition) which is the result of the server disconnecting on the first Client Hello message.</p><p>I keep dragging settings from the Windows build to the TI ARM build to see when it will start working.&nbsp; All it does is crash with those settings defined.</p><p>I&#039;ve tried to read the doc in order to figure out what #defines need to be defined, with no avail.&nbsp; There is nothing that tells me &quot;You must enable X if you enable &quot;Y&quot; or it&#039;ll crash hard.</p><p>The current setting I have defined in &quot;user_settings.h&quot; are:</p><div class="codebox"><pre><code>#define OPENSSL_EXTRA        /*   */

//  From the &quot;settings.h&quot;
    #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</code></pre></div><p>This is the crash from the ARM.&nbsp; The DFSR shows an access issue, and the DFAR shows address 0</p><div class="codebox"><pre><code>[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</code></pre></div><p>Can anyone clue me in to which of these settings are required to make it simply connect to a IIS server?</p><p>-Scott</p>]]></description>
			<author><![CDATA[null@example.com (Scotty2541)]]></author>
			<pubDate>Mon, 10 May 2021 19:13:03 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6006.html#p6006</guid>
		</item>
	</channel>
</rss>
