1

(3 replies, posted in wolfSSL)

Thank you for the quick response, Jordan.

That fixed the errors.

I am now getting new error,

../sdk/v2.2.0/v2.2.0/modules/crypto/wolfssl/wolfssl/wolfcrypt/settings.h:1760:14: fatal error: C:/ncs/v2.2.0/zephyr/include/zephyr/kernel.h: No such file or directory
 1760 |     #include <C:/ncs/v2.2.0/zephyr/include/zephyr/kernel.h>

I think the above error is because the SDK in my PC is in different location and so I am getting this fatal error: No such file or directory.
Is it possible to get SDK path dynamically? like how VS Code get the SDK/toolchain path dynamically after installation?

2

(3 replies, posted in wolfSSL)

Hi,
I am new to the wolfSSL library and I am trying to run a test application "wolfssl_test" and I am getting errors.

 *  Executing task: nRF Connect: Generate config nrf5340dk_nrf5340_cpuapp for d:\work\nrf\app\wolfssl_test 

Building wolfssl_test
west build --build-dir d:/work/nrf/app/wolfssl_test/build d:/work/nrf/app/wolfssl_test --pristine --board nrf5340dk_nrf5340_cpuapp -- -DNCS_TOOLCHAIN_VERSION=NONE -DCONF_FILE=d:/work/nrf/app/wolfssl_test/prj.conf -DBOARD_ROOT=d:/work/nrf/app/wolfssl_test

