Topic: Building wolfSSL For DK-S7G2

Hi,
I'm trying to build the library on the Renesas S7G2 platform following the instructions in "https://github.com/wolfSSL/Renesas/tree … io/DK-S7G2" , but it keeps giving me compilation errors related to the thread interface (THREADX) because I imagine there is no correct interface setting in the file "\file wolfssl/wolfcrypt/types.h" but I don't understand where I'm going wrong.

Can anyone help me?

Thanks,
Simone

I'm using the updated platform software package SSP.2.6.1

Share

Re: Building wolfSSL For DK-S7G2

Hi Simone,

have you reached out to the Renesas support team yet?
Can you let me know what compilation errors you're seeing?

Warm regards, Anthony

Share

Re: Building wolfSSL For DK-S7G2

Hi, I don't think Renesas can help me in this case.
The ThreadX operating system has now been handed over by Microsoft (Azure RTOS) to the eclipse open source group and I don't think I can get much support there in the short term either.

The error I'm stuck on for now is due to the incorrect interpretation of the operating system interface parameters in the "types.h" file, I think in the section below:

#ifdef SINGLE_THREADED
#if defined(WC_32BIT_CPU)
typedef void* THREAD_RETURN;
#else
typedef unsigned int THREAD_RETURN;
#endif
typedef void* THREAD_TYPE;
#define WOLFSSL_THREAD
#elif defined(WOLFSSL_USER_THREADING)
/* User can define user specific threading types
* THREAD_RETURN
* TREAD_TYPE
* WOLFSSL_THREAD
* e.g.
* typedef unsigned int THREAD_RETURN;
* typedef size_t THREAD_TYPE;
* #define WOLFSSL_THREAD void
*
* User can also implement their own wolfSSL_NewThread(),
* wolfSSL_JoinThread() and wolfSSL_Cond signaling if they want.
* Otherwise, those functions are omitted.
*/
#elif defined(WOLFSSL_MDK_ARM) || defined(WOLFSSL_KEIL_TCP_NET) || \
defined(FREESCALE_MQX)
typedef unsigned int THREAD_RETURN;
typedef int THREAD_TYPE;
#define WOLFSSL_THREAD
#elif defined(WOLFSSL_NUCLEUS)
typedef unsigned int THREAD_RETURN;
typedef intptr_t THREAD_TYPE;
#define WOLFSSL_THREAD
#elif defined(WOLFSSL_TIRTOS)
typedef void THREAD_RETURN;
#define WOLFSSL_THREAD_VOID_RETURN
typedef Task_Handle THREAD_TYPE;
#define WOLFSSL_THREAD
#elif defined(WOLFSSL_ZEPHYR)
typedef void THREAD_RETURN;
#define WOLFSSL_THREAD_VOID_RETURN
typedef struct {
struct k_thread tid;
k_thread_stack_t* threadStack;
} THREAD_TYPE;
#define WOLFSSL_THREAD
extern void* wolfsslThreadHeapHint;
#elif defined(NETOS)
typedef UINT THREAD_RETURN;
typedef struct {
TX_THREAD tid;
void* threadStack;
} THREAD_TYPE;
#define WOLFSSL_THREAD
#define INFINITE TX_WAIT_FOREVER
#define WAIT_OBJECT_0 TX_NO_WAIT
#elif defined(WOLFSSL_LINUXKM)
typedef unsigned int THREAD_RETURN;
typedef size_t THREAD_TYPE;
#define WOLFSSL_THREAD
#elif defined(WOLFSSL_PTHREADS)
#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 \
&& !defined(__ppc__)
#include <dispatch/dispatch.h>
typedef struct COND_TYPE {
wolfSSL_Mutex mutex;
dispatch_semaphore_t cond;
} COND_TYPE;
#else
#include <pthread.h>
typedef struct COND_TYPE {
pthread_mutex_t mutex;
pthread_cond_t cond;
} COND_TYPE;
#endif
typedef void* THREAD_RETURN;
typedef pthread_t THREAD_TYPE;
#define WOLFSSL_COND
#define WOLFSSL_THREAD
#ifndef HAVE_SELFTEST
#define WOLFSSL_THREAD_NO_JOIN
#endif
#elif defined(FREERTOS) && defined(WOLFSSL_ESPIDF)
typedef void* THREAD_RETURN;
typedef pthread_t THREAD_TYPE;
#define WOLFSSL_THREAD
#elif defined(FREERTOS)
typedef unsigned int THREAD_RETURN;
typedef TaskHandle_t THREAD_TYPE;
#define WOLFSSL_THREAD
#elif defined(USE_WINDOWS_API)
typedef unsigned THREAD_RETURN;
typedef uintptr_t THREAD_TYPE;
typedef struct COND_TYPE {
wolfSSL_Mutex mutex;
HANDLE cond;
} COND_TYPE;
#define WOLFSSL_COND
#define INVALID_THREAD_VAL ((THREAD_TYPE)(INVALID_HANDLE_VALUE))
#define WOLFSSL_THREAD __stdcall
#if !defined(__MINGW32__)
#define WOLFSSL_THREAD_NO_JOIN __cdecl
#endif
#else
typedef unsigned int THREAD_RETURN;
typedef size_t THREAD_TYPE;
#define WOLFSSL_THREAD __stdcall
#endif

Where since I don't see anything related to ThreadX OS,
the part is consequently enabled:

typedef unsigned int THREAD_RETURN;
typedef size_t THREAD_TYPE;
#define WOLFSSL_THREAD __stdcall


but the "__stdcall" gives me an error as it is not recognized.


As seen below


d:\commesse\prg_trdp\wolfssl-5.7.4\wolfssl-5.7.4\wolfssl\wolfcrypt\types.h:1613:47: error: expected ')' before '*' token
1613 | typedef THREAD_RETURN (WOLFSSL_THREAD *THREAD_CB)(void* arg);

Share

Re: Building wolfSSL For DK-S7G2

Hi Simone,

Can you try using the supported SSP version 1.7.0?  That is the version specified in the README.md file.
It seems this inquiry is out of professional interest. 
In order to protect your confidentiality, if you have further questions, please send them to support@wolfssl.com. 

Warm regards, Anthony

Share

Re: Building wolfSSL For DK-S7G2

Hi,
I'm doing an evaluation to understand how to enhance the security of network communication of our platform for an application in the railway sector.

I'm currently using the TSL platform integrated with ThreadX NetxDUO (which is certainly more limited than what is offered in wolfSSL), but at least this has a stack with an example in which I was able to be quickly operational.

Now my development platform is aligned with the SSP 2.6.1 I didn't mean to go back.

In that case I will make a request where you indicated.

Thanks,
Simone

Share