I'm trying to run the wolfSSL crypto benchmarks on an NXP S32G3.  The S32G3 has several Arm Cortex M7 cores.

1.  WolfSSL version is 5.7.0
2.  Running on Bare Metal, No OS
3.  Compiler - NXP S32 Design Studio version 3.5 

My code is crashing in the wc_InitRng_ex() function.

I can't use printf() for typical debug information, since my only connection to the device is via a putty terminal interface over UART.  The call to wc_InitRng_ex() fails in such a way that I don't even get any feedback messages.  Yet, I think the failure occurs inside this function because if I comment out this function call then I see debug messages that come after this.

I suspect solving my problem may be related to correctly configuring the device in the user_settings.h file.  I'm just not sure what #defines I need to set or not set.

BTW- everything runs just fine for me when compiling in Visual Studio and running on Windows.  Unfortunately, I really need benchmarks on the M7.

2

(4 replies, posted in wolfSSL)

Still learning a ton here.  I chanced my ARCHFLAGS to -mcpu=cortex-m3 -mthumb -mabi=aapcs -DUSE_WOLF_ARM_STARTUP
and I was able to put mrs instructions back into armtarget.c

3

(4 replies, posted in wolfSSL)

Well, I think I spoke too soon.  I did a make clean, to make sure I was fully building for my target.

My Makefile.common contains:
ARCHFLAGS ?= -march=armv7 -mthumb -mabi=aapcs -DUSE_WOLF_ARM_STARTUP

When I build I was getting this error:
Error: selected processor does not support requested special purpose register -- `mrs r0,psp'

I removed the offending lines from armtarget.c:
       " mrs r0, psp     \n"  /* otherwise: stack pointer is in PSP */
        " mrs r0, msp     \n"  /* load stack pointer into R0 */

After this removal I get valid *.elf and *.hex files in my Build directory. Of course I have no idea what I've now done to the HardFault_Handler() function

4

(4 replies, posted in wolfSSL)

I was mistakenly using ./configure and make from the root wolfssl directory and at the same time I was also modifying Makefile.common.  I started everything over from the GitHub link you provided and I was successful in building for arm7m.  Of course now I need to find a target to run on.

One point of feedback I was getting an error related to libwolfssl.a
make[1]: Entering directory '/home/dave/Downloads/wolfssl/IDE/GCC-ARM'
make[1]: *** No rule to make target 'Build/wolfcrypt_first.o', needed by 'Build/libwolfssl.a'.  Stop.

I did notice that this option was dependent upon FIPS being defind.  I did have to comment out:
FIPS?=1

I'm assuming I still have a valid build, but would appeciate any feedback on that.  Other info I saw in GitHub seemed to imply that FIPS is a separate license.

5

(4 replies, posted in wolfSSL)

I'm on a Ubuntu 22.04.4 LTS machine.  I have no problems building wolfSSL for my OS.
./configure
make
sudo make install

The above runs perfectly.

But, what I really need to do is cross-compile for an arm7m target.

I used the following command to create my makefile:
./configure --host=arm-non-eabi CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld STRIP=arm-none-eabi-strip \
RANLIB=arm-none-eabi-ranlib  --prefix=$HOME/wolfssl-arm \
CFLAGS="-march=armv7-m --specs=nosys.specs -DHAVE_PK_CALLBACKS -DWOLFSSL_USER_IO -DNO_WRITEV" \
--disable-filesystem --enable-fastmath --disable-shared

Creating my makefile also works fine.

When I try to run make I get many undefined references such as:
CCLD     wolfcrypt/test/testwolfcrypt
/usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/bin/ld: wolfcrypt/benchmark/benchmark.o: in function `bench_stats_asym_finish_ex.constprop.0':
benchmark.c:(.text+0x292): undefined reference to `clock_gettime'
/usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/bin/ld: wolfcrypt/benchmark/benchmark.o: in function `bench_stats_sym_finish.constprop.0':
benchmark.c:(.text+0x472): undefined reference to `clock_gettime'
/usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/bin/ld: wolfcrypt/benchmark/benchmark.o: in function `bench_hmac.constprop.0':
benchmark.c:(.text+0x730): undefined reference to `clock_gettime'
/usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/bin/ld: benchmark.c:(.text+0x774): undefined reference to `__aeabi_read_tp'
/usr/lib/gcc/arm-none-eabi/10.3.1/../../../arm-none-eabi/bin/ld: benchmark.c:(.text+0x7cc): undefined reference to `clock_gettime'

I assume I have some missing libraries, but no matter what I do I can't get the libraries into the make process to fix this issue.

I've also tried to make changes in <wolfssl_root>/IDE/GCC-ARM/Makefile.common.  Is this a factor, could corruption here affect my build. 
Any help would be much appreciated.