-- west build: generating a build system
Loading Zephyr default modules (Zephyr base).
-- Application: D:/work/nrf/app/wolfssl_test
-- Found Python3: D:/work/nrf/sdk/v2.2.0/toolchains/v2.2.0/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter 
-- Cache files will be written to: D:/work/nrf/sdk/v2.2.0/v2.2.0/zephyr/.cache
-- Zephyr version: 3.2.99 (D:/work/nrf/sdk/v2.2.0/v2.2.0/zephyr)
-- Found west (found suitable version "0.14.0", minimum required is "0.7.1")
-- Board: nrf5340dk_nrf5340_cpuapp
-- Found host-tools: zephyr 0.15.1 (D:/work/nrf/sdk/v2.2.0/toolchains/v2.2.0/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.15.1 (D:/work/nrf/sdk/v2.2.0/toolchains/v2.2.0/opt/zephyr-sdk)
-- Found Dtc: D:/work/nrf/sdk/v2.2.0/toolchains/v2.2.0/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6") 
-- Found BOARD.dts: D:/work/nrf/sdk/v2.2.0/v2.2.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts
-- Generated zephyr.dts: D:/work/nrf/app/wolfssl_test/build/zephyr/zephyr.dts
-- Generated devicetree_generated.h: D:/work/nrf/app/wolfssl_test/build/zephyr/include/generated/devicetree_generated.h
-- Including generated dts.cmake file: D:/work/nrf/app/wolfssl_test/build/zephyr/dts.cmake

d:/work/nrf/app/wolfssl_test/prj.conf:4: warning: attempt to assign the value '16384' to the undefined symbol COMMON_LIBC_MALLOC_ARENA_SIZE

error: Aborting due to Kconfig warnings

Parsing D:/work/nrf/sdk/v2.2.0/v2.2.0/zephyr/Kconfig
Loaded configuration 'D:/work/nrf/sdk/v2.2.0/v2.2.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp_defconfig'
Merged configuration 'd:/work/nrf/app/wolfssl_test/prj.conf'
CMake Error at D:/work/nrf/sdk/v2.2.0/v2.2.0/zephyr/cmake/modules/kconfig.cmake:328 (message):
  command failed with return code: 1
Call Stack (most recent call first):
  D:/work/nrf/sdk/v2.2.0/v2.2.0/nrf/cmake/modules/kconfig.cmake:29 (include)
  D:/work/nrf/sdk/v2.2.0/v2.2.0/zephyr/cmake/modules/zephyr_default.cmake:108 (include)
  D:/work/nrf/sdk/v2.2.0/v2.2.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
  D:/work/nrf/sdk/v2.2.0/v2.2.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
  CMakeLists.txt:2 (find_package)


-- Configuring incomplete, errors occurred!
FATAL ERROR: command exited with status 1: 'D:\work\nrf\sdk\v2.2.0\toolchains\v2.2.0\opt\bin\cmake.EXE' '-DWEST_PYTHON=D:\work\nrf\sdk\v2.2.0\toolchains\v2.2.0\opt\bin\python.exe' '-Bd:\work\nrf\app\wolfssl_test\build' -GNinja -DBOARD=nrf5340dk_nrf5340_cpuapp -DNCS_TOOLCHAIN_VERSION=NONE -DCONF_FILE=d:/work/nrf/app/wolfssl_test/prj.conf -DBOARD_ROOT=d:/work/nrf/app/wolfssl_test '-Sd:\work\nrf\app\wolfssl_test'

 *  The terminal process terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task: nRF Connect: Build [pristine]: wolfssl_test/build (active) 

Building wolfssl_test
west build --build-dir d:/work/nrf/app/wolfssl_test/build d:/work/nrf/app/wolfssl_test --pristine --board nrf5340dk_nrf5340_cpuapp --no-sysbuild -- -DNCS_TOOLCHAIN_VERSION=NONE -DBOARD_ROOT=d:/work/nrf/app/wolfssl_test -DCONF_FILE=d:/work/nrf/app/wolfssl_test/prj.conf

-- west build: generating a build system
Loading Zephyr default modules (Zephyr base).
-- Application: D:/work/nrf/app/wolfssl_test
-- Found Python3: D:/work/nrf/sdk/v2.3.0/toolchains/v2.3.0/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter 
-- Cache files will be written to: D:/work/nrf/sdk/v2.3.0/v2.3.0/zephyr/.cache
-- Zephyr version: 3.2.99 (D:/work/nrf/sdk/v2.3.0/v2.3.0/zephyr)
-- Found west (found suitable version "0.14.0", minimum required is "0.7.1")
-- Board: nrf5340dk_nrf5340_cpuapp
-- Found host-tools: zephyr 0.15.2 (D:/work/nrf/sdk/v2.3.0/toolchains/v2.3.0/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.15.2 (D:/work/nrf/sdk/v2.3.0/toolchains/v2.3.0/opt/zephyr-sdk)
-- Found Dtc: D:/work/nrf/sdk/v2.3.0/toolchains/v2.3.0/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6") 
-- Found BOARD.dts: D:/work/nrf/sdk/v2.3.0/v2.3.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts
-- Generated zephyr.dts: D:/work/nrf/app/wolfssl_test/build/zephyr/zephyr.dts
-- Generated devicetree_generated.h: D:/work/nrf/app/wolfssl_test/build/zephyr/include/generated/devicetree_generated.h
-- Including generated dts.cmake file: D:/work/nrf/app/wolfssl_test/build/zephyr/dts.cmake
Parsing D:/work/nrf/sdk/v2.3.0/v2.3.0/zephyr/Kconfig
Loaded configuration 'D:/work/nrf/sdk/v2.3.0/v2.3.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp_defconfig'
Merged configuration 'd:/work/nrf/app/wolfssl_test/prj.conf'

d:/work/nrf/app/wolfssl_test/prj.conf:4: warning: attempt to assign the value '16384' to the undefined symbol COMMON_LIBC_MALLOC_ARENA_SIZE

error: Aborting due to Kconfig warnings

CMake Error at D:/work/nrf/sdk/v2.3.0/v2.3.0/zephyr/cmake/modules/kconfig.cmake:328 (message):
  command failed with return code: 1
Call Stack (most recent call first):
  D:/work/nrf/sdk/v2.3.0/v2.3.0/nrf/cmake/modules/kconfig.cmake:29 (include)
  D:/work/nrf/sdk/v2.3.0/v2.3.0/zephyr/cmake/modules/zephyr_default.cmake:108 (include)
  D:/work/nrf/sdk/v2.3.0/v2.3.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
  D:/work/nrf/sdk/v2.3.0/v2.3.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
  CMakeLists.txt:2 (find_package)


-- Configuring incomplete, errors occurred!
FATAL ERROR: command exited with status 1: 'D:\work\nrf\sdk\v2.3.0\toolchains\v2.3.0\opt\bin\cmake.EXE' '-DWEST_PYTHON=D:\work\nrf\sdk\v2.3.0\toolchains\v2.3.0\opt\bin\python.exe' '-Bd:\work\nrf\app\wolfssl_test\build' -GNinja -DBOARD=nrf5340dk_nrf5340_cpuapp -DNCS_TOOLCHAIN_VERSION=NONE -DBOARD_ROOT=d:/work/nrf/app/wolfssl_test -DCONF_FILE=d:/work/nrf/app/wolfssl_test/prj.conf '-Sd:\work\nrf\app\wolfssl_test'

 *  The terminal process terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

I have followed the setup from the below reference, and I have updated the SDK.
https://github.com/wolfSSL/wolfssl/blob … /README.md

Please let me know if I am missing any setup or configuration to be done.

Hi,
I am working with nRF5340 ZEPHYR RTOS. When I configure the wolfssl lib to build with my application I am getting the below error

/opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/posix/unistd.h:38:19: error: redefinition of 'gethostname'
   38 | static inline int gethostname(char *buf, size_t len)
      |                   ^~~~~~~~~~~
In file included from /opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/posix/unistd.h:13:
/opt/nordic/ncs/v2.3.0/zephyr/include/zephyr/net/socket.h:856:19: note: previous definition of 'gethostname' with type 'int(char *, size_t)' {aka 'int(char *, unsigned int)'}
  856 | static inline int gethostname(char *buf, size_t len)

Below are some details about our setup

Target board: nRF5340
NRF SDK version: v2.3.0

Below are the macro flags enabled in out prj.conf file

# wolfssl
CONFIG_WOLFSSL=y
CONFIG_WOLFSSL_LIBRARY=n
CONFIG_WOLFSSL_BUILTIN=y
CONFIG_WOLFSSL_TLS_VERSION_1_2=y

CONFIG_POSIX_API=y
CONFIG_POSIX_CLOCK=y
CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS=y
CONFIG_WOLFSSL_DEBUG=y

Have tried v2.2.0 and v2.3.0 and I see the same result on both SDKs

Please help me with this as this is a blocker for me. Thank you in advance.

4

(3 replies, posted in wolfSSL)

Hi Kareem,

Sorry for the late response, was busy with some other high priority task.

I configured the template file as you suggested and I do not see any significant change in the build size.
Please see below memory report when I try to build the project in nRF5340 with TF-M disabled and wolfSSL enabled.

Memory region         Used Size  Region Size  %age Used
            FLASH:         362612 B     441856 B     82.07%
                RAM:           81120 B        440 KB     18.00%
         IDT_LIST:                0 GB            2 KB      0.00%

I added below line to my prj.conf file

CONFIG_WOLFSSL_USER_SETTTINGS="user_settings_template.h"

And also I have enabled TARGET_EMBEDDED in the above template file

Please guide me if I am doing anything wrong.

Thank you in advance.

5

(3 replies, posted in wolfSSL)

Hi kareem,

Thanks for the quick response. We will go through the document you provided.

Regarding paid support agreement, I will discuss with our team and let you know. Thank you for the support.

Hi

I am working with nRF5340 device and have integrated wolfSSL library into my project.
I am facing memory overflow issue when I build the project with TFM(_ns) enabled.

Below is the error message I see

zephvr/zephyr pred.elf section text' will not fit in region 'FLASH'
Region 'FLASH' overflowed by 170820 bytes

Attached my prj.conf file

All I need from the wolf library is to support TLS 1.2 with minimal code size so, please let me know the setup I need to use it for my project.

Let me know if any additional information is required.

Thank you in advance.

Hi,
     I wanted to know if there are any example applications on wolfssl over BLE transport for ios/Android platforms. If so please share the examples or any related documents

8

(6 replies, posted in wolfSSL)

Hi,
    Please find the debug log and the cert.

9

(6 replies, posted in wolfSSL)

Hi,

    I am trying to run the example code "wolfssl_ts_sock" on the zephyr port on the nrf5340 device.
    But the application fails to load the CA certificate and following error is printed on the console
    ERROR: failed to load CA certificate
    Client return -1
    Client memory stats
    static memory was not used with sslDone
    Server return -1
    Server memory Stats

    My user_configuration is
   
#undef  WOLFSSL_ZEPHYR
#define WOLFSSL_ZEPHYR

#if 0
#undef  SINGLE_THREADED
#define SINGLE_THREADED
#endif

#undef  TFM_TIMING_RESISTANT
#define TFM_TIMING_RESISTANT

#undef  ECC_TIMING_RESISTANT
#define ECC_TIMING_RESISTANT

#undef  WC_RSA_BLINDING
#define WC_RSA_BLINDING

#undef  HAVE_AESGCM
#define HAVE_AESGCM

#undef  WOLFSSL_SHA512
#define WOLFSSL_SHA512

#undef  WOLFSSL_SHA384
#define WOLFSSL_SHA384

#undef  NO_DSA
#define NO_DSA

#undef  HAVE_ECC
#define HAVE_ECC

#undef  TFM_ECC256
#define TFM_ECC256

#undef  WOLFSSL_BASE64_ENCODE
#define WOLFSSL_BASE64_ENCODE

#undef  NO_RC4
#define NO_RC4

#undef  WOLFSSL_SHA224
#define WOLFSSL_SHA224

#undef  WOLFSSL_SHA3
#define WOLFSSL_SHA3

#undef  HAVE_POLY1305
#define HAVE_POLY1305

#undef  HAVE_ONE_TIME_AUTH
#define HAVE_ONE_TIME_AUTH

#undef  HAVE_CHACHA
#define HAVE_CHACHA

#undef  HAVE_HASHDRBG
#define HAVE_HASHDRBG

#undef  NO_FILESYSTEM
#define NO_FILESYSTEM

#undef  HAVE_TLS_EXTENSIONS
#define HAVE_TLS_EXTENSIONS

#undef  HAVE_SUPPORTED_CURVES
#define HAVE_SUPPORTED_CURVES

#undef  HAVE_EXTENDED_MASTER
#define HAVE_EXTENDED_MASTER

#undef  NO_PSK
#define NO_PSK

#undef  NO_MD4
#define NO_MD4

#undef  NO_PWDBASED
#define NO_PWDBASED

#undef  USE_FAST_MATH
#define USE_FAST_MATH

#undef  WOLFSSL_NO_ASM
#define WOLFSSL_NO_ASM

#undef  WOLFSSL_X86_BUILD
#define WOLFSSL_X86_BUILD

#undef  WC_NO_ASYNC_THREADING
#define WC_NO_ASYNC_THREADING

#undef  NO_DES3
#define NO_DES3

#undef  WOLFSSL_STATIC_MEMORY
#define WOLFSSL_STATIC_MEMORY

#undef  WOLFSSL_TLS13
#define WOLFSSL_TLS13

#undef  HAVE_HKDF
#define HAVE_HKDF

#undef  WC_RSA_PSS
#define WC_RSA_PSS

#undef  HAVE_FFDHE_2048
#define HAVE_FFDHE_2048


#if 0
#undef  WOLFSSL_HAVE_SP_RSA
#define WOLFSSL_HAVE_SP_RSA
#undef  WOLFSSL_HAVE_SP_DH
#define WOLFSSL_HAVE_SP_DH
#undef  WOLFSSL_HAVE_SP_ECC
#define WOLFSSL_HAVE_SP_ECC
#endif

#if defined(CONFIG_WOLFSSL_DEBUG)
#undef  DEBUG_WOLFSSL
#define DEBUG_WOLFSSL
#endif


what could be wrong?

Best Regards

10

(6 replies, posted in wolfSSL)

Hi Kareem,

I am using wolfSSL-5.5.4 version
toolchain is "nrf connect SDK" version v2.2.0

11

(6 replies, posted in wolfSSL)

Hi

I am trying to implement wollfssl on nrf5340dk by using the wolfssl zephyr port.
I have taken "wolfssl_test" example in which I am getting compilation errors

nrf5340_toolchain_2_1_0\v2.2.0\modules\crypto\wolfssl\wolfcrypt\src\sp_arm32.c:237:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'asm'

nrf5340_toolchain_2_1_0\v2.2.0\modules\crypto\wolfssl\wolfcrypt\src\sp_arm32.c:2676:21: error: 'r' undeclared (first use in this function)
2676 |         : [r] "+r" (r), [a] "+r" (a), [b ] "+r" (b)

I get many errors further in the file with the similar 'asm' undefined.

While reading on the internet somewhere I read that only the g++ compiler supports the asm attribute.
So for a trial I added this definition at the beginning of sp_arm32.c

#define asm __asm__   

which resolved the complation issues and the project was built successfully.

Just wanted clarify if the above code is a valid approach or am I missing a necessary configuration in the project?