<?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 — Implementation of ECC on STM32f446]]></title>
		<link>https://www.wolfssl.com/forums/topic1820-implementation-of-ecc-on-stm32f446.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic1820.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Implementation of ECC on STM32f446.]]></description>
		<lastBuildDate>Thu, 04 Nov 2021 10:49:02 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Implementation of ECC on STM32f446]]></title>
			<link>https://www.wolfssl.com/forums/post6346.html#p6346</link>
			<description><![CDATA[<p>thanks for bugs fixing </p><p>It works now !! <img src="https://www.wolfssl.com/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[null@example.com (rahmanikivi724)]]></author>
			<pubDate>Thu, 04 Nov 2021 10:49:02 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6346.html#p6346</guid>
		</item>
		<item>
			<title><![CDATA[Re: Implementation of ECC on STM32f446]]></title>
			<link>https://www.wolfssl.com/forums/post6344.html#p6344</link>
			<description><![CDATA[<p>We recently released 5.0 which fixes various bugs in 4.8.1, please try updating and let me know if you still see any issues.</p>]]></description>
			<author><![CDATA[null@example.com (kareem_wolfssl)]]></author>
			<pubDate>Wed, 03 Nov 2021 20:48:45 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6344.html#p6344</guid>
		</item>
		<item>
			<title><![CDATA[Re: Implementation of ECC on STM32f446]]></title>
			<link>https://www.wolfssl.com/forums/post6343.html#p6343</link>
			<description><![CDATA[<p>thanks kareem</p><p>yes it says hardware RNG is supported , I am reading the manual to read more about it.</p><p>with defining WOLFSSL_GENSEED_FORTEST I managed to run Ecc with this configuration <br /></p><div class="codebox"><pre><code>#define ECC_KEY_SIZE  48
#define ECC_KEY_CURVE ECC_SECP256R1</code></pre></div><p>when I changed it to SECP256K1<br /></p><div class="codebox"><pre><code>#define ECC_KEY_SIZE  48
#define ECC_KEY_CURVE ECC_SECP256K1</code></pre></div><p>I received error 172 from make key function some other function send error based on this problem<br /></p><div class="codebox"><pre><code>make_key_Func= -172
 PrivateKey_Func= -170
 sign_Func= -170
 verify_Func=-171</code></pre></div><p>based on the wolfssl manual 172 means <br /></p><div class="codebox"><pre><code>ECC_CURVE_OID_E    -172    Unsupported ECC OID curve type</code></pre></div><p>then I tried defining these two that I found in ecc.c<br /></p><div class="codebox"><pre><code>#define HAVE_ECC_KOBLITZ  
#define WOLFSSL_CUSTOM_CURVES</code></pre></div><p>then I received an error<br /></p><div class="codebox"><pre><code>error: conflicting types for &#039;ByteToHex&#039;
16503 | static void ByteToHex(byte n, char* str)
      |             ^~~~~~~~~
In file included from ../Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/src/asn.c:86:
../Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/src/misc.c:438:26: note: previous definition of &#039;ByteToHex&#039; was here
  438 | WC_STATIC WC_INLINE char ByteToHex(byte in)</code></pre></div><p>I realized there is a definition of ByteToHex inside two files miscs.c and asn.c&nbsp; <br />if I remove misc.c by defining NO_INLINE , I will receive an error like this </p><p>undefined reference to `ForceZero&#039;.</p>]]></description>
			<author><![CDATA[null@example.com (rahmanikivi724)]]></author>
			<pubDate>Wed, 03 Nov 2021 12:40:21 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6343.html#p6343</guid>
		</item>
		<item>
			<title><![CDATA[Re: Implementation of ECC on STM32f446]]></title>
			<link>https://www.wolfssl.com/forums/post6341.html#p6341</link>
			<description><![CDATA[<p>Hello rahmanikivi724,</p><p>Your platform does have a hardware RNG, you can see the details here: <a href="https://www.st.com/en/microcontrollers-microprocessors/stm32f446re.html">https://www.st.com/en/microcontrollers- … 446re.html</a><br />So you should undefine NO_STM32_RNG so we use our STM32 hardware RNG support, which will include a wc_GenerateSeed implementation.&nbsp; You should also undefine WOLFSSL_GENSEED_FORTEST.</p><p>Thanks,<br />Kareem</p>]]></description>
			<author><![CDATA[null@example.com (kareem_wolfssl)]]></author>
			<pubDate>Mon, 01 Nov 2021 21:02:47 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6341.html#p6341</guid>
		</item>
		<item>
			<title><![CDATA[Re: Implementation of ECC on STM32f446]]></title>
			<link>https://www.wolfssl.com/forums/post6336.html#p6336</link>
			<description><![CDATA[<p>hello again </p><p>as you know I started to implement ecc with your library.<br />I followed the video and as I told in a previous thread I had a problem with wc_GenerateSeed()<br />so I defined and problem solved<br /></p><div class="codebox"><pre><code>#define WOLFSSL_GENSEED_FORTEST</code></pre></div><p>now I have this problem <br /></p><div class="codebox"><pre><code>../Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/src/ssl.c:149:10: fatal error: wolfcrypt/src/evp.c: No such file or directory
  149 | #include &quot;wolfcrypt/src/evp.c&quot;</code></pre></div><p>in this case, I think it should not ask for this file I reviewed ssl.c I didn&#039;t find any define to avoid calling evp.c</p>]]></description>
			<author><![CDATA[null@example.com (rahmanikivi724)]]></author>
			<pubDate>Tue, 26 Oct 2021 17:30:23 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6336.html#p6336</guid>
		</item>
		<item>
			<title><![CDATA[Re: Implementation of ECC on STM32f446]]></title>
			<link>https://www.wolfssl.com/forums/post6333.html#p6333</link>
			<description><![CDATA[<p>hello again </p><p>in this implementation I used System Workbench for STM32 as IDE almost all guides are related to STM32Cube, so I Installed STM32Cube and start again from zero,</p><p>1- in this IDE I didn&#039;t need to link wolfssl library, so based on the video and the documentation that you mentioned<br />- I created a new project for STM32F446re <br />- added wolfssl pack to the project</p><p>2-to keep everything simple I didn&#039;t use FreeRTOS so I let wolfssl configuration be unchanged &quot;Single Threaded&quot; also I did not enable FreeRTOS too,</p><p>3-I sat the configurations like the guide in the documentation</p><p>4- I opened the main.c file and did not edit or put anything just I click on debug</p><p>5-&nbsp; 2 errors appeared&nbsp; <br />I- <br /></p><div class="codebox"><pre><code>#warning Please define a hardware platform!</code></pre></div><p>for this error <br />because my board is not listed so I think it doesn&#039;t have any hardware to accelerate crypto functions so based on the guide <br /></p><div class="codebox"><pre><code>#else
    #warning Please define a hardware platform!
    /* This means there is not a pre-defined platform for your board/CPU */
    /* You need to define a CPU type, HW crypto and debug UART */
    /* CPU Type: WOLFSSL_STM32F1, WOLFSSL_STM32F2, WOLFSSL_STM32F4,
        WOLFSSL_STM32F7, WOLFSSL_STM32H7, WOLFSSL_STM32L4 and WOLFSSL_STM32L5 */
    #define WOLFSSL_STM32F4

    /* Debug UART used for printf */
    /* The UART interface number varies for each board/CPU */
    /* Typically this is the UART attached to the ST-Link USB CDC UART port */
    #define HAL_CONSOLE_UART huart4

    /* Hardware Crypto - uncomment as available on hardware */
    //#define WOLFSSL_STM32_PKA
    //#define NO_STM32_RNG
    //#undef  NO_STM32_HASH
    //#undef  NO_STM32_CRYPTO
    //#define WOLFSSL_GENSEED_FORTEST
    //#define STM32_HAL_V2
#endif</code></pre></div><p>I defined NO_STM32_RNG ,also these are defined by default&nbsp; NO_STM32_HASH and&nbsp; NO_STM32_CRYPTO<br />the error persisted the only way to solve it <img src="https://www.wolfssl.com/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /> is to make the warning line to be a comment</p><p>II- <br /></p><div class="codebox"><pre><code>../Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/src/port/st/stm32.c:39:14: fatal error: wolfcrypt/src/misc.c: No such file or directory
   39 |     #include &lt;wolfcrypt/src/misc.c&gt;</code></pre></div><p>for this error<br /> I defined NO_INLINE and it solves it <img src="https://www.wolfssl.com/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>then I compiled this empty project I received a new error <br /></p><div class="codebox"><pre><code>../Middlewares/Third_Party/wolfSSL_wolfSSL_wolfSSL/wolfssl/wolfcrypt/src/random.c:2587:6: error: #error &quot;you need to write an os specific wc_GenerateSeed() here&quot;
 2587 |     #error &quot;you need to write an os specific wc_GenerateSeed() here&quot;
      |      ^~~~~</code></pre></div><p>this error comes from random.c line 2585<br /></p><div class="codebox"><pre><code>#elif defined(NO_DEV_RANDOM)

    #error &quot;you need to write an os specific wc_GenerateSeed() here&quot;

    /*
    int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
    {
        return 0;
    }
    */</code></pre></div><p> what is your suggestion why it is empty and there is not any seed generation code? do you have any seed generation code suggestion that works with STM32F446RE ?</p><p>also I try to define CUSTOM_RAND_GENERATE_BLOCK it was not successful I received several undeclareds</p>]]></description>
			<author><![CDATA[null@example.com (rahmanikivi724)]]></author>
			<pubDate>Mon, 25 Oct 2021 18:02:24 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6333.html#p6333</guid>
		</item>
		<item>
			<title><![CDATA[Re: Implementation of ECC on STM32f446]]></title>
			<link>https://www.wolfssl.com/forums/post6331.html#p6331</link>
			<description><![CDATA[<p>You should have stm32f4xx_hal.h, it needs to be generated by STM32CubeIde.&nbsp; You may be running into a path issue, make sure your include paths include stm32f4xx_hal.h.<br />You need to add your platform to the user_settings.h template, see our documentation: <a href="https://github.com/wolfSSL/wolfssl/tree/master/IDE/STM32Cube">https://github.com/wolfSSL/wolfssl/tree … /STM32Cube</a> and user_settings.h template under &quot;#warning Please define a hardware platform!&quot;.&nbsp; You should define NO_STM32_HASH/CRYPTO if applicable for your platform.&nbsp; You do not need WOLFSSL_STM32F427_RNG defined.<br />Also see our video here: <a href="https://www.youtube.com/watch?v=pUd2HEfBp3w">https://www.youtube.com/watch?v=pUd2HEfBp3w</a><br />For debugging, you need to build with DEBUG_WOLFSSL and you need to call wolfSSL_Debugging_ON() before any other code.</p>]]></description>
			<author><![CDATA[null@example.com (kareem_wolfssl)]]></author>
			<pubDate>Thu, 21 Oct 2021 18:07:44 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6331.html#p6331</guid>
		</item>
		<item>
			<title><![CDATA[Re: Implementation of ECC on STM32f446]]></title>
			<link>https://www.wolfssl.com/forums/post6330.html#p6330</link>
			<description><![CDATA[<p>now I realized something after several tries that is this data</p><div class="codebox"><pre><code>wolfSSL_Init() return 1
wc_InitRng() return -199
wolfSSL_Debugging_ON() return -174</code></pre></div><p>there is a problem with wc_InitRng() which would be impossible</p><p>I tried to use the user setting configuration which you suggest and my MCU and board (STM32F446RE&nbsp; or STM32F446XX) is not in the list <br /></p><div class="codebox"><pre><code>/* ------------------------------------------------------------------------- */
/* Hardware platform */
/* ------------------------------------------------------------------------- */
#define NO_STM32_HASH
#define NO_STM32_CRYPTO

#if defined(STM32WB55xx)
    #define WOLFSSL_STM32WB
    #define WOLFSSL_STM32_PKA
    #undef  NO_STM32_CRYPTO
    #define HAL_CONSOLE_UART huart1
#elif defined(STM32F407xx)
    #define WOLFSSL_STM32F4
    #define HAL_CONSOLE_UART huart2
#elif defined(STM32F437xx)
    #define WOLFSSL_STM32F4
    #undef  NO_STM32_HASH
    #undef  NO_STM32_CRYPTO
    #define STM32_HAL_V2
    #define HAL_CONSOLE_UART huart4
#elif defined(STM32F777xx)
    #define WOLFSSL_STM32F7
    #undef  NO_STM32_HASH
    #undef  NO_STM32_CRYPTO
    #define STM32_HAL_V2
    #define HAL_CONSOLE_UART huart2
#elif defined(STM32H753xx)
    #define WOLFSSL_STM32H7
    #undef  NO_STM32_HASH
    #undef  NO_STM32_CRYPTO
    #define HAL_CONSOLE_UART huart3
#elif defined(STM32L4A6xx)
    #define WOLFSSL_STM32L4
    #undef  NO_STM32_HASH
    #undef  NO_STM32_CRYPTO
    #define HAL_CONSOLE_UART hlpuart1
#elif defined(STM32L475xx)
    #define WOLFSSL_STM32L4
    #define HAL_CONSOLE_UART huart1
#elif defined(STM32L562xx)
    #define WOLFSSL_STM32L5
    #define WOLFSSL_STM32_PKA
    #undef  NO_STM32_HASH
    #undef  NO_STM32_CRYPTO
    #define HAL_CONSOLE_UART huart1
#elif defined(STM32L552xx)
    #define WOLFSSL_STM32L5
    #undef  NO_STM32_HASH
    #define HAL_CONSOLE_UART hlpuart1
#elif defined(STM32F207xx)
    #define WOLFSSL_STM32F2
    #define HAL_CONSOLE_UART huart3
#elif defined(STM32F107xC)
    #define WOLFSSL_STM32F1
    #define HAL_CONSOLE_UART huart4
    #define NO_STM32_RNG
#elif defined(STM32F401xE)
    #define WOLFSSL_STM32F4
    #define HAL_CONSOLE_UART huart2
    #define NO_STM32_RNG
    #define WOLFSSL_GENSEED_FORTEST
#elif defined(STM32G071xx)
    #define WOLFSSL_STM32G0
    #define HAL_CONSOLE_UART huart2
    #define NO_STM32_RNG
    #define WOLFSSL_GENSEED_FORTEST
#else
    #warning Please define a hardware platform!
    /* This means there is not a pre-defined platform for your board/CPU */
    /* You need to define a CPU type, HW crypto and debug UART */
    /* CPU Type: WOLFSSL_STM32F1, WOLFSSL_STM32F2, WOLFSSL_STM32F4,
        WOLFSSL_STM32F7, WOLFSSL_STM32H7, WOLFSSL_STM32L4 and WOLFSSL_STM32L5 */
    #define WOLFSSL_STM32F4

    /* Debug UART used for printf */
    /* The UART interface number varies for each board/CPU */
    /* Typically this is the UART attached to the ST-Link USB CDC UART port */
    #define HAL_CONSOLE_UART huart4

    /* Hardware Crypto - uncomment as available on hardware */
    //#define WOLFSSL_STM32_PKA
    //#define NO_STM32_RNG
    //#undef  NO_STM32_HASH
    //#undef  NO_STM32_CRYPTO
    //#define WOLFSSL_GENSEED_FORTEST
    //#define STM32_HAL_V2
#endif</code></pre></div><br /><p>so I just define WOLFSSL_STM32F4 then I always receive the error of defining hardware platform and a missing file &quot;stm32f4xx_hal.h&quot;</p><div class="codebox"><pre><code>C:/02-RtosWorkplace/STM32_HelloWorld/Config/user_settings.h:181:6: warning: #warning Please define a hardware platform! [-Wcpp]
     #warning Please define a hardware platform!
      ^~~~~~~
C:/02-RtosWorkplace/STM32_HelloWorld/Config/user_settings.h:186:0: warning: &quot;WOLFSSL_STM32F4&quot; redefined
     #define WOLFSSL_STM32F4
 
&lt;command-line&gt;:0:0: note: this is the location of the previous definition
In file included from ../src/bareMetal.c:4:0:
C:/00-libs/wolfssl-m4-flag-hard2/include/wolfssl/wolfcrypt/settings.h:1296:22: fatal error: stm32f4xx_hal.h: No such file or directory
             #include &quot;stm32f4xx_hal.h&quot;</code></pre></div><br /><br /><p>around line 1266 of the setting file if I define WOLFSSL_STM32F427_RNG it asks for the &quot;stm32f427xx.h&quot; but this is not the file that I have this is &quot;stm32f4xx.h&quot;</p><div class="codebox"><pre><code>        #ifdef WOLFSSL_STM32F427_RNG
            #include &quot;stm32f427xx.h&quot;
        #endif</code></pre></div><p>finally, is there a manual that shows how to config settings? or how to config this library for this board, or which definitions I need to use ?</p>]]></description>
			<author><![CDATA[null@example.com (rahmanikivi724)]]></author>
			<pubDate>Wed, 20 Oct 2021 21:50:56 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6330.html#p6330</guid>
		</item>
		<item>
			<title><![CDATA[Re: Implementation of ECC on STM32f446]]></title>
			<link>https://www.wolfssl.com/forums/post6329.html#p6329</link>
			<description><![CDATA[<p>Happy to help.</p><p>You need to define WOLFSSL_NO_SOCK as well, also make sure you are including options.h and settings.h before any other wolfSSL headers.&nbsp; I would recommend you to use our STM32 user_settings.h template, found here: <a href="https://github.com/wolfSSL/wolfssl/blob/master/examples/configs/user_settings_stm32.h">https://github.com/wolfSSL/wolfssl/blob … gs_stm32.h</a><br />Yes, you would need to modify this include to use your platform&#039;s header instead, most likely &quot;stm32f446xx.h&quot;.&nbsp; You can find this include in wolfssl/wolfcrypt/settings.h around line 1266.&nbsp; However I would first try running wolfSSL_Init() and confirm that doesn&#039;t fix the issue.<br />You are using the correct data structure WC_RNG in your code.&nbsp; After initializing the RNG with wc_InitRng, call wc_RNG_GenerateBlock or wc_RNG_GenerateByte to generate random data.</p>]]></description>
			<author><![CDATA[null@example.com (kareem_wolfssl)]]></author>
			<pubDate>Wed, 20 Oct 2021 19:49:35 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6329.html#p6329</guid>
		</item>
		<item>
			<title><![CDATA[Re: Implementation of ECC on STM32f446]]></title>
			<link>https://www.wolfssl.com/forums/post6328.html#p6328</link>
			<description><![CDATA[<p>thanks for your help </p><p>when I tried to put wolfSSL_Init() I am needed to include ssl.h so when i include ssl.h I<br />received this error <br /></p><div class="codebox"><pre><code>C:/00-libs/wolfssl-m4-flag-hard2/include/wolfssl/wolfio.h:157:22: fatal error: sys/socket.h: No such file or directory
             #include &lt;sys/socket.h&gt;
                      ^~~~~~~~~~~~~~
compilation terminated.</code></pre></div><p>also when defined WOLFSSL_STM32F427_RNG it asked for #include &quot;stm32f427xx.h&quot; which is not in my include <br /></p><div class="codebox"><pre><code>C:/00-libs/wolfssl-m4-flag-hard2/include/wolfssl/wolfcrypt/settings.h:1266:22: fatal error: stm32f427xx.h: No such file or directory
             #include &quot;stm32f427xx.h&quot;
                      ^~~~~~~~~~~~~~
compilation terminated.</code></pre></div><p> do you think that I missed something? <br />can you give a&nbsp; rng example data structure to put instead of generating and passing this function It is just a test<br /></p><div class="codebox"><pre><code>rng=XXXXXXXdatastructure</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (rahmanikivi724)]]></author>
			<pubDate>Wed, 20 Oct 2021 09:15:26 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6328.html#p6328</guid>
		</item>
		<item>
			<title><![CDATA[Re: Implementation of ECC on STM32f446]]></title>
			<link>https://www.wolfssl.com/forums/post6327.html#p6327</link>
			<description><![CDATA[<p>Hi rahmanikivi724,</p><p>A couple of things to try.<br />First, you should always call wolfSSL_Init() before any other wolfSSL functions.<br />Second, try defining WOLFSSL_STM32F427_RNG to use our STM32F4xx codepath for your RNG.</p><p>If this doesn&#039;t help, please enable debugging by building with DEBUG_WOLFSSL and running wolfSSL_Debugging_ON() before your code, and attach debug logs.&nbsp; The return code of wc_InitRng would also be helpful.</p><p>Thanks,<br />Kareem</p>]]></description>
			<author><![CDATA[null@example.com (kareem_wolfssl)]]></author>
			<pubDate>Tue, 19 Oct 2021 18:12:49 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6327.html#p6327</guid>
		</item>
		<item>
			<title><![CDATA[Implementation of ECC on STM32f446]]></title>
			<link>https://www.wolfssl.com/forums/post6326.html#p6326</link>
			<description><![CDATA[<p>Dear friends<br />I am going to implement ECC on launchpad stm32 Nucleo f446re + with FreeRTOS</p><p>First. because I am a new guy in this field what configuration I have to do before programming.</p><p>I did these configurations<br />1- I compiled the library for STM32 cortex m4 and linked it to my IDE<br />2- I defined these Items based of WOLFSSL STM32 SUPPORT <br /> <a href="https://www.wolfssl.com/docs/stm32">https://www.wolfssl.com/docs/stm32</a><br /></p><div class="codebox"><pre><code>WOLFSSL_STM32F4
FREERTOS
HAVE_ECC_SIGN
HAVE_ECC_VERIFY
STM32_RNG
STM32_CRYPTO
STM32</code></pre></div><p>but the program gets stuck in the rng initiation function?<br /></p><div class="codebox"><pre><code> wc_InitRng(&amp;rng);</code></pre></div><p>I removed all other function to find the problem you can see the code here, it is Freertos template with two tasks that I put this function in task 2 <br /></p><div class="codebox"><pre><code>#include &lt;stdio.h&gt;
#include &lt;string.h&gt;
#include &lt;wolfssl/wolfcrypt/random.h&gt;
#include &lt;wolfssl/options.h&gt;
#include &lt;wolfssl/wolfcrypt/settings.h&gt;
#include &lt;wolfssl/wolfcrypt/ecc.h&gt;
#include &lt;wolfssl/wolfcrypt/sha256.h&gt;
#include &lt;wolfssl/wolfcrypt/hash.h&gt;
#include &quot;stm32f4xx.h&quot;
#include &quot;FreeRTOS.h&quot;  //provides TaskHandle_t
#include &quot;task.h&quot;  //to create tasks
/**define some macro for making condition in tasks***************************************/

/**define global variable **************************************************************/
TaskHandle_t xTaskHandle1=NULL;
TaskHandle_t xTaskHandle2=NULL;

WC_RNG rng;  // Data structure to keep random number
int ret = 0; // defining variable to keep status
/**prototype of functions****************************************************************/
extern void initialise_monitor_handles();  //0-to enable Semihosting -

void vTask1_handler(void *params);
void vTask2_handler(void *params);
/**main()********************************************************************************/
int main(void)
{
    //0-to enable Semihosting  exclude syscalls.c printf()
    initialise_monitor_handles();
    //project would work fine even without these two steps
    //1.Resets the RCC clock configuration to the default reset state.HSI= ON, PLL OFF, system clock = 16 MHz, cpu_clock= 16MHz
    RCC_DeInit();
    //2.update the SystemCoreClock variable
    SystemCoreClockUpdate();

    //3. lets create 2 tasks, task-1 and task-2
    xTaskCreate( vTask1_handler, &quot;Hello_Task-1&quot;, configMINIMAL_STACK_SIZE, NULL, 2, &amp;xTaskHandle1);
    xTaskCreate( vTask2_handler, &quot;Hello_Task-2&quot;, configMINIMAL_STACK_SIZE, NULL, 2, &amp;xTaskHandle2);

    printf(&quot;Start Program \n&quot;);

    //4. enable scheduler to schedule tasks to run
     vTaskStartScheduler();

    for(;;);
}



/**Task 1********************************************************************************/
void vTask1_handler(void *params)
{

    while(1)
    {
        printf(&quot;Start Task1\n&quot;);


        printf(&quot;ret is =%d&quot;,ret);
        printf(&quot;Finish Task 1 \n&quot;);
    }
}
/**Task 2********************************************************************************/
void vTask2_handler(void *params)
{
    while(1)
        {
        printf(&quot;Start Task2\n&quot;);
        ret = wc_InitRng(&amp;rng); //Gets the seed (from OS) and key cipher for rng.
        printf(&quot;ret is =%d&quot;,ret);
        printf(&quot;Finish Task 2 \n&quot;);

        }
}</code></pre></div><p>second, do you have any suggestions?</p>]]></description>
			<author><![CDATA[null@example.com (rahmanikivi724)]]></author>
			<pubDate>Tue, 19 Oct 2021 15:40:45 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post6326.html#p6326</guid>
		</item>
	</channel>
</rss>
